提交 06be3035 编写于 作者: H Hartmut Hackmann 提交者: Mauro Carvalho Chehab

V4L/DVB (5318): Fix tda8290 code for tda827x module

During tuner attach, the pointers to host dev structure
are not set yet, so the I2c adapter needs to be accessed differently.
This patch also does some minor cleanup in the saa7134-dvb module.
Signed-off-by: NHartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 8ce47dad
...@@ -634,7 +634,6 @@ static void philips_tda827x_lna_gain(struct dvb_frontend *fe, int high) ...@@ -634,7 +634,6 @@ static void philips_tda827x_lna_gain(struct dvb_frontend *fe, int high)
static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable) static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable)
{ {
struct saa7134_dev *dev = fe->dvb->priv;
struct tda1004x_state *state = fe->demodulator_priv; struct tda1004x_state *state = fe->demodulator_priv;
u8 addr = state->config->i2c_gate; u8 addr = state->config->i2c_gate;
...@@ -646,8 +645,8 @@ static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable) ...@@ -646,8 +645,8 @@ static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable)
} else { } else {
tda8290_msg.buf = tda8290_open; tda8290_msg.buf = tda8290_open;
} }
if (i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1) != 1) { if (i2c_transfer(state->i2c, &tda8290_msg, 1) != 1) {
printk("%s/dvb: could not access tda8290 I2C gate\n",dev->name); printk("saa7134/dvb: could not access tda8290 I2C gate\n");
return -EIO; return -EIO;
} }
msleep(20); msleep(20);
...@@ -869,7 +868,7 @@ static int ads_duo_tuner_init(struct dvb_frontend *fe) ...@@ -869,7 +868,7 @@ static int ads_duo_tuner_init(struct dvb_frontend *fe)
struct saa7134_dev *dev = fe->dvb->priv; struct saa7134_dev *dev = fe->dvb->priv;
philips_tda827x_tuner_init(fe); philips_tda827x_tuner_init(fe);
/* route TDA8275a AGC input to the channel decoder */ /* route TDA8275a AGC input to the channel decoder */
saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0400000); saa7134_set_gpio(dev, 22, 1);
return 0; return 0;
} }
...@@ -877,7 +876,7 @@ static int ads_duo_tuner_sleep(struct dvb_frontend *fe) ...@@ -877,7 +876,7 @@ static int ads_duo_tuner_sleep(struct dvb_frontend *fe)
{ {
struct saa7134_dev *dev = fe->dvb->priv; struct saa7134_dev *dev = fe->dvb->priv;
/* route TDA8275a AGC input to the analog IF chip*/ /* route TDA8275a AGC input to the analog IF chip*/
saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0400000); saa7134_set_gpio(dev, 22, 0);
philips_tda827x_tuner_sleep(fe); philips_tda827x_tuner_sleep(fe);
return 0; return 0;
} }
...@@ -1030,7 +1029,7 @@ static int dvb_init(struct saa7134_dev *dev) ...@@ -1030,7 +1029,7 @@ static int dvb_init(struct saa7134_dev *dev)
configure_tda827x_fe(dev, &hauppauge_hvr_1110_config, "DVB-T Hauppauge HVR 1110"); configure_tda827x_fe(dev, &hauppauge_hvr_1110_config, "DVB-T Hauppauge HVR 1110");
break; break;
case SAA7134_BOARD_ASUSTeK_P7131_DUAL: case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
configure_tda827x_fe(dev, &asus_p7131_dual_config, "DVB-T Asus P7137 Dual"); configure_tda827x_fe(dev, &asus_p7131_dual_config, "DVB-T Asus P7131 Dual");
break; break;
case SAA7134_BOARD_FLYDVBT_LR301: case SAA7134_BOARD_FLYDVBT_LR301:
configure_tda827x_fe(dev, &tda827x_lifeview_config, "DVB-T Lifeview FlyDVBT LR301"); configure_tda827x_fe(dev, &tda827x_lifeview_config, "DVB-T Lifeview FlyDVBT LR301");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册