aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorSergey Ivanov <123kash@gmail.com>2010-08-09 09:18:32 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 05:55:55 -0400
commit111ac84a80199654db55c06e2565d4ab343c135d (patch)
treeafa365528ce77ec78ad58aff0eb80b5edd99ed2f /drivers/media/video
parentfba39807ceba3e2aab022fa8c7181a322fe12675 (diff)
[media] Twinhan 1027 + IR Port support
Patch add support of TwinHan 1027 DVB-S card. Refreshed version of https://patchwork.kernel.org/patch/79753/ patch. (adapted for the new IR system), still works. DVB-S support come from a patch originally authored by Manu Abraham (abraham.manu@gmail.com). IR Port support were added by Sergey. Cc: Manu Abraham <abraham.manu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cx88/cx88-cards.c23
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c61
-rw-r--r--drivers/media/video/cx88/cx88-input.c6
-rw-r--r--drivers/media/video/cx88/cx88.h1
4 files changed, 82 insertions, 9 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index 97672cb49b51..f220fa2e10d8 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -2104,6 +2104,18 @@ static const struct cx88_board cx88_boards[] = {
2104 } }, 2104 } },
2105 .mpeg = CX88_MPEG_DVB, 2105 .mpeg = CX88_MPEG_DVB,
2106 }, 2106 },
2107 [CX88_BOARD_TWINHAN_VP1027_DVBS] = {
2108 .name = "Twinhan VP-1027 DVB-S",
2109 .tuner_type = TUNER_ABSENT,
2110 .radio_type = UNSET,
2111 .tuner_addr = ADDR_UNSET,
2112 .radio_addr = ADDR_UNSET,
2113 .input = {{
2114 .type = CX88_VMUX_DVB,
2115 .vmux = 0,
2116 } },
2117 .mpeg = CX88_MPEG_DVB,
2118 },
2107}; 2119};
2108 2120
2109/* ------------------------------------------------------------------ */ 2121/* ------------------------------------------------------------------ */
@@ -2576,6 +2588,10 @@ static const struct cx88_subid cx88_subids[] = {
2576 .subvendor = 0xb034, 2588 .subvendor = 0xb034,
2577 .subdevice = 0x3034, 2589 .subdevice = 0x3034,
2578 .card = CX88_BOARD_PROF_7301, 2590 .card = CX88_BOARD_PROF_7301,
2591 }, {
2592 .subvendor = 0x1822,
2593 .subdevice = 0x0023,
2594 .card = CX88_BOARD_TWINHAN_VP1027_DVBS,
2579 }, 2595 },
2580}; 2596};
2581 2597
@@ -3070,6 +3086,13 @@ static void cx88_card_setup_pre_i2c(struct cx88_core *core)
3070 cx_set(MO_GP1_IO, 0x10); 3086 cx_set(MO_GP1_IO, 0x10);
3071 mdelay(50); 3087 mdelay(50);
3072 break; 3088 break;
3089
3090 case CX88_BOARD_TWINHAN_VP1027_DVBS:
3091 cx_write(MO_GP0_IO, 0x00003230);
3092 cx_write(MO_GP0_IO, 0x00003210);
3093 msleep(1);
3094 cx_write(MO_GP0_IO, 0x00001230);
3095 break;
3073 } 3096 }
3074} 3097}
3075 3098
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",
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index d52ce0e3bec9..fc777bc6e716 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -405,6 +405,11 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
405 ir->mask_keycode = 0x7e; 405 ir->mask_keycode = 0x7e;
406 ir->polling = 100; /* ms */ 406 ir->polling = 100; /* ms */
407 break; 407 break;
408 case CX88_BOARD_TWINHAN_VP1027_DVBS:
409 ir_codes = RC_MAP_TWINHAN_VP1027_DVBS;
410 ir_type = IR_TYPE_NEC;
411 ir->sampling = 0xff00; /* address */
412 break;
408 } 413 }
409 414
410 if (NULL == ir_codes) { 415 if (NULL == ir_codes) {
@@ -530,6 +535,7 @@ void cx88_ir_irq(struct cx88_core *core)
530 case CX88_BOARD_PROF_7300: 535 case CX88_BOARD_PROF_7300:
531 case CX88_BOARD_PROF_7301: 536 case CX88_BOARD_PROF_7301:
532 case CX88_BOARD_PROF_6200: 537 case CX88_BOARD_PROF_6200:
538 case CX88_BOARD_TWINHAN_VP1027_DVBS:
533 ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4); 539 ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4);
534 540
535 if (ircode == 0xffffffff) { /* decoding error */ 541 if (ircode == 0xffffffff) { /* decoding error */
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 127118f4b650..c9981e77416a 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -239,6 +239,7 @@ extern const struct sram_channel const cx88_sram_channels[];
239#define CX88_BOARD_WINFAST_DTV2000H_J 82 239#define CX88_BOARD_WINFAST_DTV2000H_J 82
240#define CX88_BOARD_PROF_7301 83 240#define CX88_BOARD_PROF_7301 83
241#define CX88_BOARD_SAMSUNG_SMT_7020 84 241#define CX88_BOARD_SAMSUNG_SMT_7020 84
242#define CX88_BOARD_TWINHAN_VP1027_DVBS 85
242 243
243enum cx88_itype { 244enum cx88_itype {
244 CX88_VMUX_COMPOSITE1 = 1, 245 CX88_VMUX_COMPOSITE1 = 1,