aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMiroslav Sustek <sustmidown@centrum.cz>2009-05-31 15:47:28 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:21:15 -0400
commit3047a17639d499691c657772667f2c1e65edabfb (patch)
treecb28c58f0c3c40993ea432e597ea5e02938e538a /drivers/media
parent9035f2e27a99a7ea702973ab4fd47c0dd94a8c6e (diff)
V4L/DVB (11879): Adds support for Leadtek WinFast DTV-1800H
Enables analog/digital tv, radio and remote control (gpio). Tested-by: Marcin Wojcikowski <emtees.mts@gmail.com> Tested-by: Karel Juhanak <karel.juhanak@warnet.cz> Tested-by: Andrew Goff <goffa72@gmail.com> Tested-by: Jan Novak <novak-j@seznam.cz> Signed-off-by: Miroslav Sustek <sustmidown@centrum.cz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx88/cx88-cards.c75
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c1
-rw-r--r--drivers/media/video/cx88/cx88-input.c2
-rw-r--r--drivers/media/video/cx88/cx88.h1
4 files changed, 79 insertions, 0 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index d2aa27e90ac5..94b7a52629d0 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1976,6 +1976,47 @@ static const struct cx88_board cx88_boards[] = {
1976 .tuner_addr = ADDR_UNSET, 1976 .tuner_addr = ADDR_UNSET,
1977 .radio_addr = ADDR_UNSET, 1977 .radio_addr = ADDR_UNSET,
1978 }, 1978 },
1979 [CX88_BOARD_WINFAST_DTV1800H] = {
1980 .name = "Leadtek WinFast DTV1800 Hybrid",
1981 .tuner_type = TUNER_XC2028,
1982 .radio_type = TUNER_XC2028,
1983 .tuner_addr = 0x61,
1984 .radio_addr = 0x61,
1985 /*
1986 * GPIO setting
1987 *
1988 * 2: mute (0=off,1=on)
1989 * 12: tuner reset pin
1990 * 13: audio source (0=tuner audio,1=line in)
1991 * 14: FM (0=on,1=off ???)
1992 */
1993 .input = {{
1994 .type = CX88_VMUX_TELEVISION,
1995 .vmux = 0,
1996 .gpio0 = 0x0400, /* pin 2 = 0 */
1997 .gpio1 = 0x6040, /* pin 13 = 0, pin 14 = 1 */
1998 .gpio2 = 0x0000,
1999 }, {
2000 .type = CX88_VMUX_COMPOSITE1,
2001 .vmux = 1,
2002 .gpio0 = 0x0400, /* pin 2 = 0 */
2003 .gpio1 = 0x6060, /* pin 13 = 1, pin 14 = 1 */
2004 .gpio2 = 0x0000,
2005 }, {
2006 .type = CX88_VMUX_SVIDEO,
2007 .vmux = 2,
2008 .gpio0 = 0x0400, /* pin 2 = 0 */
2009 .gpio1 = 0x6060, /* pin 13 = 1, pin 14 = 1 */
2010 .gpio2 = 0x0000,
2011 } },
2012 .radio = {
2013 .type = CX88_RADIO,
2014 .gpio0 = 0x0400, /* pin 2 = 0 */
2015 .gpio1 = 0x6000, /* pin 13 = 0, pin 14 = 0 */
2016 .gpio2 = 0x0000,
2017 },
2018 .mpeg = CX88_MPEG_DVB,
2019 },
1979}; 2020};
1980 2021
1981/* ------------------------------------------------------------------ */ 2022/* ------------------------------------------------------------------ */
@@ -2393,6 +2434,10 @@ static const struct cx88_subid cx88_subids[] = {
2393 .subvendor = 0x0070, 2434 .subvendor = 0x0070,
2394 .subdevice = 0x9290, 2435 .subdevice = 0x9290,
2395 .card = CX88_BOARD_HAUPPAUGE_IRONLY, 2436 .card = CX88_BOARD_HAUPPAUGE_IRONLY,
2437 }, {
2438 .subvendor = 0x107d,
2439 .subdevice = 0x6654,
2440 .card = CX88_BOARD_WINFAST_DTV1800H,
2396 }, 2441 },
2397}; 2442};
2398 2443
@@ -2591,6 +2636,23 @@ static int cx88_xc3028_geniatech_tuner_callback(struct cx88_core *core,
2591 return -EINVAL; 2636 return -EINVAL;
2592} 2637}
2593 2638
2639static int cx88_xc3028_winfast1800h_callback(struct cx88_core *core,
2640 int command, int arg)
2641{
2642 switch (command) {
2643 case XC2028_TUNER_RESET:
2644 /* GPIO 12 (xc3028 tuner reset) */
2645 cx_set(MO_GP1_IO, 0x1010);
2646 mdelay(50);
2647 cx_clear(MO_GP1_IO, 0x10);
2648 mdelay(50);
2649 cx_set(MO_GP1_IO, 0x10);
2650 mdelay(50);
2651 return 0;
2652 }
2653 return -EINVAL;
2654}
2655
2594/* ------------------------------------------------------------------- */ 2656/* ------------------------------------------------------------------- */
2595/* some Divco specific stuff */ 2657/* some Divco specific stuff */
2596static int cx88_pv_8000gt_callback(struct cx88_core *core, 2658static int cx88_pv_8000gt_callback(struct cx88_core *core,
@@ -2663,6 +2725,8 @@ static int cx88_xc2028_tuner_callback(struct cx88_core *core,
2663 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: 2725 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
2664 case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: 2726 case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
2665 return cx88_dvico_xc2028_callback(core, command, arg); 2727 return cx88_dvico_xc2028_callback(core, command, arg);
2728 case CX88_BOARD_WINFAST_DTV1800H:
2729 return cx88_xc3028_winfast1800h_callback(core, command, arg);
2666 } 2730 }
2667 2731
2668 switch (command) { 2732 switch (command) {
@@ -2849,6 +2913,16 @@ static void cx88_card_setup_pre_i2c(struct cx88_core *core)
2849 cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */ 2913 cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */
2850 udelay(1000); 2914 udelay(1000);
2851 break; 2915 break;
2916
2917 case CX88_BOARD_WINFAST_DTV1800H:
2918 /* GPIO 12 (xc3028 tuner reset) */
2919 cx_set(MO_GP1_IO, 0x1010);
2920 mdelay(50);
2921 cx_clear(MO_GP1_IO, 0x10);
2922 mdelay(50);
2923 cx_set(MO_GP1_IO, 0x10);
2924 mdelay(50);
2925 break;
2852 } 2926 }
2853} 2927}
2854 2928
@@ -2869,6 +2943,7 @@ void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl)
2869 core->i2c_algo.udelay = 16; 2943 core->i2c_algo.udelay = 16;
2870 break; 2944 break;
2871 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: 2945 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
2946 case CX88_BOARD_WINFAST_DTV1800H:
2872 ctl->demod = XC3028_FE_ZARLINK456; 2947 ctl->demod = XC3028_FE_ZARLINK456;
2873 break; 2948 break;
2874 case CX88_BOARD_KWORLD_ATSC_120: 2949 case CX88_BOARD_KWORLD_ATSC_120:
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 9389cf290c1b..c44e87600219 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -1014,6 +1014,7 @@ static int dvb_register(struct cx8802_dev *dev)
1014 } 1014 }
1015 break; 1015 break;
1016 case CX88_BOARD_PINNACLE_HYBRID_PCTV: 1016 case CX88_BOARD_PINNACLE_HYBRID_PCTV:
1017 case CX88_BOARD_WINFAST_DTV1800H:
1017 fe0->dvb.frontend = dvb_attach(zl10353_attach, 1018 fe0->dvb.frontend = dvb_attach(zl10353_attach,
1018 &cx88_pinnacle_hybrid_pctv, 1019 &cx88_pinnacle_hybrid_pctv,
1019 &core->i2c_adap); 1020 &core->i2c_adap);
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index 8a7c2bc457a6..d91f5c51206d 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -91,6 +91,7 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
91 gpio=(gpio & 0x7fd) + (auxgpio & 0xef); 91 gpio=(gpio & 0x7fd) + (auxgpio & 0xef);
92 break; 92 break;
93 case CX88_BOARD_WINFAST_DTV1000: 93 case CX88_BOARD_WINFAST_DTV1000:
94 case CX88_BOARD_WINFAST_DTV1800H:
94 case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL: 95 case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
95 gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900); 96 gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900);
96 auxgpio = gpio; 97 auxgpio = gpio;
@@ -224,6 +225,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
224 ir->sampling = 1; 225 ir->sampling = 1;
225 break; 226 break;
226 case CX88_BOARD_WINFAST_DTV2000H: 227 case CX88_BOARD_WINFAST_DTV2000H:
228 case CX88_BOARD_WINFAST_DTV1800H:
227 ir_codes = ir_codes_winfast; 229 ir_codes = ir_codes_winfast;
228 ir->gpio_addr = MO_GP0_IO; 230 ir->gpio_addr = MO_GP0_IO;
229 ir->mask_keycode = 0x8f8; 231 ir->mask_keycode = 0x8f8;
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 2190b600e2ee..f55e4eeed78c 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -233,6 +233,7 @@ extern struct sram_channel cx88_sram_channels[];
233#define CX88_BOARD_PROF_6200 78 233#define CX88_BOARD_PROF_6200 78
234#define CX88_BOARD_TERRATEC_CINERGY_HT_PCI_MKII 79 234#define CX88_BOARD_TERRATEC_CINERGY_HT_PCI_MKII 79
235#define CX88_BOARD_HAUPPAUGE_IRONLY 80 235#define CX88_BOARD_HAUPPAUGE_IRONLY 80
236#define CX88_BOARD_WINFAST_DTV1800H 81
236 237
237enum cx88_itype { 238enum cx88_itype {
238 CX88_VMUX_COMPOSITE1 = 1, 239 CX88_VMUX_COMPOSITE1 = 1,