#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/io.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/timer.h>
#include <linux/i2c.h>
#include <linux/swab.h>
#include <linux/vmalloc.h>
#include "ddbridge.h"
#include "ddbridge-i2c.h"
#include "ddbridge-regs.h"
#include "ddbridge-max.h"
#include "ddbridge-ci.h"
#include "ddbridge-io.h"
#include "tda18271c2dd.h"
#include "stv6110x.h"
#include "stv090x.h"
#include "lnbh24.h"
#include "drxk.h"
#include "stv0367.h"
#include "stv0367_priv.h"
#include "cxd2841er.h"
#include "tda18212.h"
#include "stv0910.h"
#include "stv6111.h"
#include "lnbh25.h"
#include "cxd2099.h"
#include "ddbridge-dummy-fe.h"
#define DDB_MAX_ADAPTER …
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int adapter_alloc;
module_param(adapter_alloc, int, 0444);
MODULE_PARM_DESC(…) …;
static int ci_bitrate = …;
module_param(ci_bitrate, int, 0444);
MODULE_PARM_DESC(…) …;
static int ts_loop = …;
module_param(ts_loop, int, 0444);
MODULE_PARM_DESC(…) …;
static int xo2_speed = …;
module_param(xo2_speed, int, 0444);
MODULE_PARM_DESC(…) …;
#ifdef __arm__
static int alt_dma = 1;
#else
static int alt_dma;
#endif
module_param(alt_dma, int, 0444);
MODULE_PARM_DESC(…) …;
static int no_init;
module_param(no_init, int, 0444);
MODULE_PARM_DESC(…) …;
static int stv0910_single;
module_param(stv0910_single, int, 0444);
MODULE_PARM_DESC(…) …;
static int dma_buf_num = …;
module_param(dma_buf_num, int, 0444);
MODULE_PARM_DESC(…) …;
static int dma_buf_size = …;
module_param(dma_buf_size, int, 0444);
MODULE_PARM_DESC(…) …;
static int dummy_tuner;
module_param(dummy_tuner, int, 0444);
MODULE_PARM_DESC(…) …;
static DEFINE_MUTEX(redirect_lock);
static struct workqueue_struct *ddb_wq;
static struct ddb *ddbs[DDB_MAX_ADAPTER];
struct ddb_irq *ddb_irq_set(struct ddb *dev, u32 link, u32 nr,
void (*handler)(void *), void *data)
{ … }
static void ddb_set_dma_table(struct ddb_io *io)
{ … }
static void ddb_set_dma_tables(struct ddb *dev)
{ … }
static void ddb_redirect_dma(struct ddb *dev,
struct ddb_dma *sdma,
struct ddb_dma *ddma)
{ … }
static int ddb_unredirect(struct ddb_port *port)
{ … }
static int ddb_redirect(u32 i, u32 p)
{ … }
static void dma_free(struct pci_dev *pdev, struct ddb_dma *dma, int dir)
{ … }
static int dma_alloc(struct pci_dev *pdev, struct ddb_dma *dma, int dir)
{ … }
int ddb_buffers_alloc(struct ddb *dev)
{ … }
void ddb_buffers_free(struct ddb *dev)
{ … }
static void calc_con(struct ddb_output *output, u32 *con, u32 *con2, u32 flags)
{ … }
static void ddb_output_start(struct ddb_output *output)
{ … }
static void ddb_output_stop(struct ddb_output *output)
{ … }
static void ddb_input_stop(struct ddb_input *input)
{ … }
static void ddb_input_start(struct ddb_input *input)
{ … }
static void ddb_input_start_all(struct ddb_input *input)
{ … }
static void ddb_input_stop_all(struct ddb_input *input)
{ … }
static u32 ddb_output_free(struct ddb_output *output)
{ … }
static ssize_t ddb_output_write(struct ddb_output *output,
const __user u8 *buf, size_t count)
{ … }
static u32 ddb_input_avail(struct ddb_input *input)
{ … }
static ssize_t ddb_input_read(struct ddb_input *input,
__user u8 *buf, size_t count)
{ … }
static ssize_t ts_write(struct file *file, const __user char *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t ts_read(struct file *file, __user char *buf,
size_t count, loff_t *ppos)
{ … }
static __poll_t ts_poll(struct file *file, poll_table *wait)
{ … }
static int ts_release(struct inode *inode, struct file *file)
{ … }
static int ts_open(struct inode *inode, struct file *file)
{ … }
static const struct file_operations ci_fops = …;
static struct dvb_device dvbdev_ci = …;
static int locked_gate_ctrl(struct dvb_frontend *fe, int enable)
{ … }
static int demod_attach_drxk(struct ddb_input *input)
{ … }
static int tuner_attach_tda18271(struct ddb_input *input)
{ … }
static struct stv0367_config ddb_stv0367_config[] = …;
static int demod_attach_stv0367(struct ddb_input *input)
{ … }
static int tuner_tda18212_ping(struct ddb_input *input, unsigned short adr)
{ … }
static int demod_attach_cxd28xx(struct ddb_input *input, int par, int osc24)
{ … }
static int tuner_attach_tda18212(struct ddb_input *input, u32 porttype)
{ … }
static struct stv090x_config stv0900 = …;
static struct stv090x_config stv0900_aa = …;
static struct stv6110x_config stv6110a = …;
static struct stv6110x_config stv6110b = …;
static int demod_attach_stv0900(struct ddb_input *input, int type)
{ … }
static int tuner_attach_stv6110(struct ddb_input *input, int type)
{ … }
static const struct stv0910_cfg stv0910_p = …;
static const struct lnbh25_config lnbh25_cfg = …;
static int has_lnbh25(struct i2c_adapter *i2c, u8 adr)
{ … }
static int demod_attach_stv0910(struct ddb_input *input, int type, int tsfast)
{ … }
static int tuner_attach_stv6111(struct ddb_input *input, int type)
{ … }
static int demod_attach_dummy(struct ddb_input *input)
{ … }
static int start_feed(struct dvb_demux_feed *dvbdmxfeed)
{ … }
static int stop_feed(struct dvb_demux_feed *dvbdmxfeed)
{ … }
static void dvb_input_detach(struct ddb_input *input)
{ … }
static int dvb_register_adapters(struct ddb *dev)
{ … }
static void dvb_unregister_adapters(struct ddb *dev)
{ … }
static int dvb_input_attach(struct ddb_input *input)
{ … }
static int port_has_encti(struct ddb_port *port)
{ … }
static int port_has_cxd(struct ddb_port *port, u8 *type)
{ … }
static int port_has_xo2(struct ddb_port *port, u8 *type, u8 *id)
{ … }
static int port_has_stv0900(struct ddb_port *port)
{ … }
static int port_has_stv0900_aa(struct ddb_port *port, u8 *id)
{ … }
static int port_has_drxks(struct ddb_port *port)
{ … }
static int port_has_stv0367(struct ddb_port *port)
{ … }
static int init_xo2(struct ddb_port *port)
{ … }
static int init_xo2_ci(struct ddb_port *port)
{ … }
static int port_has_cxd28xx(struct ddb_port *port, u8 *id)
{ … }
static char *xo2names[] = …;
static char *xo2types[] = …;
static void ddb_port_probe(struct ddb_port *port)
{ … }
static int ddb_port_attach(struct ddb_port *port)
{ … }
int ddb_ports_attach(struct ddb *dev)
{ … }
void ddb_ports_detach(struct ddb *dev)
{ … }
static void input_write_output(struct ddb_input *input,
struct ddb_output *output)
{ … }
static void output_ack_input(struct ddb_output *output,
struct ddb_input *input)
{ … }
static void input_write_dvb(struct ddb_input *input,
struct ddb_input *input2)
{ … }
static void input_work(struct work_struct *work)
{ … }
static void input_handler(void *data)
{ … }
static void output_work(struct work_struct *work)
{ … }
static void output_handler(void *data)
{ … }
static const struct ddb_regmap *io_regmap(struct ddb_io *io, int link)
{ … }
static void ddb_dma_init(struct ddb_io *io, int nr, int out)
{ … }
static void ddb_input_init(struct ddb_port *port, int nr, int pnr, int anr)
{ … }
static void ddb_output_init(struct ddb_port *port, int nr)
{ … }
static int ddb_port_match_i2c(struct ddb_port *port)
{ … }
static int ddb_port_match_link_i2c(struct ddb_port *port)
{ … }
void ddb_ports_init(struct ddb *dev)
{ … }
void ddb_ports_release(struct ddb *dev)
{ … }
#define IRQ_HANDLE(_nr) …
#define IRQ_HANDLE_NIBBLE(_shift) …
#define IRQ_HANDLE_BYTE(_shift) …
static void irq_handle_msg(struct ddb *dev, u32 s)
{ … }
static void irq_handle_io(struct ddb *dev, u32 s)
{ … }
irqreturn_t ddb_irq_handler0(int irq, void *dev_id)
{ … }
irqreturn_t ddb_irq_handler1(int irq, void *dev_id)
{ … }
irqreturn_t ddb_irq_handler(int irq, void *dev_id)
{ … }
static int reg_wait(struct ddb *dev, u32 reg, u32 bit)
{ … }
static int flashio(struct ddb *dev, u32 lnr, u8 *wbuf, u32 wlen, u8 *rbuf,
u32 rlen)
{ … }
int ddbridge_flashread(struct ddb *dev, u32 link, u8 *buf, u32 addr, u32 len)
{ … }
#define DDB_NAME …
static u32 ddb_num;
static int ddb_major;
static DEFINE_MUTEX(ddb_mutex);
static int ddb_release(struct inode *inode, struct file *file)
{ … }
static int ddb_open(struct inode *inode, struct file *file)
{ … }
static long ddb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ … }
static const struct file_operations ddb_fops = …;
static char *ddb_devnode(const struct device *device, umode_t *mode)
{ … }
#define __ATTR_MRO(_name, _show) …
#define __ATTR_MWO(_name, _store) …
static ssize_t ports_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t ts_irq_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t i2c_irq_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t fan_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t fan_store(struct device *device, struct device_attribute *d,
const char *buf, size_t count)
{ … }
static ssize_t fanspeed_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t temp_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t ctemp_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t led_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static void ddb_set_led(struct ddb *dev, int num, int val)
{ … }
static ssize_t led_store(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t snr_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t bsnr_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t bpsnr_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t redirect_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t redirect_store(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t gap_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t gap_store(struct device *device, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t version_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t hwid_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t regmap_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t fmode_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t devid_show(struct device *device,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t fmode_store(struct device *device, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static struct device_attribute ddb_attrs[] = …;
static struct device_attribute ddb_attrs_temp[] = …;
static struct device_attribute ddb_attrs_fan[] = …;
static struct device_attribute ddb_attrs_snr[] = …;
static struct device_attribute ddb_attrs_ctemp[] = …;
static struct device_attribute ddb_attrs_led[] = …;
static struct device_attribute ddb_attrs_fanspeed[] = …;
static struct class ddb_class = …;
static int ddb_class_create(void)
{ … }
static void ddb_class_destroy(void)
{ … }
static void ddb_device_attrs_del(struct ddb *dev)
{ … }
static int ddb_device_attrs_add(struct ddb *dev)
{ … }
int ddb_device_create(struct ddb *dev)
{ … }
void ddb_device_destroy(struct ddb *dev)
{ … }
static void tempmon_setfan(struct ddb_link *link)
{ … }
static void temp_handler(void *data)
{ … }
static int tempmon_init(struct ddb_link *link, int first_time)
{ … }
static int ddb_init_tempmon(struct ddb_link *link)
{ … }
static int ddb_init_boards(struct ddb *dev)
{ … }
int ddb_init(struct ddb *dev)
{ … }
void ddb_unmap(struct ddb *dev)
{ … }
int ddb_exit_ddbridge(int stage, int error)
{ … }
int ddb_init_ddbridge(void)
{ … }