#include "cx23885.h"
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/kthread.h>
#include <linux/file.h>
#include <linux/suspend.h>
#include <media/v4l2-common.h>
#include <media/dvb_ca_en50221.h>
#include "s5h1409.h"
#include "s5h1411.h"
#include "mt2131.h"
#include "tda8290.h"
#include "tda18271.h"
#include "lgdt330x.h"
#include "xc4000.h"
#include "xc5000.h"
#include "max2165.h"
#include "tda10048.h"
#include "xc2028.h"
#include "tuner-simple.h"
#include "dib7000p.h"
#include "dib0070.h"
#include "dibx000_common.h"
#include "zl10353.h"
#include "stv0900.h"
#include "stv0900_reg.h"
#include "stv6110.h"
#include "lnbh24.h"
#include "cx24116.h"
#include "cx24117.h"
#include "cimax2.h"
#include "lgs8gxx.h"
#include "netup-eeprom.h"
#include "netup-init.h"
#include "lgdt3305.h"
#include "atbm8830.h"
#include "ts2020.h"
#include "ds3000.h"
#include "cx23885-f300.h"
#include "altera-ci.h"
#include "stv0367.h"
#include "drxk.h"
#include "mt2063.h"
#include "stv090x.h"
#include "stb6100.h"
#include "stb6100_cfg.h"
#include "tda10071.h"
#include "a8293.h"
#include "mb86a20s.h"
#include "si2165.h"
#include "si2168.h"
#include "si2157.h"
#include "sp2.h"
#include "m88ds3103.h"
#include "m88rs6000t.h"
#include "lgdt3306a.h"
static unsigned int debug;
#define dprintk(level, fmt, arg...) …
static unsigned int alt_tuner;
module_param(alt_tuner, int, 0644);
MODULE_PARM_DESC(…) …;
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int queue_setup(struct vb2_queue *q,
unsigned int *num_buffers, unsigned int *num_planes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static int buffer_prepare(struct vb2_buffer *vb)
{ … }
static void buffer_finish(struct vb2_buffer *vb)
{ … }
static void buffer_queue(struct vb2_buffer *vb)
{ … }
static void cx23885_dvb_gate_ctrl(struct cx23885_tsport *port, int open)
{ … }
static int cx23885_start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void cx23885_stop_streaming(struct vb2_queue *q)
{ … }
static const struct vb2_ops dvb_qops = …;
static struct s5h1409_config hauppauge_generic_config = …;
static struct tda10048_config hauppauge_hvr1200_config = …;
static struct tda10048_config hauppauge_hvr1210_config = …;
static struct s5h1409_config hauppauge_ezqam_config = …;
static struct s5h1409_config hauppauge_hvr1800lp_config = …;
static struct s5h1409_config hauppauge_hvr1500_config = …;
static struct mt2131_config hauppauge_generic_tunerconfig = …;
static struct lgdt330x_config fusionhdtv_5_express = …;
static struct s5h1409_config hauppauge_hvr1500q_config = …;
static struct s5h1409_config dvico_s5h1409_config = …;
static struct s5h1411_config dvico_s5h1411_config = …;
static struct s5h1411_config hcw_s5h1411_config = …;
static struct xc5000_config hauppauge_hvr1500q_tunerconfig = …;
static struct xc5000_config dvico_xc5000_tunerconfig = …;
static struct tda829x_config tda829x_no_probe = …;
static struct tda18271_std_map hauppauge_tda18271_std_map = …;
static struct tda18271_std_map hauppauge_hvr1200_tda18271_std_map = …;
static struct tda18271_config hauppauge_tda18271_config = …;
static struct tda18271_config hauppauge_hvr1200_tuner_config = …;
static struct tda18271_config hauppauge_hvr1210_tuner_config = …;
static struct tda18271_config hauppauge_hvr4400_tuner_config = …;
static struct tda18271_std_map hauppauge_hvr127x_std_map = …;
static struct tda18271_config hauppauge_hvr127x_config = …;
static struct lgdt3305_config hauppauge_lgdt3305_config = …;
static struct dibx000_agc_config xc3028_agc_config = …;
static struct dibx000_bandwidth_config xc3028_bw_config = …;
static struct dib7000p_config hauppauge_hvr1400_dib7000_config = …;
static struct zl10353_config dvico_fusionhdtv_xc3028 = …;
static struct stv0900_reg stv0900_ts_regs[] = …;
static struct stv0900_config netup_stv0900_config = …;
static struct stv6110_config netup_stv6110_tunerconfig_a = …;
static struct stv6110_config netup_stv6110_tunerconfig_b = …;
static struct cx24116_config tbs_cx24116_config = …;
static struct cx24117_config tbs_cx24117_config = …;
static struct ds3000_config tevii_ds3000_config = …;
static struct ts2020_config tevii_ts2020_config = …;
static struct cx24116_config dvbworld_cx24116_config = …;
static struct lgs8gxx_config mygica_x8506_lgs8gl5_config = …;
static struct xc5000_config mygica_x8506_xc5000_config = …;
static struct mb86a20s_config mygica_x8507_mb86a20s_config = …;
static struct xc5000_config mygica_x8507_xc5000_config = …;
static struct stv090x_config prof_8000_stv090x_config = …;
static struct stb6100_config prof_8000_stb6100_config = …;
static struct lgdt3306a_config hauppauge_quadHD_ATSC_a_config = …;
static struct lgdt3306a_config hauppauge_quadHD_ATSC_b_config = …;
static int p8000_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage)
{ … }
static int dvbsky_t9580_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage)
{ … }
static int dvbsky_s952_portc_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage)
{ … }
static int cx23885_sp2_ci_ctrl(void *priv, u8 read, int addr,
u8 data, int *mem)
{ … }
static int cx23885_dvb_set_frontend(struct dvb_frontend *fe)
{ … }
static void cx23885_set_frontend_hook(struct cx23885_tsport *port,
struct dvb_frontend *fe)
{ … }
static struct lgs8gxx_config magicpro_prohdtve2_lgs8g75_config = …;
static struct xc5000_config magicpro_prohdtve2_xc5000_config = …;
static struct atbm8830_config mygica_x8558pro_atbm8830_cfg1 = …;
static struct max2165_config mygic_x8558pro_max2165_cfg1 = …;
static struct atbm8830_config mygica_x8558pro_atbm8830_cfg2 = …;
static struct max2165_config mygic_x8558pro_max2165_cfg2 = …;
static struct stv0367_config netup_stv0367_config[] = …;
static struct xc5000_config netup_xc5000_config[] = …;
static struct drxk_config terratec_drxk_config[] = …;
static struct mt2063_config terratec_mt2063_config[] = …;
static const struct tda10071_platform_data hauppauge_tda10071_pdata = …;
static const struct m88ds3103_config dvbsky_t9580_m88ds3103_config = …;
static const struct m88ds3103_config dvbsky_s950c_m88ds3103_config = …;
static const struct m88ds3103_config hauppauge_hvr5525_m88ds3103_config = …;
static struct lgdt3306a_config hauppauge_hvr1265k4_config = …;
static int netup_altera_fpga_rw(void *device, int flag, int data, int read)
{
struct cx23885_dev *dev = (struct cx23885_dev *)device;
unsigned long timeout = jiffies + msecs_to_jiffies(1);
uint32_t mem = 0;
mem = cx_read(MC417_RWD);
if (read)
cx_set(MC417_OEN, ALT_DATA);
else {
cx_clear(MC417_OEN, ALT_DATA);
mem &= ~ALT_DATA;
mem |= (data & ALT_DATA);
}
if (flag)
mem |= ALT_AD_RG;
else
mem &= ~ALT_AD_RG;
mem &= ~ALT_CS;
if (read)
mem = (mem & ~ALT_RD) | ALT_WR;
else
mem = (mem & ~ALT_WR) | ALT_RD;
cx_write(MC417_RWD, mem);
for (;;) {
mem = cx_read(MC417_RWD);
if ((mem & ALT_RDY) == 0)
break;
if (time_after(jiffies, timeout))
break;
udelay(1);
}
cx_set(MC417_RWD, ALT_RD | ALT_WR | ALT_CS);
if (read)
return mem & ALT_DATA;
return 0;
};
static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
{ … }
static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff)
{ … }
static struct dib0070_config dib7070p_dib0070_config = …;
static struct dibx000_agc_config dib7070_agc_config = …;
static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = …;
static struct dib7000p_config dib7070p_dib7000p_config = …;
static int dvb_register_ci_mac(struct cx23885_tsport *port)
{ … }
static int dvb_register(struct cx23885_tsport *port)
{ … }
int cx23885_dvb_register(struct cx23885_tsport *port)
{ … }
int cx23885_dvb_unregister(struct cx23885_tsport *port)
{ … }