aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHartmut Hackmann <hartmut.hackmann@t\\-online.de>2006-03-03 10:09:26 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-03-03 12:18:23 -0500
commitbe6f655d03d2e166134da2ea3c9360c4fe008744 (patch)
tree218b96e5a3512e795bf50ef68722ab0190cd86d9 /drivers
parent6ba54abe627577270a9baeb1d984bf84fba8b2e7 (diff)
V4L/DVB (3395): Fixed Pinnacle 300i DVB-T support
- fixed tda9886 port 2 setting - turned remote control receiver off via saa7134 GPIO to avoid i2c hangs - modified tda9886 client calls to direct i2c access to allow proper return to analog mode - allow mode change to V4L2_TUNER_DIGITAL_TV in tuner VIDIOC_S_FREQUENCY client call Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c9
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c12
-rw-r--r--drivers/media/video/tuner-core.c5
3 files changed, 18 insertions, 8 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 479b01026717..6bc63a4086c1 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -977,7 +977,7 @@ struct saa7134_board saa7134_boards[] = {
977 .radio_type = UNSET, 977 .radio_type = UNSET,
978 .tuner_addr = ADDR_UNSET, 978 .tuner_addr = ADDR_UNSET,
979 .radio_addr = ADDR_UNSET, 979 .radio_addr = ADDR_UNSET,
980 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, 980 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
981 .inputs = {{ 981 .inputs = {{
982 .name = name_tv, 982 .name = name_tv,
983 .vmux = 3, 983 .vmux = 3,
@@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = {
1666 .radio_type = UNSET, 1666 .radio_type = UNSET,
1667 .tuner_addr = ADDR_UNSET, 1667 .tuner_addr = ADDR_UNSET,
1668 .radio_addr = ADDR_UNSET, 1668 .radio_addr = ADDR_UNSET,
1669 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, 1669 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
1670 .mpeg = SAA7134_MPEG_DVB, 1670 .mpeg = SAA7134_MPEG_DVB,
1671 .inputs = {{ 1671 .inputs = {{
1672 .name = name_tv, 1672 .name = name_tv,
@@ -3205,6 +3205,11 @@ int saa7134_board_init1(struct saa7134_dev *dev)
3205 /* power-up tuner chip */ 3205 /* power-up tuner chip */
3206 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); 3206 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000);
3207 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); 3207 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000);
3208 case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
3209 /* this turns the remote control chip off to work around a bug in it */
3210 saa_writeb(SAA7134_GPIO_GPMODE1, 0x80);
3211 saa_writeb(SAA7134_GPIO_GPSTATUS1, 0x80);
3212 break;
3208 case SAA7134_BOARD_MONSTERTV_MOBILE: 3213 case SAA7134_BOARD_MONSTERTV_MOBILE:
3209 /* power-up tuner chip */ 3214 /* power-up tuner chip */
3210 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); 3215 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000);
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 1a536e865277..9db8e13f21c3 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -110,6 +110,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe)
110 mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg)); 110 mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg));
111 mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg)); 111 mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg));
112 mt352_write(fe, irq_cfg, sizeof(irq_cfg)); 112 mt352_write(fe, irq_cfg, sizeof(irq_cfg));
113
113 return 0; 114 return 0;
114} 115}
115 116
@@ -117,8 +118,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
117 struct dvb_frontend_parameters* params, 118 struct dvb_frontend_parameters* params,
118 u8* pllbuf) 119 u8* pllbuf)
119{ 120{
120 static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE; 121 u8 off[] = { 0x00, 0xf1};
121 static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE; 122 u8 on[] = { 0x00, 0x71};
123 struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)};
124
122 struct saa7134_dev *dev = fe->dvb->priv; 125 struct saa7134_dev *dev = fe->dvb->priv;
123 struct v4l2_frequency f; 126 struct v4l2_frequency f;
124 127
@@ -126,9 +129,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
126 f.tuner = 0; 129 f.tuner = 0;
127 f.type = V4L2_TUNER_DIGITAL_TV; 130 f.type = V4L2_TUNER_DIGITAL_TV;
128 f.frequency = params->frequency / 1000 * 16 / 1000; 131 f.frequency = params->frequency / 1000 * 16 / 1000;
129 saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on); 132 i2c_transfer(&dev->i2c_adap, &msg, 1);
130 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); 133 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
131 saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off); 134 msg.buf = on;
135 i2c_transfer(&dev->i2c_adap, &msg, 1);
132 136
133 pinnacle_antenna_pwr(dev, antenna_pwr); 137 pinnacle_antenna_pwr(dev, antenna_pwr);
134 138
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index e7ee619d62c5..b6101bf446d4 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -713,8 +713,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
713 struct v4l2_frequency *f = arg; 713 struct v4l2_frequency *f = arg;
714 714
715 switch_v4l2(); 715 switch_v4l2();
716 if (V4L2_TUNER_RADIO == f->type && 716 if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode)
717 V4L2_TUNER_RADIO != t->mode) { 717 || (V4L2_TUNER_DIGITAL_TV == f->type
718 && V4L2_TUNER_DIGITAL_TV != t->mode)) {
718 if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") 719 if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
719 == EINVAL) 720 == EINVAL)
720 return 0; 721 return 0;