[media] anysee: enhance demod and tuner attach
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
1fd80701b5
commit
e82eea79a3
|
@ -396,8 +396,6 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
|
||||||
/* attach demod */
|
/* attach demod */
|
||||||
adap->fe = dvb_attach(zl10353_attach, &anysee_zl10353_config,
|
adap->fe = dvb_attach(zl10353_attach, &anysee_zl10353_config,
|
||||||
&adap->dev->i2c_adap);
|
&adap->dev->i2c_adap);
|
||||||
if (adap->fe)
|
|
||||||
break;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ANYSEE_HW_507CD: /* 6 */
|
case ANYSEE_HW_507CD: /* 6 */
|
||||||
|
@ -416,8 +414,6 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
|
||||||
/* attach demod */
|
/* attach demod */
|
||||||
adap->fe = dvb_attach(zl10353_attach, &anysee_zl10353_config,
|
adap->fe = dvb_attach(zl10353_attach, &anysee_zl10353_config,
|
||||||
&adap->dev->i2c_adap);
|
&adap->dev->i2c_adap);
|
||||||
if (adap->fe)
|
|
||||||
break;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ANYSEE_HW_507DC: /* 10 */
|
case ANYSEE_HW_507DC: /* 10 */
|
||||||
|
@ -431,8 +427,6 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
|
||||||
/* attach demod */
|
/* attach demod */
|
||||||
adap->fe = dvb_attach(tda10023_attach, &anysee_tda10023_config,
|
adap->fe = dvb_attach(tda10023_attach, &anysee_tda10023_config,
|
||||||
&adap->dev->i2c_adap, 0x48);
|
&adap->dev->i2c_adap, 0x48);
|
||||||
if (adap->fe)
|
|
||||||
break;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ANYSEE_HW_507FA: /* 15 */
|
case ANYSEE_HW_507FA: /* 15 */
|
||||||
|
@ -482,8 +476,6 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
|
||||||
&anysee_zl10353_config,
|
&anysee_zl10353_config,
|
||||||
&adap->dev->i2c_adap);
|
&adap->dev->i2c_adap);
|
||||||
}
|
}
|
||||||
if (adap->fe)
|
|
||||||
break;
|
|
||||||
} else {
|
} else {
|
||||||
/* disable DVB-T demod on IOD[0] */
|
/* disable DVB-T demod on IOD[0] */
|
||||||
ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 0),
|
ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 0),
|
||||||
|
@ -509,9 +501,8 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
|
||||||
&anysee_tda10023_config,
|
&anysee_tda10023_config,
|
||||||
&adap->dev->i2c_adap, 0x48);
|
&adap->dev->i2c_adap, 0x48);
|
||||||
}
|
}
|
||||||
if (adap->fe)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ANYSEE_HW_508TC: /* 18 */
|
case ANYSEE_HW_508TC: /* 18 */
|
||||||
/* E7 TC */
|
/* E7 TC */
|
||||||
|
@ -544,8 +535,6 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
|
||||||
adap->fe = dvb_attach(zl10353_attach,
|
adap->fe = dvb_attach(zl10353_attach,
|
||||||
&anysee_zl10353_tda18212_config,
|
&anysee_zl10353_tda18212_config,
|
||||||
&adap->dev->i2c_adap);
|
&adap->dev->i2c_adap);
|
||||||
if (adap->fe)
|
|
||||||
break;
|
|
||||||
} else {
|
} else {
|
||||||
/* disable DVB-T demod on IOD[6] */
|
/* disable DVB-T demod on IOD[6] */
|
||||||
ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 6),
|
ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 6),
|
||||||
|
@ -569,18 +558,16 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
|
||||||
adap->fe = dvb_attach(tda10023_attach,
|
adap->fe = dvb_attach(tda10023_attach,
|
||||||
&anysee_tda10023_tda18212_config,
|
&anysee_tda10023_tda18212_config,
|
||||||
&adap->dev->i2c_adap, 0x48);
|
&adap->dev->i2c_adap, 0x48);
|
||||||
if (adap->fe)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!adap->fe) {
|
if (!adap->fe) {
|
||||||
/* we have no frontend :-( */
|
/* we have no frontend :-( */
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
err("Unknown Anysee version: %02x %02x %02x. " \
|
err("Unsupported Anysee version. " \
|
||||||
"Please report the <linux-media@vger.kernel.org>.",
|
"Please report the <linux-media@vger.kernel.org>.");
|
||||||
hw_info[0], hw_info[1], hw_info[2]);
|
|
||||||
}
|
}
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -590,7 +577,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
|
||||||
{
|
{
|
||||||
struct anysee_state *state = adap->dev->priv;
|
struct anysee_state *state = adap->dev->priv;
|
||||||
struct dvb_frontend *fe;
|
struct dvb_frontend *fe;
|
||||||
int ret = 0;
|
int ret;
|
||||||
deb_info("%s:\n", __func__);
|
deb_info("%s:\n", __func__);
|
||||||
|
|
||||||
switch (state->hw) {
|
switch (state->hw) {
|
||||||
|
@ -598,14 +585,15 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
|
||||||
/* E30 */
|
/* E30 */
|
||||||
|
|
||||||
/* attach tuner */
|
/* attach tuner */
|
||||||
dvb_attach(dvb_pll_attach, adap->fe, (0xc2 >> 1),
|
fe = dvb_attach(dvb_pll_attach, adap->fe, (0xc2 >> 1),
|
||||||
NULL, DVB_PLL_THOMSON_DTT7579);
|
NULL, DVB_PLL_THOMSON_DTT7579);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ANYSEE_HW_507CD: /* 6 */
|
case ANYSEE_HW_507CD: /* 6 */
|
||||||
/* E30 Plus */
|
/* E30 Plus */
|
||||||
|
|
||||||
/* attach tuner */
|
/* attach tuner */
|
||||||
dvb_attach(dvb_pll_attach, adap->fe, (0xc2 >> 1),
|
fe = dvb_attach(dvb_pll_attach, adap->fe, (0xc2 >> 1),
|
||||||
&adap->dev->i2c_adap, DVB_PLL_THOMSON_DTT7579);
|
&adap->dev->i2c_adap, DVB_PLL_THOMSON_DTT7579);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -613,8 +601,9 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
|
||||||
/* E30 C Plus */
|
/* E30 C Plus */
|
||||||
|
|
||||||
/* attach tuner */
|
/* attach tuner */
|
||||||
dvb_attach(dvb_pll_attach, adap->fe, (0xc0 >> 1),
|
fe = dvb_attach(dvb_pll_attach, adap->fe, (0xc0 >> 1),
|
||||||
&adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A);
|
&adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ANYSEE_HW_507FA: /* 15 */
|
case ANYSEE_HW_507FA: /* 15 */
|
||||||
/* E30 Combo Plus */
|
/* E30 Combo Plus */
|
||||||
|
@ -654,7 +643,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* attach tuner */
|
/* attach tuner */
|
||||||
dvb_attach(dvb_pll_attach, adap->fe, (0xc0 >> 1),
|
fe = dvb_attach(dvb_pll_attach, adap->fe, (0xc0 >> 1),
|
||||||
&adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A);
|
&adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -669,15 +658,17 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
|
||||||
/* attach tuner */
|
/* attach tuner */
|
||||||
fe = dvb_attach(tda18212_attach, adap->fe, &adap->dev->i2c_adap,
|
fe = dvb_attach(tda18212_attach, adap->fe, &adap->dev->i2c_adap,
|
||||||
&anysee_tda18212_config);
|
&anysee_tda18212_config);
|
||||||
if (!fe)
|
|
||||||
ret = -ENODEV;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ret = -ENODEV;
|
fe = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fe)
|
||||||
|
ret = 0;
|
||||||
|
else
|
||||||
|
ret = -ENODEV;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue