linux/drivers/media/usb/dvb-usb/cxusb.c

// SPDX-License-Identifier: GPL-2.0-only
/* DVB USB compliant linux driver for Conexant USB reference design.
 *
 * The Conexant reference design I saw on their website was only for analogue
 * capturing (using the cx25842). The box I took to write this driver (reverse
 * engineered) is the one labeled Medion MD95700. In addition to the cx25842
 * for analogue capturing it also has a cx22702 DVB-T demodulator on the main
 * board. Besides it has a atiremote (X10) and a USB2.0 hub onboard.
 *
 * Maybe it is a little bit premature to call this driver cxusb, but I assume
 * the USB protocol is identical or at least inherited from the reference
 * design, so it can be reused for the "analogue-only" device (if it will
 * appear at all).
 *
 *
 * Copyright (C) 2005 Patrick Boettcher ([email protected])
 * Copyright (C) 2006 Michael Krufky ([email protected])
 * Copyright (C) 2006, 2007 Chris Pascoe ([email protected])
 * Copyright (C) 2011, 2017 Maciej S. Szmigiero ([email protected])
 *
 * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
 */
#include <media/tuner.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/vmalloc.h>

#include "cxusb.h"

#include "cx22702.h"
#include "lgdt330x.h"
#include "mt352.h"
#include "mt352_priv.h"
#include "zl10353.h"
#include "xc2028.h"
#include "tuner-simple.h"
#include "mxl5005s.h"
#include "max2165.h"
#include "dib7000p.h"
#include "dib0070.h"
#include "lgs8gxx.h"
#include "atbm8830.h"
#include "si2168.h"
#include "si2157.h"

/* debug */
int dvb_usb_cxusb_debug;
module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
MODULE_PARM_DESC();

DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);

enum cxusb_table_index {};

static struct usb_device_id cxusb_table[];

int cxusb_ctrl_msg(struct dvb_usb_device *d,
		   u8 cmd, const u8 *wbuf, int wlen, u8 *rbuf, int rlen)
{}

/* GPIO */
static void cxusb_gpio_tuner(struct dvb_usb_device *d, int onoff)
{}

static int cxusb_bluebird_gpio_rw(struct dvb_usb_device *d, u8 changemask,
				  u8 newval)
{}

static void cxusb_bluebird_gpio_pulse(struct dvb_usb_device *d, u8 pin, int low)
{}

static void cxusb_nano2_led(struct dvb_usb_device *d, int onoff)
{}

static int cxusb_d680_dmb_gpio_tuner(struct dvb_usb_device *d,
				     u8 addr, int onoff)
{}

/* I2C */
static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
			  int num)
{}

static u32 cxusb_i2c_func(struct i2c_adapter *adapter)
{}

static struct i2c_algorithm cxusb_i2c_algo =;

static int _cxusb_power_ctrl(struct dvb_usb_device *d, int onoff)
{}

static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff)
{}

static int cxusb_aver_power_ctrl(struct dvb_usb_device *d, int onoff)
{}

static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff)
{}

static int cxusb_nano2_power_ctrl(struct dvb_usb_device *d, int onoff)
{}

static int cxusb_d680_dmb_power_ctrl(struct dvb_usb_device *d, int onoff)
{}

static int cxusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
{}

static int cxusb_aver_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
{}

static void cxusb_d680_dmb_drain_message(struct dvb_usb_device *d)
{}

static void cxusb_d680_dmb_drain_video(struct dvb_usb_device *d)
{}

static int cxusb_d680_dmb_streaming_ctrl(struct dvb_usb_adapter *adap,
					 int onoff)
{}

static int cxusb_rc_query(struct dvb_usb_device *d)
{}

static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d)
{}

static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d)
{}

static int cxusb_dee1601_demod_init(struct dvb_frontend *fe)
{}

static int cxusb_mt352_demod_init(struct dvb_frontend *fe)
{}

static struct cx22702_config cxusb_cx22702_config =;

static struct lgdt330x_config cxusb_lgdt3303_config =;

static struct lgdt330x_config cxusb_aver_lgdt3303_config =;

static struct mt352_config cxusb_dee1601_config =;

static struct zl10353_config cxusb_zl10353_dee1601_config =;

static struct mt352_config cxusb_mt352_config =;

static struct zl10353_config cxusb_zl10353_xc3028_config =;

static struct zl10353_config cxusb_zl10353_xc3028_config_no_i2c_gate =;

