linux/drivers/media/pci/netup_unidvb/netup_unidvb_core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * netup_unidvb_core.c
 *
 * Main module for NetUP Universal Dual DVB-CI
 *
 * Copyright (C) 2014 NetUP Inc.
 * Copyright (C) 2014 Sergey Kozlov <[email protected]>
 * Copyright (C) 2014 Abylay Ospan <[email protected]>
 */

#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kmod.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/list.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-vmalloc.h>

#include "netup_unidvb.h"
#include "cxd2841er.h"
#include "horus3a.h"
#include "ascot2e.h"
#include "helene.h"
#include "lnbh25.h"

static int spi_enable;
module_param(spi_enable, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_VERSION();
MODULE_LICENSE();

DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);

/* Avalon-MM PCI-E registers */
#define AVL_PCIE_IENR
#define AVL_PCIE_ISR
#define AVL_IRQ_ENABLE
#define AVL_IRQ_ASSERTED
/* GPIO registers */
#define GPIO_REG_IO
#define GPIO_REG_IO_TOGGLE
#define GPIO_REG_IO_SET
#define GPIO_REG_IO_CLEAR
/* GPIO bits */
#define GPIO_FEA_RESET
#define GPIO_FEB_RESET
#define GPIO_RFA_CTL
#define GPIO_RFB_CTL
#define GPIO_FEA_TU_RESET
#define GPIO_FEB_TU_RESET
/* DMA base address */
#define NETUP_DMA0_ADDR
#define NETUP_DMA1_ADDR
/* 8 DMA blocks * 128 packets * 188 bytes*/
#define NETUP_DMA_BLOCKS_COUNT
#define NETUP_DMA_PACKETS_COUNT
/* DMA status bits */
#define BIT_DMA_RUN
#define BIT_DMA_ERROR
#define BIT_DMA_IRQ

/**
 * struct netup_dma_regs - the map of DMA module registers
 * @ctrlstat_set:	Control register, write to set control bits
 * @ctrlstat_clear:	Control register, write to clear control bits
 * @start_addr_lo:	DMA ring buffer start address, lower part
 * @start_addr_hi:	DMA ring buffer start address, higher part
 * @size:		DMA ring buffer size register
 *			* Bits [0-7]:	DMA packet size, 188 bytes
 *			* Bits [16-23]:	packets count in block, 128 packets
 *			* Bits [24-31]:	blocks count, 8 blocks
 * @timeout:		DMA timeout in units of 8ns
 *			For example, value of 375000000 equals to 3 sec
 * @curr_addr_lo:	Current ring buffer head address, lower part
 * @curr_addr_hi:	Current ring buffer head address, higher part
 * @stat_pkt_received:	Statistic register, not tested
 * @stat_pkt_accepted:	Statistic register, not tested
 * @stat_pkt_overruns:	Statistic register, not tested
 * @stat_pkt_underruns:	Statistic register, not tested
 * @stat_fifo_overruns:	Statistic register, not tested
 */
struct netup_dma_regs {} __packed __aligned();

struct netup_unidvb_buffer {};

static int netup_unidvb_tuner_ctrl(void *priv, int is_dvb_tc);
static void netup_unidvb_queue_cleanup(struct netup_dma *dma);

static struct cxd2841er_config demod_config =;

static struct horus3a_config horus3a_conf =;

static struct ascot2e_config ascot2e_conf =;

static struct helene_config helene_conf =;

static struct lnbh25_config lnbh25_conf =;

static int netup_unidvb_tuner_ctrl(void *priv, int is_dvb_tc)
{}

static void netup_unidvb_dev_enable(struct netup_unidvb_dev *ndev)
{}

static void netup_unidvb_dma_enable(struct netup_dma *dma, int enable)
{}

static irqreturn_t netup_dma_interrupt(struct netup_dma *dma)
{}

static irqreturn_t netup_unidvb_isr(int irq, void *dev_id)
{}

static int netup_unidvb_queue_setup(struct vb2_queue *vq,
				    unsigned int *nbuffers,
				    unsigned int *nplanes,
				    unsigned int sizes[],
				    struct device *alloc_devs[])
{}

static int netup_unidvb_buf_prepare(struct vb2_buffer *vb)
{}

static void netup_unidvb_buf_queue(struct vb2_buffer *vb)
{}

static int netup_unidvb_start_streaming(struct vb2_queue *q, unsigned int count)
{}

static void netup_unidvb_stop_streaming(struct vb2_queue *q)
{}

static const struct vb2_ops dvb_qops =;

static int netup_unidvb_queue_init(struct netup_dma *dma,
				   struct vb2_queue *vb_queue)
{}

static int netup_unidvb_dvb_init(struct netup_unidvb_dev *ndev,
				 int num)
{}

static void netup_unidvb_dvb_fini(struct netup_unidvb_dev *ndev, int num)
{}

static int netup_unidvb_dvb_setup(struct netup_unidvb_dev *ndev)
{}

static int netup_unidvb_ring_copy(struct netup_dma *dma,
				  struct netup_unidvb_buffer *buf)
{}

static void netup_unidvb_dma_worker(struct work_struct *work)
{}

static void netup_unidvb_queue_cleanup(struct netup_dma *dma)
{}

static void netup_unidvb_dma_timeout(struct timer_list *t)
{}

static int netup_unidvb_dma_init(struct netup_unidvb_dev *ndev, int num)
{}

static void netup_unidvb_dma_fini(struct netup_unidvb_dev *ndev, int num)
{}

static int netup_unidvb_dma_setup(struct netup_unidvb_dev *ndev)
{}

static int netup_unidvb_ci_setup(struct netup_unidvb_dev *ndev,
				 struct pci_dev *pci_dev)
{}

static int netup_unidvb_request_mmio(struct pci_dev *pci_dev)
{}

static int netup_unidvb_request_modules(struct device *dev)
{}

static int netup_unidvb_initdev(struct pci_dev *pci_dev,
				const struct pci_device_id *pci_id)
{}

static void netup_unidvb_finidev(struct pci_dev *pci_dev)
{}


static const struct pci_device_id netup_unidvb_pci_tbl[] =;
MODULE_DEVICE_TABLE(pci, netup_unidvb_pci_tbl);

static struct pci_driver netup_unidvb_pci_driver =;

module_pci_driver();