| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 1 | /* DVB USB compliant linux driver for mobile DVB-T USB devices based on | 
|  | 2 | * reference designs made by DiBcom (http://www.dibcom.fr/) (DiB3000M-B) | 
|  | 3 | * | 
|  | 4 | * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) | 
|  | 5 | * | 
|  | 6 | * based on GPL code from DiBcom, which has | 
|  | 7 | * Copyright (C) 2004 Amaury Demol for DiBcom (ademol@dibcom.fr) | 
|  | 8 | * | 
|  | 9 | *	This program is free software; you can redistribute it and/or modify it | 
|  | 10 | *	under the terms of the GNU General Public License as published by the Free | 
|  | 11 | *	Software Foundation, version 2. | 
|  | 12 | * | 
|  | 13 | * see Documentation/dvb/README.dvb-usb for more information | 
|  | 14 | */ | 
|  | 15 | #include "dibusb.h" | 
|  | 16 |  | 
| Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 17 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 
|  | 18 |  | 
| Michael Krufky | 6c08d929 | 2007-06-12 12:43:25 -0300 | [diff] [blame] | 19 | static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) | 
|  | 20 | { | 
|  | 21 | struct dvb_usb_adapter *adap = fe->dvb->priv; | 
|  | 22 | struct dibusb_state *st = adap->priv; | 
|  | 23 |  | 
|  | 24 | return st->ops.tuner_pass_ctrl(fe, enable, st->tuner_addr); | 
|  | 25 | } | 
|  | 26 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 27 | static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 28 | { | 
|  | 29 | struct dib3000_config demod_cfg; | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 30 | struct dibusb_state *st = adap->priv; | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 31 |  | 
|  | 32 | demod_cfg.demod_address = 0x8; | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 33 |  | 
| Michael Krufky | 79d3a8b | 2007-05-09 14:52:52 -0300 | [diff] [blame] | 34 | if ((adap->fe = dvb_attach(dib3000mb_attach, &demod_cfg, | 
|  | 35 | &adap->dev->i2c_adap, &st->ops)) == NULL) | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 36 | return -ENODEV; | 
| Adrian Bunk | 56760f0 | 2006-08-15 11:38:40 -0300 | [diff] [blame] | 37 |  | 
| Michael Krufky | 6c08d929 | 2007-06-12 12:43:25 -0300 | [diff] [blame] | 38 | adap->fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl; | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 39 |  | 
|  | 40 | return 0; | 
|  | 41 | } | 
|  | 42 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 43 | static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) | 
| Patrick Boettcher | 8945c8c | 2005-07-07 17:58:07 -0700 | [diff] [blame] | 44 | { | 
| Michael Krufky | 6c08d929 | 2007-06-12 12:43:25 -0300 | [diff] [blame] | 45 | struct dibusb_state *st = adap->priv; | 
|  | 46 |  | 
|  | 47 | st->tuner_addr = 0x61; | 
|  | 48 |  | 
| Michael Krufky | fbfee86 | 2007-05-09 15:58:17 -0300 | [diff] [blame] | 49 | dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap, | 
| Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 50 | DVB_PLL_TUA6010XS); | 
| Michael Krufky | fbfee86 | 2007-05-09 15:58:17 -0300 | [diff] [blame] | 51 | return 0; | 
|  | 52 | } | 
|  | 53 |  | 
|  | 54 | static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap) | 
|  | 55 | { | 
| Michael Krufky | 6c08d929 | 2007-06-12 12:43:25 -0300 | [diff] [blame] | 56 | struct dibusb_state *st = adap->priv; | 
|  | 57 |  | 
|  | 58 | st->tuner_addr = 0x60; | 
|  | 59 |  | 
| Michael Krufky | fbfee86 | 2007-05-09 15:58:17 -0300 | [diff] [blame] | 60 | dvb_attach(dvb_pll_attach, adap->fe, 0x60, &adap->dev->i2c_adap, | 
| Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 61 | DVB_PLL_TDA665X); | 
| Patrick Boettcher | 8945c8c | 2005-07-07 17:58:07 -0700 | [diff] [blame] | 62 | return 0; | 
|  | 63 | } | 
|  | 64 |  | 
|  | 65 | /* Some of the Artec 1.1 device aren't equipped with the default tuner | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 66 | * (Thomson Cable), but with a Panasonic ENV77H11D5.  This function figures | 
|  | 67 | * this out. */ | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 68 | static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap) | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 69 | { | 
|  | 70 | u8 b[2] = { 0,0 }, b2[1]; | 
|  | 71 | int ret = 0; | 
|  | 72 | struct i2c_msg msg[2] = { | 
|  | 73 | { .flags = 0,        .buf = b,  .len = 2 }, | 
|  | 74 | { .flags = I2C_M_RD, .buf = b2, .len = 1 }, | 
|  | 75 | }; | 
| Michael Krufky | 6c08d929 | 2007-06-12 12:43:25 -0300 | [diff] [blame] | 76 | struct dibusb_state *st = adap->priv; | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 77 |  | 
|  | 78 | /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */ | 
| Michael Krufky | 096bb77 | 2007-06-22 17:41:07 -0300 | [diff] [blame] | 79 | msg[0].addr = msg[1].addr = st->tuner_addr = 0x60; | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 80 |  | 
| Michael Krufky | 6c08d929 | 2007-06-12 12:43:25 -0300 | [diff] [blame] | 81 | if (adap->fe->ops.i2c_gate_ctrl) | 
|  | 82 | adap->fe->ops.i2c_gate_ctrl(adap->fe,1); | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 83 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 84 | if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) { | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 85 | err("tuner i2c write failed."); | 
|  | 86 | ret = -EREMOTEIO; | 
|  | 87 | } | 
|  | 88 |  | 
| Michael Krufky | 6c08d929 | 2007-06-12 12:43:25 -0300 | [diff] [blame] | 89 | if (adap->fe->ops.i2c_gate_ctrl) | 
|  | 90 | adap->fe->ops.i2c_gate_ctrl(adap->fe,0); | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 91 |  | 
|  | 92 | if (b2[0] == 0xfe) { | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 93 | info("This device has the Thomson Cable onboard. Which is default."); | 
| Michael Krufky | fbfee86 | 2007-05-09 15:58:17 -0300 | [diff] [blame] | 94 | ret = dibusb_thomson_tuner_attach(adap); | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 95 | } else { | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 96 | info("This device has the Panasonic ENV77H11D5 onboard."); | 
| Michael Krufky | fbfee86 | 2007-05-09 15:58:17 -0300 | [diff] [blame] | 97 | ret = dibusb_panasonic_tuner_attach(adap); | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 98 | } | 
|  | 99 |  | 
|  | 100 | return ret; | 
|  | 101 | } | 
|  | 102 |  | 
|  | 103 | /* USB Driver stuff */ | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 104 | static struct dvb_usb_device_properties dibusb1_1_properties; | 
|  | 105 | static struct dvb_usb_device_properties dibusb1_1_an2235_properties; | 
|  | 106 | static struct dvb_usb_device_properties dibusb2_0b_properties; | 
|  | 107 | static struct dvb_usb_device_properties artec_t1_usb2_properties; | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 108 |  | 
|  | 109 | static int dibusb_probe(struct usb_interface *intf, | 
|  | 110 | const struct usb_device_id *id) | 
|  | 111 | { | 
| Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 112 | if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties, | 
|  | 113 | THIS_MODULE, NULL, adapter_nr) || | 
|  | 114 | 0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties, | 
|  | 115 | THIS_MODULE, NULL, adapter_nr) || | 
|  | 116 | 0 == dvb_usb_device_init(intf, &dibusb2_0b_properties, | 
|  | 117 | THIS_MODULE, NULL, adapter_nr) || | 
|  | 118 | 0 == dvb_usb_device_init(intf, &artec_t1_usb2_properties, | 
|  | 119 | THIS_MODULE, NULL, adapter_nr)) | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 120 | return 0; | 
|  | 121 |  | 
|  | 122 | return -EINVAL; | 
|  | 123 | } | 
|  | 124 |  | 
|  | 125 | /* do not change the order of the ID table */ | 
|  | 126 | static struct usb_device_id dibusb_dib3000mb_table [] = { | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 127 | /* 00 */	{ USB_DEVICE(USB_VID_WIDEVIEW,		USB_PID_AVERMEDIA_DVBT_USB_COLD) }, | 
|  | 128 | /* 01 */	{ USB_DEVICE(USB_VID_WIDEVIEW,		USB_PID_AVERMEDIA_DVBT_USB_WARM) }, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 129 | /* 02 */	{ USB_DEVICE(USB_VID_COMPRO,		USB_PID_COMPRO_DVBU2000_COLD) }, | 
|  | 130 | /* 03 */	{ USB_DEVICE(USB_VID_COMPRO,		USB_PID_COMPRO_DVBU2000_WARM) }, | 
|  | 131 | /* 04 */	{ USB_DEVICE(USB_VID_COMPRO_UNK,	USB_PID_COMPRO_DVBU2000_UNK_COLD) }, | 
|  | 132 | /* 05 */	{ USB_DEVICE(USB_VID_DIBCOM,		USB_PID_DIBCOM_MOD3000_COLD) }, | 
|  | 133 | /* 06 */	{ USB_DEVICE(USB_VID_DIBCOM,		USB_PID_DIBCOM_MOD3000_WARM) }, | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 134 | /* 07 */	{ USB_DEVICE(USB_VID_EMPIA,		USB_PID_KWORLD_VSTREAM_COLD) }, | 
|  | 135 | /* 08 */	{ USB_DEVICE(USB_VID_EMPIA,		USB_PID_KWORLD_VSTREAM_WARM) }, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 136 | /* 09 */	{ USB_DEVICE(USB_VID_GRANDTEC,		USB_PID_GRANDTEC_DVBT_USB_COLD) }, | 
|  | 137 | /* 10 */	{ USB_DEVICE(USB_VID_GRANDTEC,		USB_PID_GRANDTEC_DVBT_USB_WARM) }, | 
|  | 138 | /* 11 */	{ USB_DEVICE(USB_VID_GRANDTEC,		USB_PID_DIBCOM_MOD3000_COLD) }, | 
|  | 139 | /* 12 */	{ USB_DEVICE(USB_VID_GRANDTEC,		USB_PID_DIBCOM_MOD3000_WARM) }, | 
|  | 140 | /* 13 */	{ USB_DEVICE(USB_VID_HYPER_PALTEK,	USB_PID_UNK_HYPER_PALTEK_COLD) }, | 
|  | 141 | /* 14 */	{ USB_DEVICE(USB_VID_HYPER_PALTEK,	USB_PID_UNK_HYPER_PALTEK_WARM) }, | 
|  | 142 | /* 15 */	{ USB_DEVICE(USB_VID_VISIONPLUS,	USB_PID_TWINHAN_VP7041_COLD) }, | 
|  | 143 | /* 16 */	{ USB_DEVICE(USB_VID_VISIONPLUS,	USB_PID_TWINHAN_VP7041_WARM) }, | 
|  | 144 | /* 17 */	{ USB_DEVICE(USB_VID_TWINHAN,		USB_PID_TWINHAN_VP7041_COLD) }, | 
|  | 145 | /* 18 */	{ USB_DEVICE(USB_VID_TWINHAN,		USB_PID_TWINHAN_VP7041_WARM) }, | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 146 | /* 19 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_COLD) }, | 
|  | 147 | /* 20 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_WARM) }, | 
|  | 148 | /* 21 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_AN2235_COLD) }, | 
|  | 149 | /* 22 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_AN2235_WARM) }, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 150 | /* 23 */	{ USB_DEVICE(USB_VID_ADSTECH,		USB_PID_ADSTECH_USB2_COLD) }, | 
| Patrick Boettcher | 8945c8c | 2005-07-07 17:58:07 -0700 | [diff] [blame] | 151 |  | 
|  | 152 | /* device ID with default DIBUSB2_0-firmware and with the hacked firmware */ | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 153 | /* 24 */	{ USB_DEVICE(USB_VID_ADSTECH,		USB_PID_ADSTECH_USB2_WARM) }, | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 154 | /* 25 */	{ USB_DEVICE(USB_VID_KYE,		USB_PID_KYE_DVB_T_COLD) }, | 
|  | 155 | /* 26 */	{ USB_DEVICE(USB_VID_KYE,		USB_PID_KYE_DVB_T_WARM) }, | 
| Johannes Stezenbach | 68293dd | 2005-07-07 17:58:06 -0700 | [diff] [blame] | 156 |  | 
| Patrick Boettcher | e69339d | 2005-09-09 13:02:42 -0700 | [diff] [blame] | 157 | /* 27 */	{ USB_DEVICE(USB_VID_KWORLD,		USB_PID_KWORLD_VSTREAM_COLD) }, | 
|  | 158 |  | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 159 | /* 28 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_USB2_COLD) }, | 
|  | 160 | /* 29 */	{ USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC,	USB_PID_ULTIMA_TVBOX_USB2_WARM) }, | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 161 |  | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 162 | /* | 
|  | 163 | * XXX: As Artec just 'forgot' to program the EEPROM on some Artec T1 devices | 
|  | 164 | *      we don't catch these faulty IDs (namely 'Cypress FX1 USB controller') that | 
|  | 165 | *      have been left on the device. If you don't have such a device but an Artec | 
|  | 166 | *      device that's supposed to work with this driver but is not detected by it, | 
|  | 167 | *      free to enable CONFIG_DVB_USB_DIBUSB_MB_FAULTY via your kernel config. | 
|  | 168 | */ | 
| Johannes Stezenbach | 68293dd | 2005-07-07 17:58:06 -0700 | [diff] [blame] | 169 |  | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 170 | #ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 171 | /* 30 */	{ USB_DEVICE(USB_VID_ANCHOR,		USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) }, | 
| Johannes Stezenbach | 68293dd | 2005-07-07 17:58:06 -0700 | [diff] [blame] | 172 | #endif | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 173 |  | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 174 | { }		/* Terminating entry */ | 
|  | 175 | }; | 
|  | 176 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table); | 
|  | 177 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 178 | static struct dvb_usb_device_properties dibusb1_1_properties = { | 
|  | 179 | .caps =  DVB_USB_IS_AN_I2C_ADAPTER, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 180 |  | 
|  | 181 | .usb_ctrl = CYPRESS_AN2135, | 
|  | 182 |  | 
|  | 183 | .firmware = "dvb-usb-dibusb-5.0.0.11.fw", | 
|  | 184 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 185 | .num_adapters = 1, | 
|  | 186 | .adapter = { | 
|  | 187 | { | 
|  | 188 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, | 
|  | 189 | .pid_filter_count = 16, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 190 |  | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 191 | .streaming_ctrl   = dibusb_streaming_ctrl, | 
|  | 192 | .pid_filter       = dibusb_pid_filter, | 
|  | 193 | .pid_filter_ctrl  = dibusb_pid_filter_ctrl, | 
|  | 194 | .frontend_attach  = dibusb_dib3000mb_frontend_attach, | 
|  | 195 | .tuner_attach     = dibusb_tuner_probe_and_attach, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 196 |  | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 197 | /* parameter for the MPEG2-data transfer */ | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 198 | .stream = { | 
|  | 199 | .type = USB_BULK, | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 200 | .count = 7, | 
|  | 201 | .endpoint = 0x02, | 
|  | 202 | .u = { | 
|  | 203 | .bulk = { | 
|  | 204 | .buffersize = 4096, | 
|  | 205 | } | 
|  | 206 | } | 
|  | 207 | }, | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 208 | .size_of_priv     = sizeof(struct dibusb_state), | 
|  | 209 | } | 
|  | 210 | }, | 
|  | 211 |  | 
|  | 212 | .power_ctrl       = dibusb_power_ctrl, | 
|  | 213 |  | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 214 | .rc_interval      = DEFAULT_RC_INTERVAL, | 
|  | 215 | .rc_key_map       = dibusb_rc_keys, | 
| Sergei Haller | a841e1f | 2006-05-14 10:47:21 -0300 | [diff] [blame] | 216 | .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 217 | .rc_query         = dibusb_rc_query, | 
|  | 218 |  | 
|  | 219 | .i2c_algo         = &dibusb_i2c_algo, | 
|  | 220 |  | 
|  | 221 | .generic_bulk_ctrl_endpoint = 0x01, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 222 |  | 
| Patrick Boettcher | 2f7f96b | 2005-07-07 17:58:16 -0700 | [diff] [blame] | 223 | .num_device_descs = 9, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 224 | .devices = { | 
|  | 225 | {	"AVerMedia AverTV DVBT USB1.1", | 
|  | 226 | { &dibusb_dib3000mb_table[0],  NULL }, | 
|  | 227 | { &dibusb_dib3000mb_table[1],  NULL }, | 
|  | 228 | }, | 
|  | 229 | {	"Compro Videomate DVB-U2000 - DVB-T USB1.1 (please confirm to linux-dvb)", | 
|  | 230 | { &dibusb_dib3000mb_table[2], &dibusb_dib3000mb_table[4], NULL}, | 
|  | 231 | { &dibusb_dib3000mb_table[3], NULL }, | 
|  | 232 | }, | 
|  | 233 | {	"DiBcom USB1.1 DVB-T reference design (MOD3000)", | 
|  | 234 | { &dibusb_dib3000mb_table[5],  NULL }, | 
|  | 235 | { &dibusb_dib3000mb_table[6],  NULL }, | 
|  | 236 | }, | 
|  | 237 | {	"KWorld V-Stream XPERT DTV - DVB-T USB1.1", | 
|  | 238 | { &dibusb_dib3000mb_table[7], NULL }, | 
|  | 239 | { &dibusb_dib3000mb_table[8], NULL }, | 
|  | 240 | }, | 
|  | 241 | {	"Grandtec USB1.1 DVB-T", | 
|  | 242 | { &dibusb_dib3000mb_table[9],  &dibusb_dib3000mb_table[11], NULL }, | 
|  | 243 | { &dibusb_dib3000mb_table[10], &dibusb_dib3000mb_table[12], NULL }, | 
|  | 244 | }, | 
|  | 245 | {	"Unkown USB1.1 DVB-T device ???? please report the name to the author", | 
|  | 246 | { &dibusb_dib3000mb_table[13], NULL }, | 
|  | 247 | { &dibusb_dib3000mb_table[14], NULL }, | 
|  | 248 | }, | 
|  | 249 | {	"TwinhanDTV USB-Ter USB1.1 / Magic Box I / HAMA USB1.1 DVB-T device", | 
|  | 250 | { &dibusb_dib3000mb_table[15], &dibusb_dib3000mb_table[17], NULL}, | 
|  | 251 | { &dibusb_dib3000mb_table[16], &dibusb_dib3000mb_table[18], NULL}, | 
|  | 252 | }, | 
|  | 253 | {	"Artec T1 USB1.1 TVBOX with AN2135", | 
|  | 254 | { &dibusb_dib3000mb_table[19], NULL }, | 
|  | 255 | { &dibusb_dib3000mb_table[20], NULL }, | 
|  | 256 | }, | 
| Patrick Boettcher | 2f7f96b | 2005-07-07 17:58:16 -0700 | [diff] [blame] | 257 | {	"VideoWalker DVB-T USB", | 
|  | 258 | { &dibusb_dib3000mb_table[25], NULL }, | 
|  | 259 | { &dibusb_dib3000mb_table[26], NULL }, | 
|  | 260 | }, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 261 | } | 
|  | 262 | }; | 
|  | 263 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 264 | static struct dvb_usb_device_properties dibusb1_1_an2235_properties = { | 
|  | 265 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 266 | .usb_ctrl = CYPRESS_AN2235, | 
|  | 267 |  | 
|  | 268 | .firmware = "dvb-usb-dibusb-an2235-01.fw", | 
|  | 269 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 270 | .num_adapters = 1, | 
|  | 271 | .adapter = { | 
|  | 272 | { | 
|  | 273 | .caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER, | 
|  | 274 | .pid_filter_count = 16, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 275 |  | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 276 | .streaming_ctrl   = dibusb_streaming_ctrl, | 
|  | 277 | .pid_filter       = dibusb_pid_filter, | 
|  | 278 | .pid_filter_ctrl  = dibusb_pid_filter_ctrl, | 
|  | 279 | .frontend_attach  = dibusb_dib3000mb_frontend_attach, | 
|  | 280 | .tuner_attach     = dibusb_tuner_probe_and_attach, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 281 |  | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 282 | /* parameter for the MPEG2-data transfer */ | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 283 | .stream = { | 
|  | 284 | .type = USB_BULK, | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 285 | .count = 7, | 
|  | 286 | .endpoint = 0x02, | 
|  | 287 | .u = { | 
|  | 288 | .bulk = { | 
|  | 289 | .buffersize = 4096, | 
|  | 290 | } | 
|  | 291 | } | 
|  | 292 | }, | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 293 | .size_of_priv     = sizeof(struct dibusb_state), | 
|  | 294 | }, | 
|  | 295 | }, | 
|  | 296 | .power_ctrl       = dibusb_power_ctrl, | 
|  | 297 |  | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 298 | .rc_interval      = DEFAULT_RC_INTERVAL, | 
|  | 299 | .rc_key_map       = dibusb_rc_keys, | 
| Sergei Haller | a841e1f | 2006-05-14 10:47:21 -0300 | [diff] [blame] | 300 | .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 301 | .rc_query         = dibusb_rc_query, | 
|  | 302 |  | 
|  | 303 | .i2c_algo         = &dibusb_i2c_algo, | 
|  | 304 |  | 
|  | 305 | .generic_bulk_ctrl_endpoint = 0x01, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 306 |  | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 307 | #ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY | 
| Johannes Stezenbach | 68293dd | 2005-07-07 17:58:06 -0700 | [diff] [blame] | 308 | .num_device_descs = 2, | 
|  | 309 | #else | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 310 | .num_device_descs = 1, | 
| Johannes Stezenbach | 68293dd | 2005-07-07 17:58:06 -0700 | [diff] [blame] | 311 | #endif | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 312 | .devices = { | 
|  | 313 | {	"Artec T1 USB1.1 TVBOX with AN2235", | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 314 | { &dibusb_dib3000mb_table[21], NULL }, | 
| Alistair Buxton | 83905b0 | 2006-09-10 12:09:22 -0300 | [diff] [blame] | 315 | { &dibusb_dib3000mb_table[22], NULL }, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 316 | }, | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 317 | #ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY | 
| Johannes Stezenbach | 68293dd | 2005-07-07 17:58:06 -0700 | [diff] [blame] | 318 | {	"Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)", | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 319 | { &dibusb_dib3000mb_table[30], NULL }, | 
| Johannes Stezenbach | 68293dd | 2005-07-07 17:58:06 -0700 | [diff] [blame] | 320 | { NULL }, | 
|  | 321 | }, | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 322 | { NULL }, | 
| Johannes Stezenbach | 68293dd | 2005-07-07 17:58:06 -0700 | [diff] [blame] | 323 | #endif | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 324 | } | 
|  | 325 | }; | 
|  | 326 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 327 | static struct dvb_usb_device_properties dibusb2_0b_properties = { | 
|  | 328 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | 
| Patrick Boettcher | c251ef6 | 2005-07-07 17:58:14 -0700 | [diff] [blame] | 329 |  | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 330 | .usb_ctrl = CYPRESS_FX2, | 
|  | 331 |  | 
| Patrick Boettcher | 8945c8c | 2005-07-07 17:58:07 -0700 | [diff] [blame] | 332 | .firmware = "dvb-usb-adstech-usb2-02.fw", | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 333 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 334 | .num_adapters = 1, | 
|  | 335 | .adapter = { | 
|  | 336 | { | 
|  | 337 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, | 
|  | 338 | .pid_filter_count = 16, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 339 |  | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 340 | .streaming_ctrl   = dibusb2_0_streaming_ctrl, | 
|  | 341 | .pid_filter       = dibusb_pid_filter, | 
|  | 342 | .pid_filter_ctrl  = dibusb_pid_filter_ctrl, | 
|  | 343 | .frontend_attach  = dibusb_dib3000mb_frontend_attach, | 
|  | 344 | .tuner_attach     = dibusb_thomson_tuner_attach, | 
|  | 345 |  | 
|  | 346 | /* parameter for the MPEG2-data transfer */ | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 347 | .stream = { | 
|  | 348 | .type = USB_BULK, | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 349 | .count = 7, | 
|  | 350 | .endpoint = 0x06, | 
|  | 351 | .u = { | 
|  | 352 | .bulk = { | 
|  | 353 | .buffersize = 4096, | 
|  | 354 | } | 
|  | 355 | } | 
|  | 356 | }, | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 357 | .size_of_priv     = sizeof(struct dibusb_state), | 
|  | 358 | } | 
|  | 359 | }, | 
|  | 360 | .power_ctrl       = dibusb2_0_power_ctrl, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 361 |  | 
|  | 362 | .rc_interval      = DEFAULT_RC_INTERVAL, | 
|  | 363 | .rc_key_map       = dibusb_rc_keys, | 
| Sergei Haller | a841e1f | 2006-05-14 10:47:21 -0300 | [diff] [blame] | 364 | .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 365 | .rc_query         = dibusb_rc_query, | 
|  | 366 |  | 
|  | 367 | .i2c_algo         = &dibusb_i2c_algo, | 
|  | 368 |  | 
|  | 369 | .generic_bulk_ctrl_endpoint = 0x01, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 370 |  | 
| Patrick Boettcher | e69339d | 2005-09-09 13:02:42 -0700 | [diff] [blame] | 371 | .num_device_descs = 2, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 372 | .devices = { | 
| Patrick Boettcher | e69339d | 2005-09-09 13:02:42 -0700 | [diff] [blame] | 373 | {	"KWorld/ADSTech Instant DVB-T USB2.0", | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 374 | { &dibusb_dib3000mb_table[23], NULL }, | 
| Patrick Boettcher | 8945c8c | 2005-07-07 17:58:07 -0700 | [diff] [blame] | 375 | { &dibusb_dib3000mb_table[24], NULL }, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 376 | }, | 
| Patrick Boettcher | e69339d | 2005-09-09 13:02:42 -0700 | [diff] [blame] | 377 | {	"KWorld Xpert DVB-T USB2.0", | 
|  | 378 | { &dibusb_dib3000mb_table[27], NULL }, | 
|  | 379 | { NULL } | 
|  | 380 | }, | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 381 | { NULL }, | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 382 | } | 
|  | 383 | }; | 
|  | 384 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 385 | static struct dvb_usb_device_properties artec_t1_usb2_properties = { | 
|  | 386 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 387 |  | 
|  | 388 | .usb_ctrl = CYPRESS_FX2, | 
|  | 389 |  | 
|  | 390 | .firmware = "dvb-usb-dibusb-6.0.0.8.fw", | 
|  | 391 |  | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 392 | .num_adapters = 1, | 
|  | 393 | .adapter = { | 
|  | 394 | { | 
|  | 395 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, | 
|  | 396 | .pid_filter_count = 16, | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 397 |  | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 398 | .streaming_ctrl   = dibusb2_0_streaming_ctrl, | 
|  | 399 | .pid_filter       = dibusb_pid_filter, | 
|  | 400 | .pid_filter_ctrl  = dibusb_pid_filter_ctrl, | 
|  | 401 | .frontend_attach  = dibusb_dib3000mb_frontend_attach, | 
|  | 402 | .tuner_attach     = dibusb_tuner_probe_and_attach, | 
|  | 403 | /* parameter for the MPEG2-data transfer */ | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 404 | .stream = { | 
|  | 405 | .type = USB_BULK, | 
| Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 406 | .count = 7, | 
|  | 407 | .endpoint = 0x06, | 
|  | 408 | .u = { | 
|  | 409 | .bulk = { | 
|  | 410 | .buffersize = 4096, | 
|  | 411 | } | 
|  | 412 | } | 
|  | 413 | }, | 
| Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 414 | .size_of_priv     = sizeof(struct dibusb_state), | 
|  | 415 | } | 
|  | 416 | }, | 
|  | 417 | .power_ctrl       = dibusb2_0_power_ctrl, | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 418 |  | 
|  | 419 | .rc_interval      = DEFAULT_RC_INTERVAL, | 
|  | 420 | .rc_key_map       = dibusb_rc_keys, | 
| Sergei Haller | a841e1f | 2006-05-14 10:47:21 -0300 | [diff] [blame] | 421 | .rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 422 | .rc_query         = dibusb_rc_query, | 
|  | 423 |  | 
|  | 424 | .i2c_algo         = &dibusb_i2c_algo, | 
|  | 425 |  | 
|  | 426 | .generic_bulk_ctrl_endpoint = 0x01, | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 427 |  | 
|  | 428 | .num_device_descs = 1, | 
|  | 429 | .devices = { | 
|  | 430 | {	"Artec T1 USB2.0", | 
|  | 431 | { &dibusb_dib3000mb_table[28], NULL }, | 
|  | 432 | { &dibusb_dib3000mb_table[29], NULL }, | 
|  | 433 | }, | 
| Marc Koschewski | 1157020 | 2006-01-09 18:21:36 -0200 | [diff] [blame] | 434 | { NULL }, | 
| Patrick Boettcher | f6f4b72 | 2005-11-08 21:35:52 -0800 | [diff] [blame] | 435 | } | 
|  | 436 | }; | 
|  | 437 |  | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 438 | static struct usb_driver dibusb_driver = { | 
| Patrick Boettcher | 63b5c1c | 2005-07-07 17:58:30 -0700 | [diff] [blame] | 439 | .name		= "dvb_usb_dibusb_mb", | 
| Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 440 | .probe		= dibusb_probe, | 
|  | 441 | .disconnect = dvb_usb_device_exit, | 
|  | 442 | .id_table	= dibusb_dib3000mb_table, | 
|  | 443 | }; | 
|  | 444 |  | 
|  | 445 | /* module stuff */ | 
|  | 446 | static int __init dibusb_module_init(void) | 
|  | 447 | { | 
|  | 448 | int result; | 
|  | 449 | if ((result = usb_register(&dibusb_driver))) { | 
|  | 450 | err("usb_register failed. Error number %d",result); | 
|  | 451 | return result; | 
|  | 452 | } | 
|  | 453 |  | 
|  | 454 | return 0; | 
|  | 455 | } | 
|  | 456 |  | 
|  | 457 | static void __exit dibusb_module_exit(void) | 
|  | 458 | { | 
|  | 459 | /* deregister this driver from the USB subsystem */ | 
|  | 460 | usb_deregister(&dibusb_driver); | 
|  | 461 | } | 
|  | 462 |  | 
|  | 463 | module_init (dibusb_module_init); | 
|  | 464 | module_exit (dibusb_module_exit); | 
|  | 465 |  | 
|  | 466 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 
|  | 467 | MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)"); | 
|  | 468 | MODULE_VERSION("1.0"); | 
|  | 469 | MODULE_LICENSE("GPL"); |