forked from Minki/linux
V4L/DVB (4436): Dvb-pll support for MT352/ZL10353 based tuners.
Typical wiring of MT352 and ZL10353 based tuners differs from dvb-pll's expectation that the PLL is directly accessible. On these boards, the PLL is actually hidden behind the demodulator, and as such can only be accessed via the demodulator's interface. It was failing to communicate with the PLL during an attach test and subsequently not connecting the tuner ops. By passing a NULL I2C bus handle to dvb_pll_attach, this accessibility check can be bypassed. Do this for the affected boards. Also fix a possible NULL dereference at sleep time, which would otherwise be exposed by this change. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Acked-by: Andrew de Quincey <adq_dvb@lidskialf.net> Acked-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
174ff219b7
commit
c162dff643
@ -493,6 +493,9 @@ static int dvb_pll_sleep(struct dvb_frontend *fe)
|
|||||||
int i;
|
int i;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
if (priv->i2c == NULL)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
for (i = 0; i < priv->pll_desc->count; i++) {
|
for (i = 0; i < priv->pll_desc->count; i++) {
|
||||||
if (priv->pll_desc->entries[i].limit == 0)
|
if (priv->pll_desc->entries[i].limit == 0)
|
||||||
break;
|
break;
|
||||||
|
@ -543,8 +543,7 @@ static int dvb_register(struct cx8802_dev *dev)
|
|||||||
&dev->core->i2c_adap);
|
&dev->core->i2c_adap);
|
||||||
if (dev->dvb.frontend != NULL) {
|
if (dev->dvb.frontend != NULL) {
|
||||||
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60,
|
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60,
|
||||||
&dev->core->i2c_adap,
|
NULL, &dvb_pll_thomson_dtt7579);
|
||||||
&dvb_pll_thomson_dtt7579);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* ZL10353 replaces MT352 on later cards */
|
/* ZL10353 replaces MT352 on later cards */
|
||||||
@ -552,8 +551,7 @@ static int dvb_register(struct cx8802_dev *dev)
|
|||||||
&dev->core->i2c_adap);
|
&dev->core->i2c_adap);
|
||||||
if (dev->dvb.frontend != NULL) {
|
if (dev->dvb.frontend != NULL) {
|
||||||
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60,
|
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60,
|
||||||
&dev->core->i2c_adap,
|
NULL, &dvb_pll_thomson_dtt7579);
|
||||||
&dvb_pll_thomson_dtt7579);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
|
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
|
||||||
@ -563,8 +561,7 @@ static int dvb_register(struct cx8802_dev *dev)
|
|||||||
&dev->core->i2c_adap);
|
&dev->core->i2c_adap);
|
||||||
if (dev->dvb.frontend != NULL) {
|
if (dev->dvb.frontend != NULL) {
|
||||||
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
|
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
|
||||||
&dev->core->i2c_adap,
|
NULL, &dvb_pll_thomson_dtt7579);
|
||||||
&dvb_pll_thomson_dtt7579);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* ZL10353 replaces MT352 on later cards */
|
/* ZL10353 replaces MT352 on later cards */
|
||||||
@ -572,8 +569,7 @@ static int dvb_register(struct cx8802_dev *dev)
|
|||||||
&dev->core->i2c_adap);
|
&dev->core->i2c_adap);
|
||||||
if (dev->dvb.frontend != NULL) {
|
if (dev->dvb.frontend != NULL) {
|
||||||
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
|
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
|
||||||
&dev->core->i2c_adap,
|
NULL, &dvb_pll_thomson_dtt7579);
|
||||||
&dvb_pll_thomson_dtt7579);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
|
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
|
||||||
@ -581,8 +577,7 @@ static int dvb_register(struct cx8802_dev *dev)
|
|||||||
&dev->core->i2c_adap);
|
&dev->core->i2c_adap);
|
||||||
if (dev->dvb.frontend != NULL) {
|
if (dev->dvb.frontend != NULL) {
|
||||||
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
|
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
|
||||||
&dev->core->i2c_adap,
|
NULL, &dvb_pll_lg_z201);
|
||||||
&dvb_pll_lg_z201);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CX88_BOARD_KWORLD_DVB_T:
|
case CX88_BOARD_KWORLD_DVB_T:
|
||||||
@ -592,8 +587,7 @@ static int dvb_register(struct cx8802_dev *dev)
|
|||||||
&dev->core->i2c_adap);
|
&dev->core->i2c_adap);
|
||||||
if (dev->dvb.frontend != NULL) {
|
if (dev->dvb.frontend != NULL) {
|
||||||
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
|
dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
|
||||||
&dev->core->i2c_adap,
|
NULL, &dvb_pll_unknown_1);
|
||||||
&dvb_pll_unknown_1);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
|
case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
|
||||||
|
Loading…
Reference in New Issue
Block a user