V4L/DVB (3343): Add support for DViCO FusionHDTV DVB-T USB devices


- Add support for DViCO FusionHDTV DVB-T USB devices
(Thomson dtt7579 and LG z201 based)

Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by Michael Krufky and committed by Mauro Carvalho Chehab 6f447259 ca08ca01

+143 -1
+143 -1
drivers/media/dvb/dvb-usb/cxusb.c
··· 253 253 return 0; 254 254 } 255 255 256 + static 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 + 256 276 struct cx22702_config cxusb_cx22702_config = { 257 277 .demod_address = 0x63, 258 278 ··· 291 271 struct mt352_config cxusb_dee1601_config = { 292 272 .demod_address = 0x0f, 293 273 .demod_init = cxusb_dee1601_demod_init, 274 + .pll_set = dvb_usb_pll_set, 275 + }; 276 + 277 + struct mt352_config cxusb_mt352_config = { 278 + /* used in both lgz201 and th7579 */ 279 + .demod_address = 0x0f, 280 + .demod_init = cxusb_mt352_demod_init, 294 281 .pll_set = dvb_usb_pll_set, 295 282 }; 296 283 ··· 329 302 return 0; 330 303 } 331 304 305 + static int cxusb_lgz201_tuner_attach(struct dvb_usb_device *d) 306 + { 307 + d->pll_addr = 0x61; 308 + d->pll_desc = &dvb_pll_lg_z201; 309 + return 0; 310 + } 311 + 312 + static int cxusb_dtt7579_tuner_attach(struct dvb_usb_device *d) 313 + { 314 + d->pll_addr = 0x60; 315 + d->pll_desc = &dvb_pll_thomson_dtt7579; 316 + return 0; 317 + } 318 + 332 319 static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) 333 320 { 334 321 u8 b; ··· 365 324 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 366 325 367 326 if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL) 327 + return 0; 328 + 329 + return -EIO; 330 + } 331 + 332 + static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d) 333 + { /* used in both lgz201 and th7579 */ 334 + if (usb_set_interface(d->udev,0,0) < 0) 335 + err("set interface failed"); 336 + 337 + cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 338 + 339 + if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL) 368 340 return 0; 369 341 370 342 return -EIO; ··· 424 370 static struct dvb_usb_properties cxusb_medion_properties; 425 371 static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties; 426 372 static struct dvb_usb_properties cxusb_bluebird_dee1601_properties; 373 + static struct dvb_usb_properties cxusb_bluebird_lgz201_properties; 374 + static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties; 427 375 428 376 static int cxusb_probe(struct usb_interface *intf, 429 377 const struct usb_device_id *id) 430 378 { 431 379 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || 432 380 dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 || 433 - dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0) { 381 + dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 || 382 + dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 || 383 + dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0) { 434 384 return 0; 435 385 } 436 386 ··· 447 389 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) }, 448 390 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) }, 449 391 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) }, 392 + { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) }, 393 + { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) }, 394 + { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) }, 395 + { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) }, 450 396 {} /* Terminating entry */ 451 397 }; 452 398 MODULE_DEVICE_TABLE (usb, cxusb_table); ··· 572 510 { "DViCO FusionHDTV DVB-T Dual USB", 573 511 { &cxusb_table[3], NULL }, 574 512 { &cxusb_table[4], NULL }, 513 + }, 514 + } 515 + }; 516 + 517 + static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = { 518 + .caps = DVB_USB_IS_AN_I2C_ADAPTER, 519 + 520 + .usb_ctrl = DEVICE_SPECIFIC, 521 + .firmware = "dvb-usb-bluebird-01.fw", 522 + .download_firmware = bluebird_patch_dvico_firmware_download, 523 + /* use usb alt setting 0 for EP4 transfer (dvb-t), 524 + use usb alt setting 7 for EP2 transfer (atsc) */ 525 + 526 + .size_of_priv = sizeof(struct cxusb_state), 527 + 528 + .streaming_ctrl = cxusb_streaming_ctrl, 529 + .power_ctrl = cxusb_power_ctrl, 530 + .frontend_attach = cxusb_mt352_frontend_attach, 531 + .tuner_attach = cxusb_lgz201_tuner_attach, 532 + 533 + .i2c_algo = &cxusb_i2c_algo, 534 + 535 + .generic_bulk_ctrl_endpoint = 0x01, 536 + /* parameter for the MPEG2-data transfer */ 537 + .urb = { 538 + .type = DVB_USB_BULK, 539 + .count = 5, 540 + .endpoint = 0x04, 541 + .u = { 542 + .bulk = { 543 + .buffersize = 8192, 544 + } 545 + } 546 + }, 547 + 548 + .num_device_descs = 1, 549 + .devices = { 550 + { "DViCO FusionHDTV DVB-T USB (LGZ201)", 551 + { &cxusb_table[5], NULL }, 552 + { &cxusb_table[6], NULL }, 553 + }, 554 + } 555 + }; 556 + 557 + static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = { 558 + .caps = DVB_USB_IS_AN_I2C_ADAPTER, 559 + 560 + .usb_ctrl = DEVICE_SPECIFIC, 561 + .firmware = "dvb-usb-bluebird-01.fw", 562 + .download_firmware = bluebird_patch_dvico_firmware_download, 563 + /* use usb alt setting 0 for EP4 transfer (dvb-t), 564 + use usb alt setting 7 for EP2 transfer (atsc) */ 565 + 566 + .size_of_priv = sizeof(struct cxusb_state), 567 + 568 + .streaming_ctrl = cxusb_streaming_ctrl, 569 + .power_ctrl = cxusb_power_ctrl, 570 + .frontend_attach = cxusb_mt352_frontend_attach, 571 + .tuner_attach = cxusb_dtt7579_tuner_attach, 572 + 573 + .i2c_algo = &cxusb_i2c_algo, 574 + 575 + .generic_bulk_ctrl_endpoint = 0x01, 576 + /* parameter for the MPEG2-data transfer */ 577 + .urb = { 578 + .type = DVB_USB_BULK, 579 + .count = 5, 580 + .endpoint = 0x04, 581 + .u = { 582 + .bulk = { 583 + .buffersize = 8192, 584 + } 585 + } 586 + }, 587 + 588 + .num_device_descs = 1, 589 + .devices = { 590 + { "DViCO FusionHDTV DVB-T USB (TH7579)", 591 + { &cxusb_table[7], NULL }, 592 + { &cxusb_table[8], NULL }, 575 593 }, 576 594 } 577 595 };