aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-dvb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-dvb.c')
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c61
1 files changed, 52 insertions, 9 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index a037e925ceb9..367a653f4c95 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -56,6 +56,7 @@
56#include "stv0900.h" 56#include "stv0900.h"
57#include "stb6100.h" 57#include "stb6100.h"
58#include "stb6100_proc.h" 58#include "stb6100_proc.h"
59#include "mb86a16.h"
59 60
60MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); 61MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
61MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>"); 62MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
@@ -250,6 +251,10 @@ static const struct zl10353_config cx88_terratec_cinergy_ht_pci_mkii_config = {
250 .if2 = 45600, 251 .if2 = 45600,
251}; 252};
252 253
254static struct mb86a16_config twinhan_vp1027 = {
255 .demod_address = 0x08,
256};
257
253#if defined(CONFIG_VIDEO_CX88_VP3054) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE)) 258#if defined(CONFIG_VIDEO_CX88_VP3054) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE))
254static int dntv_live_dvbt_pro_demod_init(struct dvb_frontend* fe) 259static int dntv_live_dvbt_pro_demod_init(struct dvb_frontend* fe)
255{ 260{
@@ -429,15 +434,41 @@ static int tevii_dvbs_set_voltage(struct dvb_frontend *fe,
429 434
430 cx_set(MO_GP0_IO, 0x6040); 435 cx_set(MO_GP0_IO, 0x6040);
431 switch (voltage) { 436 switch (voltage) {
432 case SEC_VOLTAGE_13: 437 case SEC_VOLTAGE_13:
433 cx_clear(MO_GP0_IO, 0x20); 438 cx_clear(MO_GP0_IO, 0x20);
434 break; 439 break;
435 case SEC_VOLTAGE_18: 440 case SEC_VOLTAGE_18:
436 cx_set(MO_GP0_IO, 0x20); 441 cx_set(MO_GP0_IO, 0x20);
437 break; 442 break;
438 case SEC_VOLTAGE_OFF: 443 case SEC_VOLTAGE_OFF:
439 cx_clear(MO_GP0_IO, 0x20); 444 cx_clear(MO_GP0_IO, 0x20);
440 break; 445 break;
446 }
447
448 if (core->prev_set_voltage)
449 return core->prev_set_voltage(fe, voltage);
450 return 0;
451}
452
453static int vp1027_set_voltage(struct dvb_frontend *fe,
454 fe_sec_voltage_t voltage)
455{
456 struct cx8802_dev *dev = fe->dvb->priv;
457 struct cx88_core *core = dev->core;
458
459 switch (voltage) {
460 case SEC_VOLTAGE_13:
461 dprintk(1, "LNB SEC Voltage=13\n");
462 cx_write(MO_GP0_IO, 0x00001220);
463 break;
464 case SEC_VOLTAGE_18:
465 dprintk(1, "LNB SEC Voltage=18\n");
466 cx_write(MO_GP0_IO, 0x00001222);
467 break;
468 case SEC_VOLTAGE_OFF:
469 dprintk(1, "LNB Voltage OFF\n");
470 cx_write(MO_GP0_IO, 0x00001230);
471 break;
441 } 472 }
442 473
443 if (core->prev_set_voltage) 474 if (core->prev_set_voltage)
@@ -1416,6 +1447,18 @@ static int dvb_register(struct cx8802_dev *dev)
1416 } 1447 }
1417 1448
1418 break; 1449 break;
1450 case CX88_BOARD_TWINHAN_VP1027_DVBS:
1451 dev->ts_gen_cntrl = 0x00;
1452 fe0->dvb.frontend = dvb_attach(mb86a16_attach,
1453 &twinhan_vp1027,
1454 &core->i2c_adap);
1455 if (fe0->dvb.frontend) {
1456 core->prev_set_voltage =
1457 fe0->dvb.frontend->ops.set_voltage;
1458 fe0->dvb.frontend->ops.set_voltage =
1459 vp1027_set_voltage;
1460 }
1461 break;
1419 1462
1420 default: 1463 default:
1421 printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", 1464 printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n",