diff options
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-dvb.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-dvb.c | 95 |
1 files changed, 90 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c index 16410ac20092..a16531fa937a 100644 --- a/drivers/media/video/em28xx/em28xx-dvb.c +++ b/drivers/media/video/em28xx/em28xx-dvb.c | |||
@@ -310,31 +310,47 @@ static struct drxd_config em28xx_drxd = { | |||
310 | .disable_i2c_gate_ctrl = 1, | 310 | .disable_i2c_gate_ctrl = 1, |
311 | }; | 311 | }; |
312 | 312 | ||
313 | struct drxk_config terratec_h5_drxk = { | 313 | static struct drxk_config terratec_h5_drxk = { |
314 | .adr = 0x29, | 314 | .adr = 0x29, |
315 | .single_master = 1, | 315 | .single_master = 1, |
316 | .no_i2c_bridge = 1, | 316 | .no_i2c_bridge = 1, |
317 | .microcode_name = "dvb-usb-terratec-h5-drxk.fw", | 317 | .microcode_name = "dvb-usb-terratec-h5-drxk.fw", |
318 | .qam_demod_parameter_count = 2, | ||
318 | }; | 319 | }; |
319 | 320 | ||
320 | struct drxk_config hauppauge_930c_drxk = { | 321 | static struct drxk_config hauppauge_930c_drxk = { |
321 | .adr = 0x29, | 322 | .adr = 0x29, |
322 | .single_master = 1, | 323 | .single_master = 1, |
323 | .no_i2c_bridge = 1, | 324 | .no_i2c_bridge = 1, |
324 | .microcode_name = "dvb-usb-hauppauge-hvr930c-drxk.fw", | 325 | .microcode_name = "dvb-usb-hauppauge-hvr930c-drxk.fw", |
325 | .chunk_size = 56, | 326 | .chunk_size = 56, |
327 | .qam_demod_parameter_count = 2, | ||
326 | }; | 328 | }; |
327 | 329 | ||
328 | struct drxk_config maxmedia_ub425_tc_drxk = { | 330 | struct drxk_config terratec_htc_stick_drxk = { |
329 | .adr = 0x29, | 331 | .adr = 0x29, |
330 | .single_master = 1, | 332 | .single_master = 1, |
331 | .no_i2c_bridge = 1, | 333 | .no_i2c_bridge = 1, |
334 | .microcode_name = "dvb-usb-terratec-htc-stick-drxk.fw", | ||
335 | .chunk_size = 54, | ||
336 | .qam_demod_parameter_count = 2, | ||
337 | /* Required for the antenna_gpio to disable LNA. */ | ||
338 | .antenna_dvbt = true, | ||
339 | /* The windows driver uses the same. This will disable LNA. */ | ||
340 | .antenna_gpio = 0x6, | ||
332 | }; | 341 | }; |
333 | 342 | ||
334 | struct drxk_config pctv_520e_drxk = { | 343 | static struct drxk_config maxmedia_ub425_tc_drxk = { |
344 | .adr = 0x29, | ||
345 | .single_master = 1, | ||
346 | .no_i2c_bridge = 1, | ||
347 | }; | ||
348 | |||
349 | static struct drxk_config pctv_520e_drxk = { | ||
335 | .adr = 0x29, | 350 | .adr = 0x29, |
336 | .single_master = 1, | 351 | .single_master = 1, |
337 | .microcode_name = "dvb-demod-drxk-pctv.fw", | 352 | .microcode_name = "dvb-demod-drxk-pctv.fw", |
353 | .qam_demod_parameter_count = 2, | ||
338 | .chunk_size = 58, | 354 | .chunk_size = 58, |
339 | .antenna_dvbt = true, /* disable LNA */ | 355 | .antenna_dvbt = true, /* disable LNA */ |
340 | .antenna_gpio = (1 << 2), /* disable LNA */ | 356 | .antenna_gpio = (1 << 2), /* disable LNA */ |
@@ -473,6 +489,57 @@ static void terratec_h5_init(struct em28xx *dev) | |||
473 | em28xx_gpio_set(dev, terratec_h5_end); | 489 | em28xx_gpio_set(dev, terratec_h5_end); |
474 | }; | 490 | }; |
475 | 491 | ||
492 | static void terratec_htc_stick_init(struct em28xx *dev) | ||
493 | { | ||
494 | int i; | ||
495 | |||
496 | /* | ||
497 | * GPIO configuration: | ||
498 | * 0xff: unknown (does not affect DVB-T). | ||
499 | * 0xf6: DRX-K (demodulator). | ||
500 | * 0xe6: unknown (does not affect DVB-T). | ||
501 | * 0xb6: unknown (does not affect DVB-T). | ||
502 | */ | ||
503 | struct em28xx_reg_seq terratec_htc_stick_init[] = { | ||
504 | {EM28XX_R08_GPIO, 0xff, 0xff, 10}, | ||
505 | {EM2874_R80_GPIO, 0xf6, 0xff, 100}, | ||
506 | {EM2874_R80_GPIO, 0xe6, 0xff, 50}, | ||
507 | {EM2874_R80_GPIO, 0xf6, 0xff, 100}, | ||
508 | { -1, -1, -1, -1}, | ||
509 | }; | ||
510 | struct em28xx_reg_seq terratec_htc_stick_end[] = { | ||
511 | {EM2874_R80_GPIO, 0xb6, 0xff, 100}, | ||
512 | {EM2874_R80_GPIO, 0xf6, 0xff, 50}, | ||
513 | { -1, -1, -1, -1}, | ||
514 | }; | ||
515 | |||
516 | /* Init the analog decoder? */ | ||
517 | struct { | ||
518 | unsigned char r[4]; | ||
519 | int len; | ||
520 | } regs[] = { | ||
521 | {{ 0x06, 0x02, 0x00, 0x31 }, 4}, | ||
522 | {{ 0x01, 0x02 }, 2}, | ||
523 | {{ 0x01, 0x02, 0x00, 0xc6 }, 4}, | ||
524 | {{ 0x01, 0x00 }, 2}, | ||
525 | {{ 0x01, 0x00, 0xff, 0xaf }, 4}, | ||
526 | }; | ||
527 | |||
528 | em28xx_gpio_set(dev, terratec_htc_stick_init); | ||
529 | |||
530 | em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x40); | ||
531 | msleep(10); | ||
532 | em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x44); | ||
533 | msleep(10); | ||
534 | |||
535 | dev->i2c_client.addr = 0x82 >> 1; | ||
536 | |||
537 | for (i = 0; i < ARRAY_SIZE(regs); i++) | ||
538 | i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len); | ||
539 | |||
540 | em28xx_gpio_set(dev, terratec_htc_stick_end); | ||
541 | }; | ||
542 | |||
476 | static void pctv_520e_init(struct em28xx *dev) | 543 | static void pctv_520e_init(struct em28xx *dev) |
477 | { | 544 | { |
478 | /* | 545 | /* |
@@ -944,7 +1011,6 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
944 | break; | 1011 | break; |
945 | } | 1012 | } |
946 | case EM2884_BOARD_TERRATEC_H5: | 1013 | case EM2884_BOARD_TERRATEC_H5: |
947 | case EM2884_BOARD_CINERGY_HTC_STICK: | ||
948 | terratec_h5_init(dev); | 1014 | terratec_h5_init(dev); |
949 | 1015 | ||
950 | dvb->fe[0] = dvb_attach(drxk_attach, &terratec_h5_drxk, &dev->i2c_adap); | 1016 | dvb->fe[0] = dvb_attach(drxk_attach, &terratec_h5_drxk, &dev->i2c_adap); |
@@ -1021,6 +1087,25 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1021 | } | 1087 | } |
1022 | } | 1088 | } |
1023 | break; | 1089 | break; |
1090 | case EM2884_BOARD_CINERGY_HTC_STICK: | ||
1091 | terratec_htc_stick_init(dev); | ||
1092 | |||
1093 | /* attach demodulator */ | ||
1094 | dvb->fe[0] = dvb_attach(drxk_attach, &terratec_htc_stick_drxk, | ||
1095 | &dev->i2c_adap); | ||
1096 | if (!dvb->fe[0]) { | ||
1097 | result = -EINVAL; | ||
1098 | goto out_free; | ||
1099 | } | ||
1100 | |||
1101 | /* Attach the demodulator. */ | ||
1102 | if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, | ||
1103 | &dev->i2c_adap, | ||
1104 | &em28xx_cxd2820r_tda18271_config)) { | ||
1105 | result = -EINVAL; | ||
1106 | goto out_free; | ||
1107 | } | ||
1108 | break; | ||
1024 | default: | 1109 | default: |
1025 | em28xx_errdev("/2: The frontend of your DVB/ATSC card" | 1110 | em28xx_errdev("/2: The frontend of your DVB/ATSC card" |
1026 | " isn't supported yet\n"); | 1111 | " isn't supported yet\n"); |