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/cxusb.c144
1 files changed, 143 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 358ed153865f..228aa4237334 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,10 @@ 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) },
392 {} /* Terminating entry */ 454 {} /* Terminating entry */
393}; 455};
394MODULE_DEVICE_TABLE (usb, cxusb_table); 456MODULE_DEVICE_TABLE (usb, cxusb_table);
@@ -514,6 +576,86 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
514 } 576 }
515}; 577};
516 578
579static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = {
580 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
581
582 .usb_ctrl = DEVICE_SPECIFIC,
583 .firmware = "dvb-usb-bluebird-01.fw",
584 .download_firmware = bluebird_patch_dvico_firmware_download,
585 /* use usb alt setting 0 for EP4 transfer (dvb-t),
586 use usb alt setting 7 for EP2 transfer (atsc) */
587
588 .size_of_priv = sizeof(struct cxusb_state),
589
590 .streaming_ctrl = cxusb_streaming_ctrl,
591 .power_ctrl = cxusb_power_ctrl,
592 .frontend_attach = cxusb_mt352_frontend_attach,
593 .tuner_attach = cxusb_lgz201_tuner_attach,
594
595 .i2c_algo = &cxusb_i2c_algo,
596
597 .generic_bulk_ctrl_endpoint = 0x01,
598 /* parameter for the MPEG2-data transfer */
599 .urb = {
600 .type = DVB_USB_BULK,
601 .count = 5,
602 .endpoint = 0x04,
603 .u = {
604 .bulk = {
605 .buffersize = 8192,
606 }
607 }
608 },
609
610 .num_device_descs = 1,
611 .devices = {
612 { "DViCO FusionHDTV DVB-T USB (LGZ201)",
613 { &cxusb_table[5], NULL },
614 { &cxusb_table[6], NULL },
615 },
616 }
617};
618
619static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = {
620 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
621
622 .usb_ctrl = DEVICE_SPECIFIC,
623 .firmware = "dvb-usb-bluebird-01.fw",
624 .download_firmware = bluebird_patch_dvico_firmware_download,
625 /* use usb alt setting 0 for EP4 transfer (dvb-t),
626 use usb alt setting 7 for EP2 transfer (atsc) */
627
628 .size_of_priv = sizeof(struct cxusb_state),
629
630 .streaming_ctrl = cxusb_streaming_ctrl,
631 .power_ctrl = cxusb_power_ctrl,
632 .frontend_attach = cxusb_mt352_frontend_attach,
633 .tuner_attach = cxusb_dtt7579_tuner_attach,
634
635 .i2c_algo = &cxusb_i2c_algo,
636
637 .generic_bulk_ctrl_endpoint = 0x01,
638 /* parameter for the MPEG2-data transfer */
639 .urb = {
640 .type = DVB_USB_BULK,
641 .count = 5,
642 .endpoint = 0x04,
643 .u = {
644 .bulk = {
645 .buffersize = 8192,
646 }
647 }
648 },
649
650 .num_device_descs = 1,
651 .devices = {
652 { "DViCO FusionHDTV DVB-T USB (TH7579)",
653 { &cxusb_table[7], NULL },
654 { &cxusb_table[8], NULL },
655 },
656 }
657};
658
517static struct usb_driver cxusb_driver = { 659static struct usb_driver cxusb_driver = {
518 .name = "dvb_usb_cxusb", 660 .name = "dvb_usb_cxusb",
519 .probe = cxusb_probe, 661 .probe = cxusb_probe,