aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/cxusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/cxusb.c')
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c152
1 files changed, 150 insertions, 2 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 358ed153865f..18d169836c9c 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -253,6 +253,26 @@ static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
253 return 0; 253 return 0;
254} 254}
255 255
256static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
257{ /* used in both lgz201 and th7579 */
258 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
259 static u8 reset [] = { RESET, 0x80 };
260 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
261 static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
262 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
263 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
264
265 mt352_write(fe, clock_config, sizeof(clock_config));
266 udelay(200);
267 mt352_write(fe, reset, sizeof(reset));
268 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
269
270 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
271 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
272 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
273 return 0;
274}
275
256struct cx22702_config cxusb_cx22702_config = { 276struct cx22702_config cxusb_cx22702_config = {
257 .demod_address = 0x63, 277 .demod_address = 0x63,
258 278
@@ -274,6 +294,13 @@ struct mt352_config cxusb_dee1601_config = {
274 .pll_set = dvb_usb_pll_set, 294 .pll_set = dvb_usb_pll_set,
275}; 295};
276 296
297struct mt352_config cxusb_mt352_config = {
298 /* used in both lgz201 and th7579 */
299 .demod_address = 0x0f,
300 .demod_init = cxusb_mt352_demod_init,
301 .pll_set = dvb_usb_pll_set,
302};
303
277/* Callbacks for DVB USB */ 304/* Callbacks for DVB USB */
278static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) 305static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d)
279{ 306{
@@ -302,6 +329,20 @@ static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d)
302 return 0; 329 return 0;
303} 330}
304 331
332static int cxusb_lgz201_tuner_attach(struct dvb_usb_device *d)
333{
334 d->pll_addr = 0x61;
335 d->pll_desc = &dvb_pll_lg_z201;
336 return 0;
337}
338
339static int cxusb_dtt7579_tuner_attach(struct dvb_usb_device *d)
340{
341 d->pll_addr = 0x60;
342 d->pll_desc = &dvb_pll_thomson_dtt7579;
343 return 0;
344}
345
305static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) 346static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
306{ 347{
307 u8 b; 348 u8 b;
@@ -329,6 +370,19 @@ static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d)
329 return -EIO; 370 return -EIO;
330} 371}
331 372
373static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d)
374{ /* used in both lgz201 and th7579 */
375 if (usb_set_interface(d->udev,0,0) < 0)
376 err("set interface failed");
377
378 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
379
380 if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL)
381 return 0;
382
383 return -EIO;
384}
385
332static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d) 386static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
333{ 387{
334 if (usb_set_interface(d->udev,0,0) < 0) 388 if (usb_set_interface(d->udev,0,0) < 0)
@@ -370,13 +424,17 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, const
370static struct dvb_usb_properties cxusb_medion_properties; 424static struct dvb_usb_properties cxusb_medion_properties;
371static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties; 425static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties;
372static struct dvb_usb_properties cxusb_bluebird_dee1601_properties; 426static struct dvb_usb_properties cxusb_bluebird_dee1601_properties;
427static struct dvb_usb_properties cxusb_bluebird_lgz201_properties;
428static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties;
373 429
374static int cxusb_probe(struct usb_interface *intf, 430static int cxusb_probe(struct usb_interface *intf,
375 const struct usb_device_id *id) 431 const struct usb_device_id *id)
376{ 432{
377 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || 433 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
378 dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 || 434 dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
379 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0) { 435 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
436 dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
437 dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0) {
380 return 0; 438 return 0;
381 } 439 }
382 440
@@ -389,6 +447,12 @@ static struct usb_device_id cxusb_table [] = {
389 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) }, 447 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
390 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) }, 448 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) },
391 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) }, 449 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) },
450 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) },
451 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) },
452 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) },
453 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) },
454 { USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_COLD) },
455 { USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_WARM) },
392 {} /* Terminating entry */ 456 {} /* Terminating entry */
393}; 457};
394MODULE_DEVICE_TABLE (usb, cxusb_table); 458MODULE_DEVICE_TABLE (usb, cxusb_table);
@@ -505,12 +569,96 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
505 } 569 }
506 }, 570 },
507 571
508 .num_device_descs = 1, 572 .num_device_descs = 2,
509 .devices = { 573 .devices = {
510 { "DViCO FusionHDTV DVB-T Dual USB", 574 { "DViCO FusionHDTV DVB-T Dual USB",
511 { &cxusb_table[3], NULL }, 575 { &cxusb_table[3], NULL },
512 { &cxusb_table[4], NULL }, 576 { &cxusb_table[4], NULL },
513 }, 577 },
578 { "DigitalNow DVB-T Dual USB",
579 { &cxusb_table[9], NULL },
580 { &cxusb_table[10], NULL },
581 },
582 }
583};
584
585static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = {
586 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
587
588 .usb_ctrl = DEVICE_SPECIFIC,
589 .firmware = "dvb-usb-bluebird-01.fw",
590 .download_firmware = bluebird_patch_dvico_firmware_download,
591 /* use usb alt setting 0 for EP4 transfer (dvb-t),
592 use usb alt setting 7 for EP2 transfer (atsc) */
593
594 .size_of_priv = sizeof(struct cxusb_state),
595
596 .streaming_ctrl = cxusb_streaming_ctrl,
597 .power_ctrl = cxusb_power_ctrl,
598 .frontend_attach = cxusb_mt352_frontend_attach,
599 .tuner_attach = cxusb_lgz201_tuner_attach,
600
601 .i2c_algo = &cxusb_i2c_algo,
602
603 .generic_bulk_ctrl_endpoint = 0x01,
604 /* parameter for the MPEG2-data transfer */
605 .urb = {
606 .type = DVB_USB_BULK,
607 .count = 5,
608 .endpoint = 0x04,
609 .u = {
610 .bulk = {
611 .buffersize = 8192,
612 }
613 }
614 },
615
616 .num_device_descs = 1,
617 .devices = {
618 { "DViCO FusionHDTV DVB-T USB (LGZ201)",
619 { &cxusb_table[5], NULL },
620 { &cxusb_table[6], NULL },
621 },
622 }
623};
624
625static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = {
626 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
627
628 .usb_ctrl = DEVICE_SPECIFIC,
629 .firmware = "dvb-usb-bluebird-01.fw",
630 .download_firmware = bluebird_patch_dvico_firmware_download,
631 /* use usb alt setting 0 for EP4 transfer (dvb-t),
632 use usb alt setting 7 for EP2 transfer (atsc) */
633
634 .size_of_priv = sizeof(struct cxusb_state),
635
636 .streaming_ctrl = cxusb_streaming_ctrl,
637 .power_ctrl = cxusb_power_ctrl,
638 .frontend_attach = cxusb_mt352_frontend_attach,
639 .tuner_attach = cxusb_dtt7579_tuner_attach,
640
641 .i2c_algo = &cxusb_i2c_algo,
642
643 .generic_bulk_ctrl_endpoint = 0x01,
644 /* parameter for the MPEG2-data transfer */
645 .urb = {
646 .type = DVB_USB_BULK,
647 .count = 5,
648 .endpoint = 0x04,
649 .u = {
650 .bulk = {
651 .buffersize = 8192,
652 }
653 }
654 },
655
656 .num_device_descs = 1,
657 .devices = {
658 { "DViCO FusionHDTV DVB-T USB (TH7579)",
659 { &cxusb_table[7], NULL },
660 { &cxusb_table[8], NULL },
661 },
514 } 662 }
515}; 663};
516 664