linux/drivers/media/pci/cx23885/altera-ci.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * altera-ci.c
 *
 *  CI driver in conjunction with NetUp Dual DVB-T/C RF CI card
 *
 * Copyright (C) 2010,2011 NetUP Inc.
 * Copyright (C) 2010,2011 Igor M. Liplianin <[email protected]>
 */

/*
 * currently cx23885 GPIO's used.
 * GPIO-0 ~INT in
 * GPIO-1 TMS out
 * GPIO-2 ~reset chips out
 * GPIO-3 to GPIO-10 data/addr for CA in/out
 * GPIO-11 ~CS out
 * GPIO-12 AD_RG out
 * GPIO-13 ~WR out
 * GPIO-14 ~RD out
 * GPIO-15 ~RDY in
 * GPIO-16 TCK out
 * GPIO-17 TDO in
 * GPIO-18 TDI out
 */
/*
 *  Bit definitions for MC417_RWD and MC417_OEN registers
 * bits 31-16
 * +-----------+
 * | Reserved  |
 * +-----------+
 *   bit 15  bit 14  bit 13 bit 12  bit 11  bit 10  bit 9   bit 8
 * +-------+-------+-------+-------+-------+-------+-------+-------+
 * |  TDI  |  TDO  |  TCK  |  RDY# |  #RD  |  #WR  | AD_RG |  #CS  |
 * +-------+-------+-------+-------+-------+-------+-------+-------+
 *  bit 7   bit 6   bit 5   bit 4   bit 3   bit 2   bit 1   bit 0
 * +-------+-------+-------+-------+-------+-------+-------+-------+
 * |  DATA7|  DATA6|  DATA5|  DATA4|  DATA3|  DATA2|  DATA1|  DATA0|
 * +-------+-------+-------+-------+-------+-------+-------+-------+
 */

#define pr_fmt(fmt)

#include <media/dvb_demux.h>
#include <media/dvb_frontend.h>
#include "altera-ci.h"
#include <media/dvb_ca_en50221.h>

/* FPGA regs */
#define NETUP_CI_INT_CTRL
#define NETUP_CI_BUSCTRL2
#define NETUP_CI_ADDR0
#define NETUP_CI_ADDR1
#define NETUP_CI_DATA
#define NETUP_CI_BUSCTRL
#define NETUP_CI_PID_ADDR0
#define NETUP_CI_PID_ADDR1
#define NETUP_CI_PID_DATA
#define NETUP_CI_TSA_DIV
#define NETUP_CI_TSB_DIV
#define NETUP_CI_REVISION

/* const for ci op */
#define NETUP_CI_FLG_CTL
#define NETUP_CI_FLG_RD
#define NETUP_CI_FLG_AD

static unsigned int ci_dbg;
module_param(ci_dbg, int, 0644);
MODULE_PARM_DESC();

static unsigned int pid_dbg;
module_param(pid_dbg, int, 0644);
MODULE_PARM_DESC();

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

#define ci_dbg_print(fmt, args...)

#define pid_dbg_print(fmt, args...)

struct altera_ci_state;
struct netup_hw_pid_filter;

struct fpga_internal {};

/* stores all private variables for communication with CI */
struct altera_ci_state {};

/* stores all private variables for hardware pid filtering */
struct netup_hw_pid_filter {};

/* internal params node */
struct fpga_inode {};

/* first internal params */
static struct fpga_inode *fpga_first_inode;

/* find chip by dev */
static struct fpga_inode *find_inode(void *dev)
{}
/* check demux */
static struct fpga_internal *check_filter(struct fpga_internal *temp_int,
						void *demux_dev, int filt_nr)
{}

/* find chip by demux */
static struct fpga_inode *find_dinode(void *demux_dev)
{}

/* deallocating chip */
static void remove_inode(struct fpga_internal *internal)
{}

/* allocating new chip */
static struct fpga_inode *append_internal(struct fpga_internal *internal)
{}

static int netup_fpga_op_rw(struct fpga_internal *inter, int addr,
							u8 val, u8 read)
{}

/* flag - mem/io, read - read/write */
static int altera_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot,
				u8 flag, u8 read, int addr, u8 val)
{}

static int altera_ci_read_attribute_mem(struct dvb_ca_en50221 *en50221,
					int slot, int addr)
{}

static int altera_ci_write_attribute_mem(struct dvb_ca_en50221 *en50221,
					 int slot, int addr, u8 data)
{}

static int altera_ci_read_cam_ctl(struct dvb_ca_en50221 *en50221,
				  int slot, u8 addr)
{}

static int altera_ci_write_cam_ctl(struct dvb_ca_en50221 *en50221, int slot,
				   u8 addr, u8 data)
{}

static int altera_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot)
{}

static int altera_ci_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot)
{}

static int altera_ci_slot_ts_ctl(struct dvb_ca_en50221 *en50221, int slot)
{}

/* work handler */
static void netup_read_ci_status(struct work_struct *work)
{}

/* CI irq handler */
int altera_ci_irq(void *dev)
{}
EXPORT_SYMBOL();

static int altera_poll_ci_slot_status(struct dvb_ca_en50221 *en50221,
				      int slot, int open)
{}

static void altera_hw_filt_release(void *main_dev, int filt_nr)
{}

void altera_ci_release(void *dev, int ci_nr)
{}
EXPORT_SYMBOL();

static void altera_pid_control(struct netup_hw_pid_filter *pid_filt,
		u16 pid, int onoff)
{}

static void altera_toggle_fullts_streaming(struct netup_hw_pid_filter *pid_filt,
					int filt_nr, int onoff)
{}

static int altera_pid_feed_control(void *demux_dev, int filt_nr,
		struct dvb_demux_feed *feed, int onoff)
{}

static int altera_ci_start_feed(struct dvb_demux_feed *feed, int num)
{}

static int altera_ci_stop_feed(struct dvb_demux_feed *feed, int num)
{}

static int altera_ci_start_feed_1(struct dvb_demux_feed *feed)
{}

static int altera_ci_stop_feed_1(struct dvb_demux_feed *feed)
{}

static int altera_ci_start_feed_2(struct dvb_demux_feed *feed)
{}

static int altera_ci_stop_feed_2(struct dvb_demux_feed *feed)
{}

static int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr)
{}

int altera_ci_init(struct altera_ci_config *config, int ci_nr)
{}
EXPORT_SYMBOL();

int altera_ci_tuner_reset(void *dev, int ci_nr)
{}
EXPORT_SYMBOL();