18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/* DVB USB compliant linux driver for mobile DVB-T USB devices based on
38c2ecf20Sopenharmony_ci * reference designs made by DiBcom (http://www.dibcom.fr/) (DiB3000M-B)
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@posteo.de)
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * based on GPL code from DiBcom, which has
88c2ecf20Sopenharmony_ci * Copyright (C) 2004 Amaury Demol for DiBcom
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci#include "dibusb.h"
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciDVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cistatic int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
178c2ecf20Sopenharmony_ci{
188c2ecf20Sopenharmony_ci	struct dvb_usb_adapter *adap = fe->dvb->priv;
198c2ecf20Sopenharmony_ci	struct dibusb_state *st = adap->priv;
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci	return st->ops.tuner_pass_ctrl(fe, enable, st->tuner_addr);
228c2ecf20Sopenharmony_ci}
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cistatic int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
258c2ecf20Sopenharmony_ci{
268c2ecf20Sopenharmony_ci	struct dib3000_config demod_cfg;
278c2ecf20Sopenharmony_ci	struct dibusb_state *st = adap->priv;
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	demod_cfg.demod_address = 0x8;
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci	adap->fe_adap[0].fe = dvb_attach(dib3000mb_attach, &demod_cfg,
328c2ecf20Sopenharmony_ci					 &adap->dev->i2c_adap, &st->ops);
338c2ecf20Sopenharmony_ci	if ((adap->fe_adap[0].fe) == NULL)
348c2ecf20Sopenharmony_ci		return -ENODEV;
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci	adap->fe_adap[0].fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci	return 0;
398c2ecf20Sopenharmony_ci}
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cistatic int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
428c2ecf20Sopenharmony_ci{
438c2ecf20Sopenharmony_ci	struct dibusb_state *st = adap->priv;
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci	st->tuner_addr = 0x61;
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci	dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x61, &adap->dev->i2c_adap,
488c2ecf20Sopenharmony_ci		   DVB_PLL_TUA6010XS);
498c2ecf20Sopenharmony_ci	return 0;
508c2ecf20Sopenharmony_ci}
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_cistatic int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
538c2ecf20Sopenharmony_ci{
548c2ecf20Sopenharmony_ci	struct dibusb_state *st = adap->priv;
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci	st->tuner_addr = 0x60;
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci	dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap,
598c2ecf20Sopenharmony_ci		   DVB_PLL_TDA665X);
608c2ecf20Sopenharmony_ci	return 0;
618c2ecf20Sopenharmony_ci}
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci/* Some of the Artec 1.1 device aren't equipped with the default tuner
648c2ecf20Sopenharmony_ci * (Thomson Cable), but with a Panasonic ENV77H11D5.  This function figures
658c2ecf20Sopenharmony_ci * this out. */
668c2ecf20Sopenharmony_cistatic int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap)
678c2ecf20Sopenharmony_ci{
688c2ecf20Sopenharmony_ci	u8 b[2] = { 0,0 }, b2[1];
698c2ecf20Sopenharmony_ci	int ret = 0;
708c2ecf20Sopenharmony_ci	struct i2c_msg msg[2] = {
718c2ecf20Sopenharmony_ci		{ .flags = 0,        .buf = b,  .len = 2 },
728c2ecf20Sopenharmony_ci		{ .flags = I2C_M_RD, .buf = b2, .len = 1 },
738c2ecf20Sopenharmony_ci	};
748c2ecf20Sopenharmony_ci	struct dibusb_state *st = adap->priv;
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	/* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
778c2ecf20Sopenharmony_ci	msg[0].addr = msg[1].addr = st->tuner_addr = 0x60;
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci	if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
808c2ecf20Sopenharmony_ci		adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 1);
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci	if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
838c2ecf20Sopenharmony_ci		err("tuner i2c write failed.");
848c2ecf20Sopenharmony_ci		return -EREMOTEIO;
858c2ecf20Sopenharmony_ci	}
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci	if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
888c2ecf20Sopenharmony_ci		adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 0);
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci	if (b2[0] == 0xfe) {
918c2ecf20Sopenharmony_ci		info("This device has the Thomson Cable onboard. Which is default.");
928c2ecf20Sopenharmony_ci		ret = dibusb_thomson_tuner_attach(adap);
938c2ecf20Sopenharmony_ci	} else {
948c2ecf20Sopenharmony_ci		info("This device has the Panasonic ENV77H11D5 onboard.");
958c2ecf20Sopenharmony_ci		ret = dibusb_panasonic_tuner_attach(adap);
968c2ecf20Sopenharmony_ci	}
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci	return ret;
998c2ecf20Sopenharmony_ci}
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci/* USB Driver stuff */
1028c2ecf20Sopenharmony_cistatic struct dvb_usb_device_properties dibusb1_1_properties;
1038c2ecf20Sopenharmony_cistatic struct dvb_usb_device_properties dibusb1_1_an2235_properties;
1048c2ecf20Sopenharmony_cistatic struct dvb_usb_device_properties dibusb2_0b_properties;
1058c2ecf20Sopenharmony_cistatic struct dvb_usb_device_properties artec_t1_usb2_properties;
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_cistatic int dibusb_probe(struct usb_interface *intf,
1088c2ecf20Sopenharmony_ci		const struct usb_device_id *id)
1098c2ecf20Sopenharmony_ci{
1108c2ecf20Sopenharmony_ci	if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties,
1118c2ecf20Sopenharmony_ci				     THIS_MODULE, NULL, adapter_nr) ||
1128c2ecf20Sopenharmony_ci	    0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties,
1138c2ecf20Sopenharmony_ci				     THIS_MODULE, NULL, adapter_nr) ||
1148c2ecf20Sopenharmony_ci	    0 == dvb_usb_device_init(intf, &dibusb2_0b_properties,
1158c2ecf20Sopenharmony_ci				     THIS_MODULE, NULL, adapter_nr) ||
1168c2ecf20Sopenharmony_ci	    0 == dvb_usb_device_init(intf, &artec_t1_usb2_properties,
1178c2ecf20Sopenharmony_ci				     THIS_MODULE, NULL, adapter_nr))
1188c2ecf20Sopenharmony_ci		return 0;
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci	return -EINVAL;
1218c2ecf20Sopenharmony_ci}
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci/* do not change the order of the ID table */
1248c2ecf20Sopenharmony_cistatic struct usb_device_id dibusb_dib3000mb_table [] = {
1258c2ecf20Sopenharmony_ci/* 00 */	{ USB_DEVICE(USB_VID_WIDEVIEW,		USB_PID_AVERMEDIA_DVBT_USB_COLD) },
1268c2ecf20Sopenharmony_ci/* 01 */	{ USB_DEVICE(USB_VID_WIDEVIEW,		USB_PID_AVERMEDIA_DVBT_USB_WARM) },
1278c2ecf20Sopenharmony_ci/* 02 */	{ USB_DEVICE(USB_VID_COMPRO,		USB_PID_COMPRO_DVBU2000_COLD) },
1288c2ecf20Sopenharmony_ci/* 03 */	{ USB_DEVICE(USB_VID_COMPRO,		USB_PID_COMPRO_DVBU2000_WARM) },
1298c2ecf20Sopenharmony_ci/* 04 */	{ USB_DEVICE(USB_VID_COMPRO_UNK,	USB_PID_COMPRO_DVBU2000_UNK_COLD) },
1308c2ecf20Sopenharmony_ci/* 05 */	{ USB_DEVICE(USB_VID_DIBCOM,		USB_PID_DIBCOM_MOD3000_COLD) },
1318c2ecf20Sopenharmony_ci/* 06 */	{ USB_DEVICE(USB_VID_DIBCOM,		USB_PID_DIBCOM_MOD3000_WARM) },
1328c2ecf20Sopenharmony_ci/* 07 */	{ USB_DEVICE(USB_VID_EMPIA,		USB_PID_KWORLD_VSTREAM_COLD) },
1338c2ecf20Sopenharmony_ci/* 08 */	{ USB_DEVICE(USB_VID_EMPIA,		USB_PID_KWORLD_VSTREAM_WARM) },
1348c2ecf20Sopenharmony_ci/* 09 */	{ USB_DEVICE(USB_VID_GRANDTEC,		USB_PID_GRANDTEC_DVBT_USB_COLD) },
1358c2ecf20Sopenharmony_ci/* 10 */	{ USB_DEVICE(USB_VID_GRANDTEC,		USB_PID_GRANDTEC_DVBT_USB_WARM) },
1368c2ecf20Sopenharmony_ci/* 11 */	{ USB_DEVICE(USB_VID_GRANDTEC,		USB_PID_DIBCOM_MOD3000_COLD) },
1378c2ecf20Sopenharmony_ci/* 12 */	{ USB_DEVICE(USB_VID_GRANDTEC,		USB_PID_DIBCOM_MOD3000_WARM) },
1388c2ecf20Sopenharmony_ci/* 13 */	{ USB_DEVICE(USB_VID_HYPER_PALTEK,	USB_PID_UNK_HYPER_PALTEK_COLD) },
1398c2ecf20Sopenharmony_ci/* 14 */	{ USB_DEVICE(USB_VID_HYPER_PALTEK,	USB_PID_UNK_HYPER_PALTEK_WARM) },
1408c2ecf20Sopenharmony_ci/* 15 */	{ USB_DEVICE(USB_VID_VISIONPLUS,	USB_PID_TWINHAN_VP7041_COLD) },
1418c2ecf20Sopenharmony_ci/* 16 */	{ USB_DEVICE(USB_VID_VISIONPLUS,	USB_PID_TWINHAN_VP7041_WARM) },
1428c2ecf20Sopenharmony_ci/* 17 */	{ USB_DEVICE(USB_VID_TWINHAN,		USB_PID_TWINHAN_VP7041_COLD) },
1438c2ecf20Sopenharmony_ci/* 18 */	{ USB_DEVICE(USB_VID_TWINHAN,		USB_PID_TWINHAN_VP7041_WARM) },
1448c2ecf20Sopenharmony_ci/* 19 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_COLD) },
1458c2ecf20Sopenharmony_ci/* 20 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_WARM) },
1468c2ecf20Sopenharmony_ci/* 21 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_AN2235_COLD) },
1478c2ecf20Sopenharmony_ci/* 22 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_AN2235_WARM) },
1488c2ecf20Sopenharmony_ci/* 23 */	{ USB_DEVICE(USB_VID_ADSTECH,		USB_PID_ADSTECH_USB2_COLD) },
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci/* device ID with default DIBUSB2_0-firmware and with the hacked firmware */
1518c2ecf20Sopenharmony_ci/* 24 */	{ USB_DEVICE(USB_VID_ADSTECH,		USB_PID_ADSTECH_USB2_WARM) },
1528c2ecf20Sopenharmony_ci/* 25 */	{ USB_DEVICE(USB_VID_KYE,		USB_PID_KYE_DVB_T_COLD) },
1538c2ecf20Sopenharmony_ci/* 26 */	{ USB_DEVICE(USB_VID_KYE,		USB_PID_KYE_DVB_T_WARM) },
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci/* 27 */	{ USB_DEVICE(USB_VID_KWORLD,		USB_PID_KWORLD_VSTREAM_COLD) },
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/* 28 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_USB2_COLD) },
1588c2ecf20Sopenharmony_ci/* 29 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_USB2_WARM) },
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci/*
1618c2ecf20Sopenharmony_ci * XXX: As Artec just 'forgot' to program the EEPROM on some Artec T1 devices
1628c2ecf20Sopenharmony_ci *      we don't catch these faulty IDs (namely 'Cypress FX1 USB controller') that
1638c2ecf20Sopenharmony_ci *      have been left on the device. If you don't have such a device but an Artec
1648c2ecf20Sopenharmony_ci *      device that's supposed to work with this driver but is not detected by it,
1658c2ecf20Sopenharmony_ci *      free to enable CONFIG_DVB_USB_DIBUSB_MB_FAULTY via your kernel config.
1668c2ecf20Sopenharmony_ci */
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
1698c2ecf20Sopenharmony_ci/* 30 */	{ USB_DEVICE(USB_VID_ANCHOR,		USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) },
1708c2ecf20Sopenharmony_ci#endif
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci			{ }		/* Terminating entry */
1738c2ecf20Sopenharmony_ci};
1748c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table);
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_cistatic struct dvb_usb_device_properties dibusb1_1_properties = {
1778c2ecf20Sopenharmony_ci	.caps =  DVB_USB_IS_AN_I2C_ADAPTER,
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci	.usb_ctrl = CYPRESS_AN2135,
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci	.firmware = "dvb-usb-dibusb-5.0.0.11.fw",
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci	.num_adapters = 1,
1848c2ecf20Sopenharmony_ci	.adapter = {
1858c2ecf20Sopenharmony_ci		{
1868c2ecf20Sopenharmony_ci		.num_frontends = 1,
1878c2ecf20Sopenharmony_ci		.fe = {{
1888c2ecf20Sopenharmony_ci			.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
1898c2ecf20Sopenharmony_ci			.pid_filter_count = 16,
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci			.streaming_ctrl   = dibusb_streaming_ctrl,
1928c2ecf20Sopenharmony_ci			.pid_filter       = dibusb_pid_filter,
1938c2ecf20Sopenharmony_ci			.pid_filter_ctrl  = dibusb_pid_filter_ctrl,
1948c2ecf20Sopenharmony_ci			.frontend_attach  = dibusb_dib3000mb_frontend_attach,
1958c2ecf20Sopenharmony_ci			.tuner_attach     = dibusb_tuner_probe_and_attach,
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci			/* parameter for the MPEG2-data transfer */
1988c2ecf20Sopenharmony_ci			.stream = {
1998c2ecf20Sopenharmony_ci				.type = USB_BULK,
2008c2ecf20Sopenharmony_ci				.count = 7,
2018c2ecf20Sopenharmony_ci				.endpoint = 0x02,
2028c2ecf20Sopenharmony_ci				.u = {
2038c2ecf20Sopenharmony_ci					.bulk = {
2048c2ecf20Sopenharmony_ci						.buffersize = 4096,
2058c2ecf20Sopenharmony_ci					}
2068c2ecf20Sopenharmony_ci				}
2078c2ecf20Sopenharmony_ci			},
2088c2ecf20Sopenharmony_ci		}},
2098c2ecf20Sopenharmony_ci			.size_of_priv     = sizeof(struct dibusb_state),
2108c2ecf20Sopenharmony_ci		}
2118c2ecf20Sopenharmony_ci	},
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci	.power_ctrl       = dibusb_power_ctrl,
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci	.rc.legacy = {
2168c2ecf20Sopenharmony_ci		.rc_interval      = DEFAULT_RC_INTERVAL,
2178c2ecf20Sopenharmony_ci		.rc_map_table     = rc_map_dibusb_table,
2188c2ecf20Sopenharmony_ci		.rc_map_size      = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
2198c2ecf20Sopenharmony_ci		.rc_query         = dibusb_rc_query,
2208c2ecf20Sopenharmony_ci	},
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci	.i2c_algo         = &dibusb_i2c_algo,
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci	.generic_bulk_ctrl_endpoint = 0x01,
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci	.num_device_descs = 9,
2278c2ecf20Sopenharmony_ci	.devices = {
2288c2ecf20Sopenharmony_ci		{	"AVerMedia AverTV DVBT USB1.1",
2298c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[0],  NULL },
2308c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[1],  NULL },
2318c2ecf20Sopenharmony_ci		},
2328c2ecf20Sopenharmony_ci		{	"Compro Videomate DVB-U2000 - DVB-T USB1.1 (please confirm to linux-dvb)",
2338c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[2], &dibusb_dib3000mb_table[4], NULL},
2348c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[3], NULL },
2358c2ecf20Sopenharmony_ci		},
2368c2ecf20Sopenharmony_ci		{	"DiBcom USB1.1 DVB-T reference design (MOD3000)",
2378c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[5],  NULL },
2388c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[6],  NULL },
2398c2ecf20Sopenharmony_ci		},
2408c2ecf20Sopenharmony_ci		{	"KWorld V-Stream XPERT DTV - DVB-T USB1.1",
2418c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[7], NULL },
2428c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[8], NULL },
2438c2ecf20Sopenharmony_ci		},
2448c2ecf20Sopenharmony_ci		{	"Grandtec USB1.1 DVB-T",
2458c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[9],  &dibusb_dib3000mb_table[11], NULL },
2468c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[10], &dibusb_dib3000mb_table[12], NULL },
2478c2ecf20Sopenharmony_ci		},
2488c2ecf20Sopenharmony_ci		{	"Unknown USB1.1 DVB-T device ???? please report the name to the author",
2498c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[13], NULL },
2508c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[14], NULL },
2518c2ecf20Sopenharmony_ci		},
2528c2ecf20Sopenharmony_ci		{	"TwinhanDTV USB-Ter USB1.1 / Magic Box I / HAMA USB1.1 DVB-T device",
2538c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[15], &dibusb_dib3000mb_table[17], NULL},
2548c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[16], &dibusb_dib3000mb_table[18], NULL},
2558c2ecf20Sopenharmony_ci		},
2568c2ecf20Sopenharmony_ci		{	"Artec T1 USB1.1 TVBOX with AN2135",
2578c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[19], NULL },
2588c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[20], NULL },
2598c2ecf20Sopenharmony_ci		},
2608c2ecf20Sopenharmony_ci		{	"VideoWalker DVB-T USB",
2618c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[25], NULL },
2628c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[26], NULL },
2638c2ecf20Sopenharmony_ci		},
2648c2ecf20Sopenharmony_ci	}
2658c2ecf20Sopenharmony_ci};
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_cistatic struct dvb_usb_device_properties dibusb1_1_an2235_properties = {
2688c2ecf20Sopenharmony_ci	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
2698c2ecf20Sopenharmony_ci	.usb_ctrl = CYPRESS_AN2235,
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci	.firmware = "dvb-usb-dibusb-an2235-01.fw",
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci	.num_adapters = 1,
2748c2ecf20Sopenharmony_ci	.adapter = {
2758c2ecf20Sopenharmony_ci		{
2768c2ecf20Sopenharmony_ci		.num_frontends = 1,
2778c2ecf20Sopenharmony_ci		.fe = {{
2788c2ecf20Sopenharmony_ci			.caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER,
2798c2ecf20Sopenharmony_ci			.pid_filter_count = 16,
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci			.streaming_ctrl   = dibusb_streaming_ctrl,
2828c2ecf20Sopenharmony_ci			.pid_filter       = dibusb_pid_filter,
2838c2ecf20Sopenharmony_ci			.pid_filter_ctrl  = dibusb_pid_filter_ctrl,
2848c2ecf20Sopenharmony_ci			.frontend_attach  = dibusb_dib3000mb_frontend_attach,
2858c2ecf20Sopenharmony_ci			.tuner_attach     = dibusb_tuner_probe_and_attach,
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ci			/* parameter for the MPEG2-data transfer */
2888c2ecf20Sopenharmony_ci			.stream = {
2898c2ecf20Sopenharmony_ci				.type = USB_BULK,
2908c2ecf20Sopenharmony_ci				.count = 7,
2918c2ecf20Sopenharmony_ci				.endpoint = 0x02,
2928c2ecf20Sopenharmony_ci				.u = {
2938c2ecf20Sopenharmony_ci					.bulk = {
2948c2ecf20Sopenharmony_ci						.buffersize = 4096,
2958c2ecf20Sopenharmony_ci					}
2968c2ecf20Sopenharmony_ci				}
2978c2ecf20Sopenharmony_ci			},
2988c2ecf20Sopenharmony_ci		}},
2998c2ecf20Sopenharmony_ci			.size_of_priv     = sizeof(struct dibusb_state),
3008c2ecf20Sopenharmony_ci		},
3018c2ecf20Sopenharmony_ci	},
3028c2ecf20Sopenharmony_ci	.power_ctrl       = dibusb_power_ctrl,
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci	.rc.legacy = {
3058c2ecf20Sopenharmony_ci		.rc_interval      = DEFAULT_RC_INTERVAL,
3068c2ecf20Sopenharmony_ci		.rc_map_table     = rc_map_dibusb_table,
3078c2ecf20Sopenharmony_ci		.rc_map_size      = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
3088c2ecf20Sopenharmony_ci		.rc_query         = dibusb_rc_query,
3098c2ecf20Sopenharmony_ci	},
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ci	.i2c_algo         = &dibusb_i2c_algo,
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ci	.generic_bulk_ctrl_endpoint = 0x01,
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
3168c2ecf20Sopenharmony_ci	.num_device_descs = 2,
3178c2ecf20Sopenharmony_ci#else
3188c2ecf20Sopenharmony_ci	.num_device_descs = 1,
3198c2ecf20Sopenharmony_ci#endif
3208c2ecf20Sopenharmony_ci	.devices = {
3218c2ecf20Sopenharmony_ci		{	"Artec T1 USB1.1 TVBOX with AN2235",
3228c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[21], NULL },
3238c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[22], NULL },
3248c2ecf20Sopenharmony_ci		},
3258c2ecf20Sopenharmony_ci#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
3268c2ecf20Sopenharmony_ci		{	"Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)",
3278c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[30], NULL },
3288c2ecf20Sopenharmony_ci			{ NULL },
3298c2ecf20Sopenharmony_ci		},
3308c2ecf20Sopenharmony_ci		{ NULL },
3318c2ecf20Sopenharmony_ci#endif
3328c2ecf20Sopenharmony_ci	}
3338c2ecf20Sopenharmony_ci};
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_cistatic struct dvb_usb_device_properties dibusb2_0b_properties = {
3368c2ecf20Sopenharmony_ci	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci	.usb_ctrl = CYPRESS_FX2,
3398c2ecf20Sopenharmony_ci
3408c2ecf20Sopenharmony_ci	.firmware = "dvb-usb-adstech-usb2-02.fw",
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ci	.num_adapters = 1,
3438c2ecf20Sopenharmony_ci	.adapter = {
3448c2ecf20Sopenharmony_ci		{
3458c2ecf20Sopenharmony_ci		.num_frontends = 1,
3468c2ecf20Sopenharmony_ci		.fe = {{
3478c2ecf20Sopenharmony_ci			.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
3488c2ecf20Sopenharmony_ci			.pid_filter_count = 16,
3498c2ecf20Sopenharmony_ci
3508c2ecf20Sopenharmony_ci			.streaming_ctrl   = dibusb2_0_streaming_ctrl,
3518c2ecf20Sopenharmony_ci			.pid_filter       = dibusb_pid_filter,
3528c2ecf20Sopenharmony_ci			.pid_filter_ctrl  = dibusb_pid_filter_ctrl,
3538c2ecf20Sopenharmony_ci			.frontend_attach  = dibusb_dib3000mb_frontend_attach,
3548c2ecf20Sopenharmony_ci			.tuner_attach     = dibusb_thomson_tuner_attach,
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci			/* parameter for the MPEG2-data transfer */
3578c2ecf20Sopenharmony_ci			.stream = {
3588c2ecf20Sopenharmony_ci				.type = USB_BULK,
3598c2ecf20Sopenharmony_ci				.count = 7,
3608c2ecf20Sopenharmony_ci				.endpoint = 0x06,
3618c2ecf20Sopenharmony_ci				.u = {
3628c2ecf20Sopenharmony_ci					.bulk = {
3638c2ecf20Sopenharmony_ci						.buffersize = 4096,
3648c2ecf20Sopenharmony_ci					}
3658c2ecf20Sopenharmony_ci				}
3668c2ecf20Sopenharmony_ci			},
3678c2ecf20Sopenharmony_ci		}},
3688c2ecf20Sopenharmony_ci			.size_of_priv     = sizeof(struct dibusb_state),
3698c2ecf20Sopenharmony_ci		}
3708c2ecf20Sopenharmony_ci	},
3718c2ecf20Sopenharmony_ci	.power_ctrl       = dibusb2_0_power_ctrl,
3728c2ecf20Sopenharmony_ci
3738c2ecf20Sopenharmony_ci	.rc.legacy = {
3748c2ecf20Sopenharmony_ci		.rc_interval      = DEFAULT_RC_INTERVAL,
3758c2ecf20Sopenharmony_ci		.rc_map_table     = rc_map_dibusb_table,
3768c2ecf20Sopenharmony_ci		.rc_map_size      = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
3778c2ecf20Sopenharmony_ci		.rc_query         = dibusb_rc_query,
3788c2ecf20Sopenharmony_ci	},
3798c2ecf20Sopenharmony_ci
3808c2ecf20Sopenharmony_ci	.i2c_algo         = &dibusb_i2c_algo,
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci	.generic_bulk_ctrl_endpoint = 0x01,
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_ci	.num_device_descs = 2,
3858c2ecf20Sopenharmony_ci	.devices = {
3868c2ecf20Sopenharmony_ci		{	"KWorld/ADSTech Instant DVB-T USB2.0",
3878c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[23], NULL },
3888c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[24], NULL },
3898c2ecf20Sopenharmony_ci		},
3908c2ecf20Sopenharmony_ci		{	"KWorld Xpert DVB-T USB2.0",
3918c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[27], NULL },
3928c2ecf20Sopenharmony_ci			{ NULL }
3938c2ecf20Sopenharmony_ci		},
3948c2ecf20Sopenharmony_ci		{ NULL },
3958c2ecf20Sopenharmony_ci	}
3968c2ecf20Sopenharmony_ci};
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_cistatic struct dvb_usb_device_properties artec_t1_usb2_properties = {
3998c2ecf20Sopenharmony_ci	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
4008c2ecf20Sopenharmony_ci
4018c2ecf20Sopenharmony_ci	.usb_ctrl = CYPRESS_FX2,
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci	.firmware = "dvb-usb-dibusb-6.0.0.8.fw",
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_ci	.num_adapters = 1,
4068c2ecf20Sopenharmony_ci	.adapter = {
4078c2ecf20Sopenharmony_ci		{
4088c2ecf20Sopenharmony_ci		.num_frontends = 1,
4098c2ecf20Sopenharmony_ci		.fe = {{
4108c2ecf20Sopenharmony_ci			.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
4118c2ecf20Sopenharmony_ci			.pid_filter_count = 16,
4128c2ecf20Sopenharmony_ci
4138c2ecf20Sopenharmony_ci			.streaming_ctrl   = dibusb2_0_streaming_ctrl,
4148c2ecf20Sopenharmony_ci			.pid_filter       = dibusb_pid_filter,
4158c2ecf20Sopenharmony_ci			.pid_filter_ctrl  = dibusb_pid_filter_ctrl,
4168c2ecf20Sopenharmony_ci			.frontend_attach  = dibusb_dib3000mb_frontend_attach,
4178c2ecf20Sopenharmony_ci			.tuner_attach     = dibusb_tuner_probe_and_attach,
4188c2ecf20Sopenharmony_ci			/* parameter for the MPEG2-data transfer */
4198c2ecf20Sopenharmony_ci			.stream = {
4208c2ecf20Sopenharmony_ci				.type = USB_BULK,
4218c2ecf20Sopenharmony_ci				.count = 7,
4228c2ecf20Sopenharmony_ci				.endpoint = 0x06,
4238c2ecf20Sopenharmony_ci				.u = {
4248c2ecf20Sopenharmony_ci					.bulk = {
4258c2ecf20Sopenharmony_ci						.buffersize = 4096,
4268c2ecf20Sopenharmony_ci					}
4278c2ecf20Sopenharmony_ci				}
4288c2ecf20Sopenharmony_ci			},
4298c2ecf20Sopenharmony_ci		}},
4308c2ecf20Sopenharmony_ci			.size_of_priv     = sizeof(struct dibusb_state),
4318c2ecf20Sopenharmony_ci		}
4328c2ecf20Sopenharmony_ci	},
4338c2ecf20Sopenharmony_ci	.power_ctrl       = dibusb2_0_power_ctrl,
4348c2ecf20Sopenharmony_ci
4358c2ecf20Sopenharmony_ci	.rc.legacy = {
4368c2ecf20Sopenharmony_ci		.rc_interval      = DEFAULT_RC_INTERVAL,
4378c2ecf20Sopenharmony_ci		.rc_map_table     = rc_map_dibusb_table,
4388c2ecf20Sopenharmony_ci		.rc_map_size      = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
4398c2ecf20Sopenharmony_ci		.rc_query         = dibusb_rc_query,
4408c2ecf20Sopenharmony_ci	},
4418c2ecf20Sopenharmony_ci
4428c2ecf20Sopenharmony_ci	.i2c_algo         = &dibusb_i2c_algo,
4438c2ecf20Sopenharmony_ci
4448c2ecf20Sopenharmony_ci	.generic_bulk_ctrl_endpoint = 0x01,
4458c2ecf20Sopenharmony_ci
4468c2ecf20Sopenharmony_ci	.num_device_descs = 1,
4478c2ecf20Sopenharmony_ci	.devices = {
4488c2ecf20Sopenharmony_ci		{	"Artec T1 USB2.0",
4498c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[28], NULL },
4508c2ecf20Sopenharmony_ci			{ &dibusb_dib3000mb_table[29], NULL },
4518c2ecf20Sopenharmony_ci		},
4528c2ecf20Sopenharmony_ci		{ NULL },
4538c2ecf20Sopenharmony_ci	}
4548c2ecf20Sopenharmony_ci};
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_cistatic struct usb_driver dibusb_driver = {
4578c2ecf20Sopenharmony_ci	.name		= "dvb_usb_dibusb_mb",
4588c2ecf20Sopenharmony_ci	.probe		= dibusb_probe,
4598c2ecf20Sopenharmony_ci	.disconnect = dvb_usb_device_exit,
4608c2ecf20Sopenharmony_ci	.id_table	= dibusb_dib3000mb_table,
4618c2ecf20Sopenharmony_ci};
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_cimodule_usb_driver(dibusb_driver);
4648c2ecf20Sopenharmony_ci
4658c2ecf20Sopenharmony_ciMODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@posteo.de>");
4668c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)");
4678c2ecf20Sopenharmony_ciMODULE_VERSION("1.0");
4688c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL");
469