static struct mt352_config cxusb_mt352_xc3028_config =;

/* FIXME: needs tweaking */
static struct mxl5005s_config aver_a868r_tuner =;

/* FIXME: needs tweaking */
static struct mxl5005s_config d680_dmb_tuner =;

static struct max2165_config mygica_d689_max2165_cfg =;

/* Callbacks for DVB USB */
static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int dvico_bluebird_xc2028_callback(void *ptr, int component,
					  int command, int arg)
{}

static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_d680_dmb_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_mygica_d689_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_medion_fe_ts_bus_ctrl(struct dvb_frontend *fe, int acquire)
{}

static int cxusb_medion_set_mode(struct dvb_usb_device *dvbdev, bool digital)
{}

static int cxusb_cx22702_frontend_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_aver_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_mt352_frontend_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_dee1601_frontend_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap)
{}

static struct dibx000_agc_config dib7070_agc_config =;

static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz =;

static struct dib7000p_config cxusb_dualdig4_rev2_config =;

struct dib0700_adapter_state {};

static int cxusb_dualdig4_rev2_frontend_attach(struct dvb_usb_adapter *adap)
{}

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 int dib7070_set_param_override(struct dvb_frontend *fe)
{}

static int cxusb_dualdig4_rev2_tuner_attach(struct dvb_usb_adapter *adap)
{}

static int cxusb_nano2_frontend_attach(struct dvb_usb_adapter *adap)
{}

static struct lgs8gxx_config d680_lgs8gl5_cfg =;

static int cxusb_d680_dmb_frontend_attach(struct dvb_usb_adapter *adap)
{}

static struct atbm8830_config mygica_d689_atbm8830_cfg =;

static int cxusb_mygica_d689_frontend_attach(struct dvb_usb_adapter *adap)
{}

/*
 * DViCO has shipped two devices with the same USB ID, but only one of them
 * needs a firmware download.  Check the device class details to see if they
 * have non-default values to decide whether the device is actually cold or
 * not, and forget a match if it turns out we selected the wrong device.
 */
static int bluebird_fx2_identify_state(struct usb_device *udev,
				       const struct dvb_usb_device_properties *props,
				       const struct dvb_usb_device_description **desc,
				       int *cold)
{}

/*
 * DViCO bluebird firmware needs the "warm" product ID to be patched into the
 * firmware file before download.
 */

static const int dvico_firmware_id_offsets[] =;
static int bluebird_patch_dvico_firmware_download(struct usb_device *udev,
						  const struct firmware *fw)
{}

int cxusb_medion_get(struct dvb_usb_device *dvbdev,
		     enum cxusb_open_type open_type)
{}

void cxusb_medion_put(struct dvb_usb_device *dvbdev)
{}

/* DVB USB Driver stuff */
static struct dvb_usb_device_properties cxusb_medion_properties;
static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties;
static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties;
static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties;
static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties;
static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties;
static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties;
static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties;
static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_properties;
static struct dvb_usb_device_properties cxusb_aver_a868r_properties;
static struct dvb_usb_device_properties cxusb_d680_dmb_properties;
static struct dvb_usb_device_properties cxusb_mygica_d689_properties;

static int cxusb_medion_priv_init(struct dvb_usb_device *dvbdev)
{}

static void cxusb_medion_priv_destroy(struct dvb_usb_device *dvbdev)
{}

static bool cxusb_medion_check_altsetting(struct usb_host_interface *as)
{}

static bool cxusb_medion_check_intf(struct usb_interface *intf)
{}

static int cxusb_probe(struct usb_interface *intf,
		       const struct usb_device_id *id)
{}

static void cxusb_disconnect(struct usb_interface *intf)
{}

static struct usb_device_id cxusb_table[] =;

MODULE_DEVICE_TABLE(usb, cxusb_table);

static struct dvb_usb_device_properties cxusb_medion_properties =;

static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties =;

static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties =;

static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties =;

static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties =;

static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties =;

static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties =;

static struct dvb_usb_device_properties
cxusb_bluebird_nano2_needsfirmware_properties =;

static struct dvb_usb_device_properties cxusb_aver_a868r_properties =;

static
struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties =;

static struct dvb_usb_device_properties cxusb_d680_dmb_properties =;

static struct dvb_usb_device_properties cxusb_mygica_d689_properties =;

static struct usb_driver cxusb_driver =;

module_usb_driver();

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