aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/Kconfig17
-rw-r--r--drivers/media/dvb/dvb-usb/a800.c8
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c11
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-common.c200
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-mb.c18
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-mc.c41
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb.h3
-rw-r--r--drivers/media/dvb/dvb-usb/digitv.c86
-rw-r--r--drivers/media/dvb/dvb-usb/dtt200u.c50
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-dvb.c20
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h124
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-remote.c5
-rw-r--r--drivers/media/dvb/dvb-usb/nova-t-usb2.c2
-rw-r--r--drivers/media/dvb/dvb-usb/umt-010.c2
14 files changed, 468 insertions, 119 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index 75824b77198a..0a3c35399bea 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -26,6 +26,7 @@ config DVB_USB_A800
26 tristate "AVerMedia AverTV DVB-T USB 2.0 (A800)" 26 tristate "AVerMedia AverTV DVB-T USB 2.0 (A800)"
27 depends on DVB_USB 27 depends on DVB_USB
28 select DVB_DIB3000MC 28 select DVB_DIB3000MC
29 select DVB_TUNER_MT2060
29 help 30 help
30 Say Y here to support the AVerMedia AverTV DVB-T USB 2.0 (A800) receiver. 31 Say Y here to support the AVerMedia AverTV DVB-T USB 2.0 (A800) receiver.
31 32
@@ -33,6 +34,7 @@ config DVB_USB_DIBUSB_MB
33 tristate "DiBcom USB DVB-T devices (based on the DiB3000M-B) (see help for device list)" 34 tristate "DiBcom USB DVB-T devices (based on the DiB3000M-B) (see help for device list)"
34 depends on DVB_USB 35 depends on DVB_USB
35 select DVB_DIB3000MB 36 select DVB_DIB3000MB
37 select DVB_TUNER_MT2060
36 help 38 help
37 Support for USB 1.1 and 2.0 DVB-T receivers based on reference designs made by 39 Support for USB 1.1 and 2.0 DVB-T receivers based on reference designs made by
38 DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator. 40 DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator.
@@ -65,6 +67,7 @@ config DVB_USB_DIBUSB_MC
65 tristate "DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list)" 67 tristate "DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list)"
66 depends on DVB_USB 68 depends on DVB_USB
67 select DVB_DIB3000MC 69 select DVB_DIB3000MC
70 select DVB_TUNER_MT2060
68 help 71 help
69 Support for 2.0 DVB-T receivers based on reference designs made by 72 Support for 2.0 DVB-T receivers based on reference designs made by
70 DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator. 73 DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator.
@@ -80,16 +83,17 @@ config DVB_USB_UMT_010
80 tristate "HanfTek UMT-010 DVB-T USB2.0 support" 83 tristate "HanfTek UMT-010 DVB-T USB2.0 support"
81 depends on DVB_USB 84 depends on DVB_USB
82 select DVB_DIB3000MC 85 select DVB_DIB3000MC
86 select DVB_TUNER_MT2060
83 help 87 help
84 Say Y here to support the HanfTek UMT-010 USB2.0 stick-sized DVB-T receiver. 88 Say Y here to support the HanfTek UMT-010 USB2.0 stick-sized DVB-T receiver.
85 89
86config DVB_USB_CXUSB 90config DVB_USB_CXUSB
87 tristate "Conexant USB2.0 hybrid reference design support" 91 tristate "Conexant USB2.0 hybrid reference design support"
88 depends on DVB_USB 92 depends on DVB_USB
89 select DVB_CX22702 93 select DVB_CX22702 if !DVB_FE_CUSTOMISE
90 select DVB_LGDT330X 94 select DVB_LGDT330X if !DVB_FE_CUSTOMISE
91 select DVB_MT352 95 select DVB_MT352 if !DVB_FE_CUSTOMISE
92 select DVB_ZL10353 96 select DVB_ZL10353 if !DVB_FE_CUSTOMISE
93 help 97 help
94 Say Y here to support the Conexant USB2.0 hybrid reference design. 98 Say Y here to support the Conexant USB2.0 hybrid reference design.
95 Currently, only DVB and ATSC modes are supported, analog mode 99 Currently, only DVB and ATSC modes are supported, analog mode
@@ -101,8 +105,8 @@ config DVB_USB_CXUSB
101config DVB_USB_DIGITV 105config DVB_USB_DIGITV
102 tristate "Nebula Electronics uDigiTV DVB-T USB2.0 support" 106 tristate "Nebula Electronics uDigiTV DVB-T USB2.0 support"
103 depends on DVB_USB 107 depends on DVB_USB
104 select DVB_NXT6000 108 select DVB_NXT6000 if !DVB_FE_CUSTOMISE
105 select DVB_MT352 109 select DVB_MT352 if !DVB_FE_CUSTOMISE
106 help 110 help
107 Say Y here to support the Nebula Electronics uDigitV USB2.0 DVB-T receiver. 111 Say Y here to support the Nebula Electronics uDigitV USB2.0 DVB-T receiver.
108 112
@@ -145,6 +149,7 @@ config DVB_USB_NOVA_T_USB2
145 tristate "Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support" 149 tristate "Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support"
146 depends on DVB_USB 150 depends on DVB_USB
147 select DVB_DIB3000MC 151 select DVB_DIB3000MC
152 select DVB_TUNER_MT2060
148 help 153 help
149 Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver. 154 Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver.
150 155
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c
index ce44aa6bbb83..df0c384bd4ca 100644
--- a/drivers/media/dvb/dvb-usb/a800.c
+++ b/drivers/media/dvb/dvb-usb/a800.c
@@ -26,6 +26,13 @@ static int a800_power_ctrl(struct dvb_usb_device *d, int onoff)
26 return 0; 26 return 0;
27} 27}
28 28
29/* assure to put cold to 0 for iManufacturer == 1 */
30static int a800_identify_state(struct usb_device *udev, struct dvb_usb_properties *props,struct dvb_usb_device_description **desc, int *cold)
31{
32 *cold = udev->descriptor.iManufacturer != 1;
33 return 0;
34}
35
29static struct dvb_usb_rc_key a800_rc_keys[] = { 36static struct dvb_usb_rc_key a800_rc_keys[] = {
30 { 0x02, 0x01, KEY_PROG1 }, /* SOURCE */ 37 { 0x02, 0x01, KEY_PROG1 }, /* SOURCE */
31 { 0x02, 0x00, KEY_POWER }, /* POWER */ 38 { 0x02, 0x00, KEY_POWER }, /* POWER */
@@ -113,6 +120,7 @@ static struct dvb_usb_properties a800_properties = {
113 .power_ctrl = a800_power_ctrl, 120 .power_ctrl = a800_power_ctrl,
114 .frontend_attach = dibusb_dib3000mc_frontend_attach, 121 .frontend_attach = dibusb_dib3000mc_frontend_attach,
115 .tuner_attach = dibusb_dib3000mc_tuner_attach, 122 .tuner_attach = dibusb_dib3000mc_tuner_attach,
123 .identify_state = a800_identify_state,
116 124
117 .rc_interval = DEFAULT_RC_INTERVAL, 125 .rc_interval = DEFAULT_RC_INTERVAL,
118 .rc_key_map = a800_rc_keys, 126 .rc_key_map = a800_rc_keys,
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index ae23bdde42a8..c710c0176e07 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -349,6 +349,7 @@ static struct mt352_config cxusb_dee1601_config = {
349 349
350static struct zl10353_config cxusb_zl10353_dee1601_config = { 350static struct zl10353_config cxusb_zl10353_dee1601_config = {
351 .demod_address = 0x0f, 351 .demod_address = 0x0f,
352 .parallel_ts = 1,
352}; 353};
353 354
354static struct mt352_config cxusb_mt352_config = { 355static struct mt352_config cxusb_mt352_config = {
@@ -409,7 +410,7 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
409 410
410 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1); 411 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1);
411 412
412 if ((d->fe = cx22702_attach(&cxusb_cx22702_config, &d->i2c_adap)) != NULL) 413 if ((d->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config, &d->i2c_adap)) != NULL)
413 return 0; 414 return 0;
414 415
415 return -EIO; 416 return -EIO;
@@ -422,7 +423,7 @@ static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d)
422 423
423 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 424 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
424 425
425 if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL) 426 if ((d->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config, &d->i2c_adap)) != NULL)
426 return 0; 427 return 0;
427 428
428 return -EIO; 429 return -EIO;
@@ -435,7 +436,7 @@ static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d)
435 436
436 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 437 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
437 438
438 if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL) 439 if ((d->fe = dvb_attach(mt352_attach, &cxusb_mt352_config, &d->i2c_adap)) != NULL)
439 return 0; 440 return 0;
440 441
441 return -EIO; 442 return -EIO;
@@ -448,8 +449,8 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
448 449
449 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 450 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
450 451
451 if (((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) || 452 if (((d->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config, &d->i2c_adap)) != NULL) ||
452 ((d->fe = zl10353_attach(&cxusb_zl10353_dee1601_config, &d->i2c_adap)) != NULL)) 453 ((d->fe = dvb_attach(zl10353_attach, &cxusb_zl10353_dee1601_config, &d->i2c_adap)) != NULL))
453 return 0; 454 return 0;
454 455
455 return -EIO; 456 return -EIO;
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c
index abd75b4a350d..124e25ac53b3 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-common.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-common.c
@@ -131,9 +131,6 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
131 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) 131 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
132 return -EAGAIN; 132 return -EAGAIN;
133 133
134 if (num > 2)
135 warn("more than 2 i2c messages at a time is not handled yet. TODO.");
136
137 for (i = 0; i < num; i++) { 134 for (i = 0; i < num; i++) {
138 /* write/read request */ 135 /* write/read request */
139 if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) { 136 if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
@@ -168,31 +165,137 @@ int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val)
168} 165}
169EXPORT_SYMBOL(dibusb_read_eeprom_byte); 166EXPORT_SYMBOL(dibusb_read_eeprom_byte);
170 167
168/* 3000MC/P stuff */
169// Config Adjacent channels Perf -cal22
170static struct dibx000_agc_config dib3000p_mt2060_agc_config = {
171 .band_caps = BAND_VHF | BAND_UHF,
172 .setup = (0 << 15) | (0 << 14) | (1 << 13) | (1 << 12) | (29 << 0),
173
174 .agc1_max = 48497,
175 .agc1_min = 23593,
176 .agc2_max = 46531,
177 .agc2_min = 24904,
178
179 .agc1_pt1 = 0x65,
180 .agc1_pt2 = 0x69,
181
182 .agc1_slope1 = 0x51,
183 .agc1_slope2 = 0x27,
184
185 .agc2_pt1 = 0,
186 .agc2_pt2 = 0x33,
187
188 .agc2_slope1 = 0x35,
189 .agc2_slope2 = 0x37,
190};
191
192static struct dib3000mc_config stk3000p_dib3000p_config = {
193 &dib3000p_mt2060_agc_config,
194
195 .max_time = 0x196,
196 .ln_adc_level = 0x1cc7,
197
198 .output_mpeg2_in_188_bytes = 1,
199};
200
201static struct dibx000_agc_config dib3000p_panasonic_agc_config = {
202 .setup = (0 << 15) | (0 << 14) | (1 << 13) | (1 << 12) | (29 << 0),
203
204 .agc1_max = 56361,
205 .agc1_min = 22282,
206 .agc2_max = 47841,
207 .agc2_min = 36045,
208
209 .agc1_pt1 = 0x3b,
210 .agc1_pt2 = 0x6b,
211
212 .agc1_slope1 = 0x55,
213 .agc1_slope2 = 0x1d,
214
215 .agc2_pt1 = 0,
216 .agc2_pt2 = 0x0a,
217
218 .agc2_slope1 = 0x95,
219 .agc2_slope2 = 0x1e,
220};
221
222static struct dib3000mc_config mod3000p_dib3000p_config = {
223 &dib3000p_panasonic_agc_config,
224
225 .max_time = 0x51,
226 .ln_adc_level = 0x1cc7,
227
228 .output_mpeg2_in_188_bytes = 1,
229};
230
171int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d) 231int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d)
172{ 232{
173 struct dib3000_config demod_cfg; 233 if (dib3000mc_attach(&d->i2c_adap, 1, DEFAULT_DIB3000P_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &d->fe) == 0 ||
174 struct dibusb_state *st = d->priv; 234 dib3000mc_attach(&d->i2c_adap, 1, DEFAULT_DIB3000MC_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &d->fe) == 0) {
175 235 if (d->priv != NULL) {
176 for (demod_cfg.demod_address = 0x8; demod_cfg.demod_address < 0xd; demod_cfg.demod_address++) 236 struct dibusb_state *st = d->priv;
177 if ((d->fe = dib3000mc_attach(&demod_cfg,&d->i2c_adap,&st->ops)) != NULL) { 237 st->ops.pid_parse = dib3000mc_pid_parse;
178 d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; 238 st->ops.pid_ctrl = dib3000mc_pid_control;
179 d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
180 d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl;
181 return 0;
182 } 239 }
183 240 return 0;
241 }
184 return -ENODEV; 242 return -ENODEV;
185} 243}
186EXPORT_SYMBOL(dibusb_dib3000mc_frontend_attach); 244EXPORT_SYMBOL(dibusb_dib3000mc_frontend_attach);
187 245
246static struct mt2060_config stk3000p_mt2060_config = {
247 0x60
248};
249
188int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) 250int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d)
189{ 251{
190 d->pll_addr = 0x60; 252 struct dibusb_state *st = d->priv;
191 d->pll_desc = &dvb_pll_env57h1xd5; 253 int ret;
192 254 u8 a,b;
193 d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; 255 u16 if1 = 1220;
194 d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; 256 struct i2c_adapter *tun_i2c;
257
258 // First IF calibration for Liteon Sticks
259 if (d->udev->descriptor.idVendor == USB_VID_LITEON &&
260 d->udev->descriptor.idProduct == USB_PID_LITEON_DVB_T_WARM) {
261
262 dibusb_read_eeprom_byte(d,0x7E,&a);
263 dibusb_read_eeprom_byte(d,0x7F,&b);
264
265 if (a == 0x00)
266 if1 += b;
267 else if (a == 0x80)
268 if1 -= b;
269 else
270 warn("LITE-ON DVB-T: Strange IF1 calibration :%2X %2X\n", a, b);
271
272 } else if (d->udev->descriptor.idVendor == USB_VID_DIBCOM &&
273 d->udev->descriptor.idProduct == USB_PID_DIBCOM_MOD3001_WARM) {
274 u8 desc;
275 dibusb_read_eeprom_byte(d, 7, &desc);
276 if (desc == 2) {
277 a = 127;
278 do {
279 dibusb_read_eeprom_byte(d, a, &desc);
280 a--;
281 } while (a > 7 && (desc == 0xff || desc == 0x00));
282 if (desc & 0x80)
283 if1 -= (0xff - desc);
284 else
285 if1 += desc;
286 }
287 }
195 288
289 tun_i2c = dib3000mc_get_tuner_i2c_master(d->fe, 1);
290 if ((ret = mt2060_attach(d->fe, tun_i2c, &stk3000p_mt2060_config, if1)) != 0) {
291 /* not found - use panasonic pll parameters */
292 if (dvb_pll_attach(d->fe, 0x60, tun_i2c, &dvb_pll_env57h1xd5) == NULL)
293 return -ENOMEM;
294 } else {
295 st->mt2060_present = 1;
296 /* set the correct parameters for the dib3000p */
297 dib3000mc_set_config(d->fe, &stk3000p_dib3000p_config);
298 }
196 return 0; 299 return 0;
197} 300}
198EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); 301EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach);
@@ -267,6 +370,67 @@ struct dvb_usb_rc_key dibusb_rc_keys[] = {
267 { 0x86, 0x1e, KEY_DOWN }, 370 { 0x86, 0x1e, KEY_DOWN },
268 { 0x86, 0x1f, KEY_LEFT }, 371 { 0x86, 0x1f, KEY_LEFT },
269 { 0x86, 0x1b, KEY_RIGHT }, 372 { 0x86, 0x1b, KEY_RIGHT },
373
374 /* Key codes for the DiBcom MOD3000 remote. */
375 { 0x80, 0x00, KEY_MUTE },
376 { 0x80, 0x01, KEY_TEXT },
377 { 0x80, 0x02, KEY_HOME },
378 { 0x80, 0x03, KEY_POWER },
379
380 { 0x80, 0x04, KEY_RED },
381 { 0x80, 0x05, KEY_GREEN },
382 { 0x80, 0x06, KEY_YELLOW },
383 { 0x80, 0x07, KEY_BLUE },
384
385 { 0x80, 0x08, KEY_DVD },
386 { 0x80, 0x09, KEY_AUDIO },
387 { 0x80, 0x0a, KEY_MEDIA }, /* Pictures */
388 { 0x80, 0x0b, KEY_VIDEO },
389
390 { 0x80, 0x0c, KEY_BACK },
391 { 0x80, 0x0d, KEY_UP },
392 { 0x80, 0x0e, KEY_RADIO },
393 { 0x80, 0x0f, KEY_EPG },
394
395 { 0x80, 0x10, KEY_LEFT },
396 { 0x80, 0x11, KEY_OK },
397 { 0x80, 0x12, KEY_RIGHT },
398 { 0x80, 0x13, KEY_UNKNOWN }, /* SAP */
399
400 { 0x80, 0x14, KEY_TV },
401 { 0x80, 0x15, KEY_DOWN },
402 { 0x80, 0x16, KEY_MENU }, /* DVD Menu */
403 { 0x80, 0x17, KEY_LAST },
404
405 { 0x80, 0x18, KEY_RECORD },
406 { 0x80, 0x19, KEY_STOP },
407 { 0x80, 0x1a, KEY_PAUSE },
408 { 0x80, 0x1b, KEY_PLAY },
409
410 { 0x80, 0x1c, KEY_PREVIOUS },
411 { 0x80, 0x1d, KEY_REWIND },
412 { 0x80, 0x1e, KEY_FASTFORWARD },
413 { 0x80, 0x1f, KEY_NEXT},
414
415 { 0x80, 0x40, KEY_1 },
416 { 0x80, 0x41, KEY_2 },
417 { 0x80, 0x42, KEY_3 },
418 { 0x80, 0x43, KEY_CHANNELUP },
419
420 { 0x80, 0x44, KEY_4 },
421 { 0x80, 0x45, KEY_5 },
422 { 0x80, 0x46, KEY_6 },
423 { 0x80, 0x47, KEY_CHANNELDOWN },
424
425 { 0x80, 0x48, KEY_7 },
426 { 0x80, 0x49, KEY_8 },
427 { 0x80, 0x4a, KEY_9 },
428 { 0x80, 0x4b, KEY_VOLUMEUP },
429
430 { 0x80, 0x4c, KEY_CLEAR },
431 { 0x80, 0x4d, KEY_0 },
432 { 0x80, 0x4e, KEY_ENTER },
433 { 0x80, 0x4f, KEY_VOLUMEDOWN },
270}; 434};
271EXPORT_SYMBOL(dibusb_rc_keys); 435EXPORT_SYMBOL(dibusb_rc_keys);
272 436
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c
index f4c45f386ebc..effd34cc4b02 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -21,11 +21,11 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_device *d)
21 21
22 demod_cfg.demod_address = 0x8; 22 demod_cfg.demod_address = 0x8;
23 23
24 if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL) { 24 if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL)
25 d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
26 d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
27 return -ENODEV; 25 return -ENODEV;
28 } 26
27 d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
28 d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
29 29
30 d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; 30 d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl;
31 31
@@ -169,7 +169,7 @@ static struct dvb_usb_properties dibusb1_1_properties = {
169 169
170 .rc_interval = DEFAULT_RC_INTERVAL, 170 .rc_interval = DEFAULT_RC_INTERVAL,
171 .rc_key_map = dibusb_rc_keys, 171 .rc_key_map = dibusb_rc_keys,
172 .rc_key_map_size = 63, /* wow, that is ugly ... I want to load it to the driver dynamically */ 172 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
173 .rc_query = dibusb_rc_query, 173 .rc_query = dibusb_rc_query,
174 174
175 .i2c_algo = &dibusb_i2c_algo, 175 .i2c_algo = &dibusb_i2c_algo,
@@ -247,7 +247,7 @@ static struct dvb_usb_properties dibusb1_1_an2235_properties = {
247 247
248 .rc_interval = DEFAULT_RC_INTERVAL, 248 .rc_interval = DEFAULT_RC_INTERVAL,
249 .rc_key_map = dibusb_rc_keys, 249 .rc_key_map = dibusb_rc_keys,
250 .rc_key_map_size = 63, /* wow, that is ugly ... I want to load it to the driver dynamically */ 250 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
251 .rc_query = dibusb_rc_query, 251 .rc_query = dibusb_rc_query,
252 252
253 .i2c_algo = &dibusb_i2c_algo, 253 .i2c_algo = &dibusb_i2c_algo,
@@ -272,8 +272,8 @@ static struct dvb_usb_properties dibusb1_1_an2235_properties = {
272#endif 272#endif
273 .devices = { 273 .devices = {
274 { "Artec T1 USB1.1 TVBOX with AN2235", 274 { "Artec T1 USB1.1 TVBOX with AN2235",
275 { &dibusb_dib3000mb_table[20], NULL },
276 { &dibusb_dib3000mb_table[21], NULL }, 275 { &dibusb_dib3000mb_table[21], NULL },
276 { &dibusb_dib3000mb_table[22], NULL },
277 }, 277 },
278#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY 278#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
279 { "Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)", 279 { "Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)",
@@ -304,7 +304,7 @@ static struct dvb_usb_properties dibusb2_0b_properties = {
304 304
305 .rc_interval = DEFAULT_RC_INTERVAL, 305 .rc_interval = DEFAULT_RC_INTERVAL,
306 .rc_key_map = dibusb_rc_keys, 306 .rc_key_map = dibusb_rc_keys,
307 .rc_key_map_size = 63, /* wow, that is ugly ... I want to load it to the driver dynamically */ 307 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
308 .rc_query = dibusb_rc_query, 308 .rc_query = dibusb_rc_query,
309 309
310 .i2c_algo = &dibusb_i2c_algo, 310 .i2c_algo = &dibusb_i2c_algo,
@@ -355,7 +355,7 @@ static struct dvb_usb_properties artec_t1_usb2_properties = {
355 355
356 .rc_interval = DEFAULT_RC_INTERVAL, 356 .rc_interval = DEFAULT_RC_INTERVAL,
357 .rc_key_map = dibusb_rc_keys, 357 .rc_key_map = dibusb_rc_keys,
358 .rc_key_map_size = 63, /* wow, that is ugly ... I want to load it to the driver dynamically */ 358 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
359 .rc_query = dibusb_rc_query, 359 .rc_query = dibusb_rc_query,
360 360
361 .i2c_algo = &dibusb_i2c_algo, 361 .i2c_algo = &dibusb_i2c_algo,
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c
index 55802fba3c29..eca4082a61ae 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mc.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c
@@ -28,6 +28,17 @@ static struct usb_device_id dibusb_dib3000mc_table [] = {
28/* 00 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) }, 28/* 00 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) },
29/* 01 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) }, 29/* 01 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) },
30/* 02 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) }, 30/* 02 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
31/* 03 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) }, // ( ? )
32/* 04 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_COLD) },
33/* 05 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_WARM) },
34/* 06 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_COLD) },
35/* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_WARM) },
36/* 08 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_COLD) },
37/* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_WARM) },
38/* 10 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_COLD) },
39/* 11 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_WARM) },
40/* 12 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_COLD) },
41/* 13 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_WARM) },
31 { } /* Terminating entry */ 42 { } /* Terminating entry */
32}; 43};
33MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table); 44MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table);
@@ -50,7 +61,7 @@ static struct dvb_usb_properties dibusb_mc_properties = {
50 61
51 .rc_interval = DEFAULT_RC_INTERVAL, 62 .rc_interval = DEFAULT_RC_INTERVAL,
52 .rc_key_map = dibusb_rc_keys, 63 .rc_key_map = dibusb_rc_keys,
53 .rc_key_map_size = 63, /* FIXME */ 64 .rc_key_map_size = 111, /* FIXME */
54 .rc_query = dibusb_rc_query, 65 .rc_query = dibusb_rc_query,
55 66
56 .i2c_algo = &dibusb_i2c_algo, 67 .i2c_algo = &dibusb_i2c_algo,
@@ -68,16 +79,38 @@ static struct dvb_usb_properties dibusb_mc_properties = {
68 } 79 }
69 }, 80 },
70 81
71 .num_device_descs = 2, 82 .num_device_descs = 7,
72 .devices = { 83 .devices = {
73 { "DiBcom USB2.0 DVB-T reference design (MOD3000P)", 84 { "DiBcom USB2.0 DVB-T reference design (MOD3000P)",
74 { &dibusb_dib3000mc_table[0], NULL }, 85 { &dibusb_dib3000mc_table[0], NULL },
75 { &dibusb_dib3000mc_table[1], NULL }, 86 { &dibusb_dib3000mc_table[1], NULL },
76 }, 87 },
77 { "Artec T1 USB2.0 TVBOX (please report the warm ID)", 88 { "Artec T1 USB2.0 TVBOX (please check the warm ID)",
78 { &dibusb_dib3000mc_table[2], NULL }, 89 { &dibusb_dib3000mc_table[2], NULL },
79 { NULL }, 90 { &dibusb_dib3000mc_table[3], NULL },
80 }, 91 },
92 { "LITE-ON USB2.0 DVB-T Tuner",
93 /* Also rebranded as Intuix S800, Toshiba */
94 { &dibusb_dib3000mc_table[4], NULL },
95 { &dibusb_dib3000mc_table[5], NULL },
96 },
97 { "MSI Digivox Mini SL",
98 { &dibusb_dib3000mc_table[6], NULL },
99 { &dibusb_dib3000mc_table[7], NULL },
100 },
101 { "GRAND - USB2.0 DVB-T adapter",
102 { &dibusb_dib3000mc_table[8], NULL },
103 { &dibusb_dib3000mc_table[9], NULL },
104 },
105 { "Artec T14 - USB2.0 DVB-T",
106 { &dibusb_dib3000mc_table[10], NULL },
107 { &dibusb_dib3000mc_table[11], NULL },
108 },
109 { "Leadtek - USB2.0 Winfast DTV dongle",
110 { &dibusb_dib3000mc_table[12], NULL },
111 { &dibusb_dib3000mc_table[13], NULL },
112 },
113 { NULL },
81 } 114 }
82}; 115};
83 116
diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h
index 2d99d05c7eab..a43f87480cf6 100644
--- a/drivers/media/dvb/dvb-usb/dibusb.h
+++ b/drivers/media/dvb/dvb-usb/dibusb.h
@@ -17,6 +17,8 @@
17#include "dvb-usb.h" 17#include "dvb-usb.h"
18 18
19#include "dib3000.h" 19#include "dib3000.h"
20#include "dib3000mc.h"
21#include "mt2060.h"
20 22
21/* 23/*
22 * protocol of all dibusb related devices 24 * protocol of all dibusb related devices
@@ -96,6 +98,7 @@
96 98
97struct dibusb_state { 99struct dibusb_state {
98 struct dib_fe_xfer_ops ops; 100 struct dib_fe_xfer_ops ops;
101 int mt2060_present;
99 102
100 /* for RC5 remote control */ 103 /* for RC5 remote control */
101 int old_toggle; 104 int old_toggle;
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c
index c14d9efb48fd..015854487308 100644
--- a/drivers/media/dvb/dvb-usb/digitv.c
+++ b/drivers/media/dvb/dvb-usb/digitv.c
@@ -128,11 +128,11 @@ static struct nxt6000_config digitv_nxt6000_config = {
128 128
129static int digitv_frontend_attach(struct dvb_usb_device *d) 129static int digitv_frontend_attach(struct dvb_usb_device *d)
130{ 130{
131 if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL) { 131 if ((d->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &d->i2c_adap)) != NULL) {
132 d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; 132 d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
133 return 0; 133 return 0;
134 } 134 }
135 if ((d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) { 135 if ((d->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &d->i2c_adap)) != NULL) {
136 d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; 136 d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params;
137 return 0; 137 return 0;
138 } 138 }
@@ -147,21 +147,91 @@ static int digitv_tuner_attach(struct dvb_usb_device *d)
147} 147}
148 148
149static struct dvb_usb_rc_key digitv_rc_keys[] = { 149static struct dvb_usb_rc_key digitv_rc_keys[] = {
150 { 0x00, 0x16, KEY_POWER }, /* dummy key */ 150 { 0x5f, 0x55, KEY_0 },
151 { 0x6f, 0x55, KEY_1 },
152 { 0x9f, 0x55, KEY_2 },
153 { 0xaf, 0x55, KEY_3 },
154 { 0x5f, 0x56, KEY_4 },
155 { 0x6f, 0x56, KEY_5 },
156 { 0x9f, 0x56, KEY_6 },
157 { 0xaf, 0x56, KEY_7 },
158 { 0x5f, 0x59, KEY_8 },
159 { 0x6f, 0x59, KEY_9 },
160 { 0x9f, 0x59, KEY_TV },
161 { 0xaf, 0x59, KEY_AUX },
162 { 0x5f, 0x5a, KEY_DVD },
163 { 0x6f, 0x5a, KEY_POWER },
164 { 0x9f, 0x5a, KEY_MHP }, /* labelled 'Picture' */
165 { 0xaf, 0x5a, KEY_AUDIO },
166 { 0x5f, 0x65, KEY_INFO },
167 { 0x6f, 0x65, KEY_F13 }, /* 16:9 */
168 { 0x9f, 0x65, KEY_F14 }, /* 14:9 */
169 { 0xaf, 0x65, KEY_EPG },
170 { 0x5f, 0x66, KEY_EXIT },
171 { 0x6f, 0x66, KEY_MENU },
172 { 0x9f, 0x66, KEY_UP },
173 { 0xaf, 0x66, KEY_DOWN },
174 { 0x5f, 0x69, KEY_LEFT },
175 { 0x6f, 0x69, KEY_RIGHT },
176 { 0x9f, 0x69, KEY_ENTER },
177 { 0xaf, 0x69, KEY_CHANNELUP },
178 { 0x5f, 0x6a, KEY_CHANNELDOWN },
179 { 0x6f, 0x6a, KEY_VOLUMEUP },
180 { 0x9f, 0x6a, KEY_VOLUMEDOWN },
181 { 0xaf, 0x6a, KEY_RED },
182 { 0x5f, 0x95, KEY_GREEN },
183 { 0x6f, 0x95, KEY_YELLOW },
184 { 0x9f, 0x95, KEY_BLUE },
185 { 0xaf, 0x95, KEY_SUBTITLE },
186 { 0x5f, 0x96, KEY_F15 }, /* AD */
187 { 0x6f, 0x96, KEY_TEXT },
188 { 0x9f, 0x96, KEY_MUTE },
189 { 0xaf, 0x96, KEY_REWIND },
190 { 0x5f, 0x99, KEY_STOP },
191 { 0x6f, 0x99, KEY_PLAY },
192 { 0x9f, 0x99, KEY_FASTFORWARD },
193 { 0xaf, 0x99, KEY_F16 }, /* chapter */
194 { 0x5f, 0x9a, KEY_PAUSE },
195 { 0x6f, 0x9a, KEY_PLAY },
196 { 0x9f, 0x9a, KEY_RECORD },
197 { 0xaf, 0x9a, KEY_F17 }, /* picture in picture */
198 { 0x5f, 0xa5, KEY_KPPLUS }, /* zoom in */
199 { 0x6f, 0xa5, KEY_KPMINUS }, /* zoom out */
200 { 0x9f, 0xa5, KEY_F18 }, /* capture */
201 { 0xaf, 0xa5, KEY_F19 }, /* web */
202 { 0x5f, 0xa6, KEY_EMAIL },
203 { 0x6f, 0xa6, KEY_PHONE },
204 { 0x9f, 0xa6, KEY_PC },
151}; 205};
152 206
153/* TODO is it really the NEC protocol ? */
154static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) 207static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
155{ 208{
209 int i;
156 u8 key[5]; 210 u8 key[5];
211 u8 b[4] = { 0 };
212
213 *event = 0;
214 *state = REMOTE_NO_KEY_PRESSED;
157 215
158 digitv_ctrl_msg(d,USB_READ_REMOTE,0,NULL,0,&key[1],4); 216 digitv_ctrl_msg(d,USB_READ_REMOTE,0,NULL,0,&key[1],4);
159 /* TODO state, maybe it is VV ? */ 217
218 /* Tell the device we've read the remote. Not sure how necessary
219 this is, but the Nebula SDK does it. */
220 digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0);
221
222 /* if something is inside the buffer, simulate key press */
160 if (key[1] != 0) 223 if (key[1] != 0)
161 key[0] = 0x01; /* if something is inside the buffer, simulate key press */ 224 {
225 for (i = 0; i < d->props.rc_key_map_size; i++) {
226 if (d->props.rc_key_map[i].custom == key[1] &&
227 d->props.rc_key_map[i].data == key[2]) {
228 *event = d->props.rc_key_map[i].event;
229 *state = REMOTE_KEY_PRESSED;
230 return 0;
231 }
232 }
233 }
162 234
163 /* call the universal NEC remote processor, to find out the key's state and event */
164 dvb_usb_nec_rc_key_to_event(d,key,event,state);
165 if (key[0] != 0) 235 if (key[0] != 0)
166 deb_rc("key: %x %x %x %x %x\n",key[0],key[1],key[2],key[3],key[4]); 236 deb_rc("key: %x %x %x %x %x\n",key[0],key[1],key[2],key[3],key[4]);
167 return 0; 237 return 0;
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c
index 70afcfd141ca..27af4e436479 100644
--- a/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -93,6 +93,7 @@ static int dtt200u_frontend_attach(struct dvb_usb_device *d)
93} 93}
94 94
95static struct dvb_usb_properties dtt200u_properties; 95static struct dvb_usb_properties dtt200u_properties;
96static struct dvb_usb_properties wt220u_fc_properties;
96static struct dvb_usb_properties wt220u_properties; 97static struct dvb_usb_properties wt220u_properties;
97static struct dvb_usb_properties wt220u_zl0353_properties; 98static struct dvb_usb_properties wt220u_zl0353_properties;
98 99
@@ -101,6 +102,7 @@ static int dtt200u_usb_probe(struct usb_interface *intf,
101{ 102{
102 if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 || 103 if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 ||
103 dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 || 104 dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 ||
105 dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL) == 0 ||
104 dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0) 106 dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0)
105 return 0; 107 return 0;
106 108
@@ -114,6 +116,9 @@ static struct usb_device_id dtt200u_usb_table [] = {
114 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_WARM) }, 116 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_WARM) },
115 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_COLD) }, 117 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_COLD) },
116 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_WARM) }, 118 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_WARM) },
119 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_FC_COLD) },
120 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_FC_WARM) },
121 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZAP250_COLD) },
117 { 0 }, 122 { 0 },
118}; 123};
119MODULE_DEVICE_TABLE(usb, dtt200u_usb_table); 124MODULE_DEVICE_TABLE(usb, dtt200u_usb_table);
@@ -193,13 +198,54 @@ static struct dvb_usb_properties wt220u_properties = {
193 .num_device_descs = 1, 198 .num_device_descs = 1,
194 .devices = { 199 .devices = {
195 { .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)", 200 { .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)",
196 .cold_ids = { &dtt200u_usb_table[2], NULL }, 201 .cold_ids = { &dtt200u_usb_table[2], &dtt200u_usb_table[8], NULL },
197 .warm_ids = { &dtt200u_usb_table[3], NULL }, 202 .warm_ids = { &dtt200u_usb_table[3], NULL },
198 }, 203 },
199 { NULL }, 204 { NULL },
200 } 205 }
201}; 206};
202 207
208static struct dvb_usb_properties wt220u_fc_properties = {
209 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING,
210 .pid_filter_count = 15,
211
212 .usb_ctrl = CYPRESS_FX2,
213 .firmware = "dvb-usb-wt220u-fc03.fw",
214
215 .power_ctrl = dtt200u_power_ctrl,
216 .streaming_ctrl = dtt200u_streaming_ctrl,
217 .pid_filter = dtt200u_pid_filter,
218 .frontend_attach = dtt200u_frontend_attach,
219
220 .rc_interval = 300,
221 .rc_key_map = dtt200u_rc_keys,
222 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
223 .rc_query = dtt200u_rc_query,
224
225 .generic_bulk_ctrl_endpoint = 0x01,
226
227 /* parameter for the MPEG2-data transfer */
228 .urb = {
229 .type = DVB_USB_BULK,
230 .count = 7,
231 .endpoint = 0x86,
232 .u = {
233 .bulk = {
234 .buffersize = 4096,
235 }
236 }
237 },
238
239 .num_device_descs = 1,
240 .devices = {
241 { .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)",
242 .cold_ids = { &dtt200u_usb_table[6], NULL },
243 .warm_ids = { &dtt200u_usb_table[7], NULL },
244 },
245 { NULL },
246 }
247};
248
203static struct dvb_usb_properties wt220u_zl0353_properties = { 249static struct dvb_usb_properties wt220u_zl0353_properties = {
204 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING, 250 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING,
205 .pid_filter_count = 15, 251 .pid_filter_count = 15,
@@ -271,6 +317,6 @@ module_init(dtt200u_usb_module_init);
271module_exit(dtt200u_usb_module_exit); 317module_exit(dtt200u_usb_module_exit);
272 318
273MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 319MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
274MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon DVB-T USB2.0 devices"); 320MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon/Club3D DVB-T USB2.0 devices");
275MODULE_VERSION("1.0"); 321MODULE_VERSION("1.0");
276MODULE_LICENSE("GPL"); 322MODULE_LICENSE("GPL");
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
index ec631708c394..fe6208ada903 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
@@ -175,36 +175,36 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe)
175int dvb_usb_fe_init(struct dvb_usb_device* d) 175int dvb_usb_fe_init(struct dvb_usb_device* d)
176{ 176{
177 if (d->props.frontend_attach == NULL) { 177 if (d->props.frontend_attach == NULL) {
178 err("strange '%s' doesn't want to attach a frontend.",d->desc->name); 178 err("strange: '%s' doesn't want to attach a frontend.",d->desc->name);
179 return 0; 179 return 0;
180 } 180 }
181 181
182 d->props.frontend_attach(d);
183
184 /* re-assign sleep and wakeup functions */ 182 /* re-assign sleep and wakeup functions */
185 if (d->fe != NULL) { 183 if (d->props.frontend_attach(d) == 0 && d->fe != NULL) {
186 d->fe_init = d->fe->ops.init; d->fe->ops.init = dvb_usb_fe_wakeup; 184 d->fe_init = d->fe->ops.init; d->fe->ops.init = dvb_usb_fe_wakeup;
187 d->fe_sleep = d->fe->ops.sleep; d->fe->ops.sleep = dvb_usb_fe_sleep; 185 d->fe_sleep = d->fe->ops.sleep; d->fe->ops.sleep = dvb_usb_fe_sleep;
188 186
189 if (dvb_register_frontend(&d->dvb_adap, d->fe)) { 187 if (dvb_register_frontend(&d->dvb_adap, d->fe)) {
190 err("Frontend registration failed."); 188 err("Frontend registration failed.");
191 if (d->fe->ops.release) 189 dvb_frontend_detach(d->fe);
192 d->fe->ops.release(d->fe);
193 d->fe = NULL; 190 d->fe = NULL;
194 return -ENODEV; 191 return -ENODEV;
195 } 192 }
193
194 /* only attach the tuner if the demod is there */
195 if (d->props.tuner_attach != NULL)
196 d->props.tuner_attach(d);
196 } else 197 } else
197 err("no frontend was attached by '%s'",d->desc->name); 198 err("no frontend was attached by '%s'",d->desc->name);
198 199
199 if (d->props.tuner_attach != NULL)
200 d->props.tuner_attach(d);
201
202 return 0; 200 return 0;
203} 201}
204 202
205int dvb_usb_fe_exit(struct dvb_usb_device *d) 203int dvb_usb_fe_exit(struct dvb_usb_device *d)
206{ 204{
207 if (d->fe != NULL) 205 if (d->fe != NULL) {
208 dvb_unregister_frontend(d->fe); 206 dvb_unregister_frontend(d->fe);
207 dvb_frontend_detach(d->fe);
208 }
209 return 0; 209 return 0;
210} 210}
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 95698918bc11..57a10de1d3dd 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -10,51 +10,53 @@
10#define _DVB_USB_IDS_H_ 10#define _DVB_USB_IDS_H_
11 11
12/* Vendor IDs */ 12/* Vendor IDs */
13#define USB_VID_ADSTECH 0x06e1 13#define USB_VID_ADSTECH 0x06e1
14#define USB_VID_ANCHOR 0x0547 14#define USB_VID_ANCHOR 0x0547
15#define USB_VID_WIDEVIEW 0x14aa 15#define USB_VID_AVERMEDIA 0x07ca
16#define USB_VID_AVERMEDIA 0x07ca 16#define USB_VID_COMPRO 0x185b
17#define USB_VID_COMPRO 0x185b 17#define USB_VID_COMPRO_UNK 0x145f
18#define USB_VID_COMPRO_UNK 0x145f 18#define USB_VID_CYPRESS 0x04b4
19#define USB_VID_CYPRESS 0x04b4 19#define USB_VID_DIBCOM 0x10b8
20#define USB_VID_DIBCOM 0x10b8 20#define USB_VID_DVICO 0x0fe9
21#define USB_VID_DVICO 0x0fe9 21#define USB_VID_EMPIA 0xeb1a
22#define USB_VID_EMPIA 0xeb1a 22#define USB_VID_GENPIX 0x09c0
23#define USB_VID_GRANDTEC 0x5032 23#define USB_VID_GRANDTEC 0x5032
24#define USB_VID_HANFTEK 0x15f4 24#define USB_VID_HANFTEK 0x15f4
25#define USB_VID_HAUPPAUGE 0x2040 25#define USB_VID_HAUPPAUGE 0x2040
26#define USB_VID_HYPER_PALTEK 0x1025 26#define USB_VID_HYPER_PALTEK 0x1025
27#define USB_VID_KWORLD 0xeb2a 27#define USB_VID_KWORLD 0xeb2a
28#define USB_VID_KYE 0x0458 28#define USB_VID_KYE 0x0458
29#define USB_VID_MEDION 0x1660 29#define USB_VID_LEADTEK 0x0413
30#define USB_VID_PINNACLE 0x2304 30#define USB_VID_LITEON 0x04ca
31#define USB_VID_VISIONPLUS 0x13d3 31#define USB_VID_MEDION 0x1660
32#define USB_VID_TWINHAN 0x1822 32#define USB_VID_PINNACLE 0x2304
33#define USB_VID_ULTIMA_ELECTRONIC 0x05d8 33#define USB_VID_VISIONPLUS 0x13d3
34#define USB_VID_GENPIX 0x09c0 34#define USB_VID_TWINHAN 0x1822
35#define USB_VID_ULTIMA_ELECTRONIC 0x05d8
36#define USB_VID_WIDEVIEW 0x14aa
35 37
36/* Product IDs */ 38/* Product IDs */
37#define USB_PID_ADSTECH_USB2_COLD 0xa333 39#define USB_PID_ADSTECH_USB2_COLD 0xa333
38#define USB_PID_ADSTECH_USB2_WARM 0xa334 40#define USB_PID_ADSTECH_USB2_WARM 0xa334
39#define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001 41#define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001
40#define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002 42#define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002
41#define USB_PID_AVERMEDIA_DVBT_USB2_COLD 0xa800 43#define USB_PID_AVERMEDIA_DVBT_USB2_COLD 0xa800
42#define USB_PID_AVERMEDIA_DVBT_USB2_WARM 0xa801 44#define USB_PID_AVERMEDIA_DVBT_USB2_WARM 0xa801
43#define USB_PID_COMPRO_DVBU2000_COLD 0xd000 45#define USB_PID_COMPRO_DVBU2000_COLD 0xd000
44#define USB_PID_COMPRO_DVBU2000_WARM 0xd001 46#define USB_PID_COMPRO_DVBU2000_WARM 0xd001
45#define USB_PID_COMPRO_DVBU2000_UNK_COLD 0x010c 47#define USB_PID_COMPRO_DVBU2000_UNK_COLD 0x010c
46#define USB_PID_COMPRO_DVBU2000_UNK_WARM 0x010d 48#define USB_PID_COMPRO_DVBU2000_UNK_WARM 0x010d
47#define USB_PID_DIBCOM_HOOK_DEFAULT 0x0064 49#define USB_PID_DIBCOM_HOOK_DEFAULT 0x0064
48#define USB_PID_DIBCOM_HOOK_DEFAULT_REENUM 0x0065 50#define USB_PID_DIBCOM_HOOK_DEFAULT_REENUM 0x0065
49#define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8 51#define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8
50#define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9 52#define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9
51#define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6 53#define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6
52#define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7 54#define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7
53#define USB_PID_DIBCOM_STK7700 0x1e14 55#define USB_PID_DIBCOM_STK7700 0x1e14
54#define USB_PID_DIBCOM_STK7700_REENUM 0x1e15 56#define USB_PID_DIBCOM_STK7700_REENUM 0x1e15
55#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 57#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131
56#define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 58#define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0
57#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 59#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1
58#define USB_PID_KWORLD_VSTREAM_COLD 0x17de 60#define USB_PID_KWORLD_VSTREAM_COLD 0x17de
59#define USB_PID_KWORLD_VSTREAM_WARM 0x17df 61#define USB_PID_KWORLD_VSTREAM_WARM 0x17df
60#define USB_PID_TWINHAN_VP7041_COLD 0x3201 62#define USB_PID_TWINHAN_VP7041_COLD 0x3201
@@ -69,25 +71,30 @@
69#define USB_PID_DNTV_TINYUSB2_WARM 0x3224 71#define USB_PID_DNTV_TINYUSB2_WARM 0x3224
70#define USB_PID_ULTIMA_TVBOX_COLD 0x8105 72#define USB_PID_ULTIMA_TVBOX_COLD 0x8105
71#define USB_PID_ULTIMA_TVBOX_WARM 0x8106 73#define USB_PID_ULTIMA_TVBOX_WARM 0x8106
72#define USB_PID_ULTIMA_TVBOX_AN2235_COLD 0x8107 74#define USB_PID_ULTIMA_TVBOX_AN2235_COLD 0x8107
73#define USB_PID_ULTIMA_TVBOX_AN2235_WARM 0x8108 75#define USB_PID_ULTIMA_TVBOX_AN2235_WARM 0x8108
74#define USB_PID_ULTIMA_TVBOX_ANCHOR_COLD 0x2235 76#define USB_PID_ULTIMA_TVBOX_ANCHOR_COLD 0x2235
75#define USB_PID_ULTIMA_TVBOX_USB2_COLD 0x8109 77#define USB_PID_ULTIMA_TVBOX_USB2_COLD 0x8109
76#define USB_PID_ULTIMA_TVBOX_USB2_WARM 0x810a 78#define USB_PID_ULTIMA_TVBOX_USB2_WARM 0x810a
77#define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613 79#define USB_PID_ARTEC_T14_COLD 0x810b
78#define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002 80#define USB_PID_ARTEC_T14_WARM 0x810c
79#define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e 81#define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613
80#define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f 82#define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002
81#define USB_PID_HANFTEK_UMT_010_COLD 0x0001 83#define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e
82#define USB_PID_HANFTEK_UMT_010_WARM 0x0015 84#define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f
85#define USB_PID_HANFTEK_UMT_010_COLD 0x0001
86#define USB_PID_HANFTEK_UMT_010_WARM 0x0015
83#define USB_PID_DTT200U_COLD 0x0201 87#define USB_PID_DTT200U_COLD 0x0201
84#define USB_PID_DTT200U_WARM 0x0301 88#define USB_PID_DTT200U_WARM 0x0301
85#define USB_PID_WT220U_COLD 0x0222 89#define USB_PID_WT220U_ZAP250_COLD 0x0220
86#define USB_PID_WT220U_WARM 0x0221 90#define USB_PID_WT220U_COLD 0x0222
91#define USB_PID_WT220U_WARM 0x0221
92#define USB_PID_WT220U_FC_COLD 0x0225
93#define USB_PID_WT220U_FC_WARM 0x0226
87#define USB_PID_WT220U_ZL0353_COLD 0x022a 94#define USB_PID_WT220U_ZL0353_COLD 0x022a
88#define USB_PID_WT220U_ZL0353_WARM 0x022b 95#define USB_PID_WT220U_ZL0353_WARM 0x022b
89#define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 96#define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300
90#define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 97#define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301
91#define USB_PID_NEBULA_DIGITV 0x0201 98#define USB_PID_NEBULA_DIGITV 0x0201
92#define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 99#define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820
93#define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 100#define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500
@@ -103,8 +110,17 @@
103#define USB_PID_MEDION_MD95700 0x0932 110#define USB_PID_MEDION_MD95700 0x0932
104#define USB_PID_KYE_DVB_T_COLD 0x701e 111#define USB_PID_KYE_DVB_T_COLD 0x701e
105#define USB_PID_KYE_DVB_T_WARM 0x701f 112#define USB_PID_KYE_DVB_T_WARM 0x701f
106#define USB_PID_PCTV_200E 0x020e 113#define USB_PID_PCTV_200E 0x020e
107#define USB_PID_PCTV_400E 0x020f 114#define USB_PID_PCTV_400E 0x020f
108#define USB_PID_GENPIX_8PSK_COLD 0x0200 115#define USB_PID_LITEON_DVB_T_COLD 0xf000
109#define USB_PID_GENPIX_8PSK_WARM 0x0201 116#define USB_PID_LITEON_DVB_T_WARM 0xf001
117#define USB_PID_DIGIVOX_MINI_SL_COLD 0xe360
118#define USB_PID_DIGIVOX_MINI_SL_WARM 0xe361
119#define USB_PID_GRANDTEC_DVBT_USB2_COLD 0x0bc6
120#define USB_PID_GRANDTEC_DVBT_USB2_WARM 0x0bc7
121#define USB_PID_WINFAST_DTV_DONGLE_COLD 0x6025
122#define USB_PID_WINFAST_DTV_DONGLE_WARM 0x6026
123#define USB_PID_GENPIX_8PSK_COLD 0x0200
124#define USB_PID_GENPIX_8PSK_WARM 0x0201
125
110#endif 126#endif
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
index e5c6d9835e06..380b2a45ee4c 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
@@ -6,6 +6,7 @@
6 * This file contains functions for initializing the the input-device and for handling remote-control-queries. 6 * This file contains functions for initializing the the input-device and for handling remote-control-queries.
7 */ 7 */
8#include "dvb-usb-common.h" 8#include "dvb-usb-common.h"
9#include <linux/usb/input.h>
9 10
10/* Remote-control poll function - called every dib->rc_query_interval ms to see 11/* Remote-control poll function - called every dib->rc_query_interval ms to see
11 * whether the remote control has received anything. 12 * whether the remote control has received anything.
@@ -96,7 +97,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
96 return 0; 97 return 0;
97 98
98 usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys)); 99 usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
99 strlcpy(d->rc_phys, "/ir0", sizeof(d->rc_phys)); 100 strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys));
100 101
101 d->rc_input_dev = input_allocate_device(); 102 d->rc_input_dev = input_allocate_device();
102 if (!d->rc_input_dev) 103 if (!d->rc_input_dev)
@@ -107,6 +108,8 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
107 d->rc_input_dev->keycodemax = KEY_MAX; 108 d->rc_input_dev->keycodemax = KEY_MAX;
108 d->rc_input_dev->name = "IR-receiver inside an USB DVB receiver"; 109 d->rc_input_dev->name = "IR-receiver inside an USB DVB receiver";
109 d->rc_input_dev->phys = d->rc_phys; 110 d->rc_input_dev->phys = d->rc_phys;
111 usb_to_input_id(d->udev, &d->rc_input_dev->id);
112 d->rc_input_dev->cdev.dev = &d->udev->dev;
110 113
111 /* set the bits for the keys */ 114 /* set the bits for the keys */
112 deb_rc("key map size: %d\n", d->props.rc_key_map_size); 115 deb_rc("key map size: %d\n", d->props.rc_key_map_size);
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
index 412039d8dbae..79f0a02ce987 100644
--- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c
+++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
@@ -156,7 +156,7 @@ static struct dvb_usb_properties nova_t_properties = {
156 .pid_filter_count = 32, 156 .pid_filter_count = 32,
157 157
158 .usb_ctrl = CYPRESS_FX2, 158 .usb_ctrl = CYPRESS_FX2,
159 .firmware = "dvb-usb-nova-t-usb2-01.fw", 159 .firmware = "dvb-usb-nova-t-usb2-02.fw",
160 160
161 .size_of_priv = sizeof(struct dibusb_state), 161 .size_of_priv = sizeof(struct dibusb_state),
162 162
diff --git a/drivers/media/dvb/dvb-usb/umt-010.c b/drivers/media/dvb/dvb-usb/umt-010.c
index 97d74da0dad8..418a0b707151 100644
--- a/drivers/media/dvb/dvb-usb/umt-010.c
+++ b/drivers/media/dvb/dvb-usb/umt-010.c
@@ -58,7 +58,7 @@ static int umt_mt352_frontend_attach(struct dvb_usb_device *d)
58 umt_config.demod_init = umt_mt352_demod_init; 58 umt_config.demod_init = umt_mt352_demod_init;
59 umt_config.demod_address = 0xf; 59 umt_config.demod_address = 0xf;
60 60
61 d->fe = mt352_attach(&umt_config, &d->i2c_adap); 61 d->fe = dvb_attach(mt352_attach, &umt_config, &d->i2c_adap);
62 62
63 return 0; 63 return 0;
64} 64}