Commit bfd4500c authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] dvb-usb: prepare for multi-frontend support (MFE)

Change adapter FE pointer as array of FE pointers.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6d514774
......@@ -815,7 +815,7 @@ static int af9005_frontend_attach(struct dvb_usb_adapter *adap)
debug_dump(buf, 8, printk);
}
}
adap->fe = af9005_fe_attach(adap->dev);
adap->fe[0] = af9005_fe_attach(adap->dev);
return 0;
}
......
......@@ -1111,10 +1111,10 @@ static int af9015_af9013_frontend_attach(struct dvb_usb_adapter *adap)
}
/* attach demodulator */
adap->fe = dvb_attach(af9013_attach, &af9015_af9013_config[adap->id],
adap->fe[0] = dvb_attach(af9013_attach, &af9015_af9013_config[adap->id],
&adap->dev->i2c_adap);
return adap->fe == NULL ? -ENODEV : 0;
return adap->fe[0] == NULL ? -ENODEV : 0;
}
static struct mt2060_config af9015_mt2060_config = {
......@@ -1188,49 +1188,49 @@ static int af9015_tuner_attach(struct dvb_usb_adapter *adap)
switch (af9015_af9013_config[adap->id].tuner) {
case AF9013_TUNER_MT2060:
case AF9013_TUNER_MT2060_2:
ret = dvb_attach(mt2060_attach, adap->fe, &adap->dev->i2c_adap,
ret = dvb_attach(mt2060_attach, adap->fe[0], &adap->dev->i2c_adap,
&af9015_mt2060_config,
af9015_config.mt2060_if1[adap->id])
== NULL ? -ENODEV : 0;
break;
case AF9013_TUNER_QT1010:
case AF9013_TUNER_QT1010A:
ret = dvb_attach(qt1010_attach, adap->fe, &adap->dev->i2c_adap,
ret = dvb_attach(qt1010_attach, adap->fe[0], &adap->dev->i2c_adap,
&af9015_qt1010_config) == NULL ? -ENODEV : 0;
break;
case AF9013_TUNER_TDA18271:
ret = dvb_attach(tda18271_attach, adap->fe, 0xc0,
ret = dvb_attach(tda18271_attach, adap->fe[0], 0xc0,
&adap->dev->i2c_adap,
&af9015_tda18271_config) == NULL ? -ENODEV : 0;
break;
case AF9013_TUNER_TDA18218:
ret = dvb_attach(tda18218_attach, adap->fe,
ret = dvb_attach(tda18218_attach, adap->fe[0],
&adap->dev->i2c_adap,
&af9015_tda18218_config) == NULL ? -ENODEV : 0;
break;
case AF9013_TUNER_MXL5003D:
ret = dvb_attach(mxl5005s_attach, adap->fe,
ret = dvb_attach(mxl5005s_attach, adap->fe[0],
&adap->dev->i2c_adap,
&af9015_mxl5003_config) == NULL ? -ENODEV : 0;
break;
case AF9013_TUNER_MXL5005D:
case AF9013_TUNER_MXL5005R:
ret = dvb_attach(mxl5005s_attach, adap->fe,
ret = dvb_attach(mxl5005s_attach, adap->fe[0],
&adap->dev->i2c_adap,
&af9015_mxl5005_config) == NULL ? -ENODEV : 0;
break;
case AF9013_TUNER_ENV77H11D5:
ret = dvb_attach(dvb_pll_attach, adap->fe, 0xc0,
ret = dvb_attach(dvb_pll_attach, adap->fe[0], 0xc0,
&adap->dev->i2c_adap,
DVB_PLL_TDA665X) == NULL ? -ENODEV : 0;
break;
case AF9013_TUNER_MC44S803:
ret = dvb_attach(mc44s803_attach, adap->fe,
ret = dvb_attach(mc44s803_attach, adap->fe[0],
&adap->dev->i2c_adap,
&af9015_mc44s803_config) == NULL ? -ENODEV : 0;
break;
case AF9013_TUNER_MXL5007T:
ret = dvb_attach(mxl5007t_attach, adap->fe,
ret = dvb_attach(mxl5007t_attach, adap->fe[0],
&adap->dev->i2c_adap,
0xc0, &af9015_mxl5007t_config) == NULL ? -ENODEV : 0;
break;
......
......@@ -488,13 +488,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
/* E30 */
/* attach demod */
adap->fe = dvb_attach(mt352_attach, &anysee_mt352_config,
adap->fe[0] = dvb_attach(mt352_attach, &anysee_mt352_config,
&adap->dev->i2c_adap);
if (adap->fe)
if (adap->fe[0])
break;
/* attach demod */
adap->fe = dvb_attach(zl10353_attach, &anysee_zl10353_config,
adap->fe[0] = dvb_attach(zl10353_attach, &anysee_zl10353_config,
&adap->dev->i2c_adap);
break;
......@@ -512,7 +512,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach demod */
adap->fe = dvb_attach(zl10353_attach, &anysee_zl10353_config,
adap->fe[0] = dvb_attach(zl10353_attach, &anysee_zl10353_config,
&adap->dev->i2c_adap);
break;
......@@ -525,7 +525,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach demod */
adap->fe = dvb_attach(tda10023_attach, &anysee_tda10023_config,
adap->fe[0] = dvb_attach(tda10023_attach, &anysee_tda10023_config,
&adap->dev->i2c_adap, 0x48);
break;
......@@ -538,7 +538,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach demod */
adap->fe = dvb_attach(cx24116_attach, &anysee_cx24116_config,
adap->fe[0] = dvb_attach(cx24116_attach, &anysee_cx24116_config,
&adap->dev->i2c_adap);
break;
......@@ -580,12 +580,12 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
/* attach demod */
if (tmp == 0xc7) {
/* TDA18212 config */
adap->fe = dvb_attach(zl10353_attach,
adap->fe[0] = dvb_attach(zl10353_attach,
&anysee_zl10353_tda18212_config2,
&adap->dev->i2c_adap);
} else {
/* PLL config */
adap->fe = dvb_attach(zl10353_attach,
adap->fe[0] = dvb_attach(zl10353_attach,
&anysee_zl10353_config,
&adap->dev->i2c_adap);
}
......@@ -605,12 +605,12 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
/* attach demod */
if (tmp == 0xc7) {
/* TDA18212 config */
adap->fe = dvb_attach(tda10023_attach,
adap->fe[0] = dvb_attach(tda10023_attach,
&anysee_tda10023_tda18212_config,
&adap->dev->i2c_adap, 0x48);
} else {
/* PLL config */
adap->fe = dvb_attach(tda10023_attach,
adap->fe[0] = dvb_attach(tda10023_attach,
&anysee_tda10023_config,
&adap->dev->i2c_adap, 0x48);
}
......@@ -647,7 +647,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach demod */
adap->fe = dvb_attach(zl10353_attach,
adap->fe[0] = dvb_attach(zl10353_attach,
&anysee_zl10353_tda18212_config,
&adap->dev->i2c_adap);
} else {
......@@ -670,7 +670,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach demod */
adap->fe = dvb_attach(tda10023_attach,
adap->fe[0] = dvb_attach(tda10023_attach,
&anysee_tda10023_tda18212_config,
&adap->dev->i2c_adap, 0x48);
}
......@@ -692,13 +692,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach demod */
adap->fe = dvb_attach(stv0900_attach, &anysee_stv0900_config,
adap->fe[0] = dvb_attach(stv0900_attach, &anysee_stv0900_config,
&adap->dev->i2c_adap, 0);
break;
}
if (!adap->fe) {
if (!adap->fe[0]) {
/* we have no frontend :-( */
ret = -ENODEV;
err("Unsupported Anysee version. " \
......@@ -720,7 +720,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E30 */
/* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe, (0xc2 >> 1),
fe = dvb_attach(dvb_pll_attach, adap->fe[0], (0xc2 >> 1),
NULL, DVB_PLL_THOMSON_DTT7579);
break;
......@@ -728,7 +728,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E30 Plus */
/* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe, (0xc2 >> 1),
fe = dvb_attach(dvb_pll_attach, adap->fe[0], (0xc2 >> 1),
&adap->dev->i2c_adap, DVB_PLL_THOMSON_DTT7579);
break;
......@@ -736,7 +736,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E30 C Plus */
/* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe, (0xc0 >> 1),
fe = dvb_attach(dvb_pll_attach, adap->fe[0], (0xc0 >> 1),
&adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A);
break;
......@@ -744,7 +744,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E30 S2 Plus */
/* attach LNB controller */
fe = dvb_attach(isl6423_attach, adap->fe, &adap->dev->i2c_adap,
fe = dvb_attach(isl6423_attach, adap->fe[0], &adap->dev->i2c_adap,
&anysee_isl6423_config);
break;
......@@ -775,7 +775,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach tuner */
fe = dvb_attach(tda18212_attach, adap->fe, &adap->dev->i2c_adap,
fe = dvb_attach(tda18212_attach, adap->fe[0], &adap->dev->i2c_adap,
&anysee_tda18212_config);
if (fe)
break;
......@@ -786,7 +786,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe, (0xc0 >> 1),
fe = dvb_attach(dvb_pll_attach, adap->fe[0], (0xc0 >> 1),
&adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A);
break;
......@@ -801,7 +801,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
goto error;
/* attach tuner */
fe = dvb_attach(tda18212_attach, adap->fe, &adap->dev->i2c_adap,
fe = dvb_attach(tda18212_attach, adap->fe[0], &adap->dev->i2c_adap,
&anysee_tda18212_config);
break;
......@@ -811,12 +811,12 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E7 PS2 */
/* attach tuner */
fe = dvb_attach(stv6110_attach, adap->fe,
fe = dvb_attach(stv6110_attach, adap->fe[0],
&anysee_stv6110_config, &adap->dev->i2c_adap);
if (fe) {
/* attach LNB controller */
fe = dvb_attach(isl6423_attach, adap->fe,
fe = dvb_attach(isl6423_attach, adap->fe[0],
&adap->dev->i2c_adap, &anysee_isl6423_config);
}
......
......@@ -140,9 +140,9 @@ static struct zl10353_config au6610_zl10353_config = {
static int au6610_zl10353_frontend_attach(struct dvb_usb_adapter *adap)
{
adap->fe = dvb_attach(zl10353_attach, &au6610_zl10353_config,
adap->fe[0] = dvb_attach(zl10353_attach, &au6610_zl10353_config,
&adap->dev->i2c_adap);
if (adap->fe == NULL)
if (adap->fe[0] == NULL)
return -ENODEV;
return 0;
......@@ -155,7 +155,7 @@ static struct qt1010_config au6610_qt1010_config = {
static int au6610_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
{
return dvb_attach(qt1010_attach,
adap->fe, &adap->dev->i2c_adap,
adap->fe[0], &adap->dev->i2c_adap,
&au6610_qt1010_config) == NULL ? -ENODEV : 0;
}
......
......@@ -910,16 +910,16 @@ static int az6027_frontend_attach(struct dvb_usb_adapter *adap)
az6027_frontend_reset(adap);
deb_info("adap = %p, dev = %p\n", adap, adap->dev);
adap->fe = stb0899_attach(&az6027_stb0899_config, &adap->dev->i2c_adap);
adap->fe[0] = stb0899_attach(&az6027_stb0899_config, &adap->dev->i2c_adap);
if (adap->fe) {
if (adap->fe[0]) {
deb_info("found STB0899 DVB-S/DVB-S2 frontend @0x%02x", az6027_stb0899_config.demod_address);
if (stb6100_attach(adap->fe, &az6027_stb6100_config, &adap->dev->i2c_adap)) {
if (stb6100_attach(adap->fe[0], &az6027_stb6100_config, &adap->dev->i2c_adap)) {
deb_info("found STB6100 DVB-S/DVB-S2 frontend @0x%02x", az6027_stb6100_config.tuner_address);
adap->fe->ops.set_voltage = az6027_set_voltage;
adap->fe[0]->ops.set_voltage = az6027_set_voltage;
az6027_ci_init(adap);
} else {
adap->fe = NULL;
adap->fe[0] = NULL;
}
} else
warn("no front-end attached\n");
......
......@@ -186,9 +186,9 @@ static struct zl10353_config ce6230_zl10353_config = {
static int ce6230_zl10353_frontend_attach(struct dvb_usb_adapter *adap)
{
deb_info("%s:\n", __func__);
adap->fe = dvb_attach(zl10353_attach, &ce6230_zl10353_config,
adap->fe[0] = dvb_attach(zl10353_attach, &ce6230_zl10353_config,
&adap->dev->i2c_adap);
if (adap->fe == NULL)
if (adap->fe[0] == NULL)
return -ENODEV;
return 0;
}
......@@ -214,7 +214,7 @@ static int ce6230_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{
int ret;
deb_info("%s:\n", __func__);
ret = dvb_attach(mxl5005s_attach, adap->fe, &adap->dev->i2c_adap,
ret = dvb_attach(mxl5005s_attach, adap->fe[0], &adap->dev->i2c_adap,
&ce6230_mxl5003s_config) == NULL ? -ENODEV : 0;
return ret;
}
......
......@@ -69,7 +69,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap)
char state[3];
int ret;
adap->fe = cinergyt2_fe_attach(adap->dev);
adap->fe[0] = cinergyt2_fe_attach(adap->dev);
ret = dvb_usb_generic_rw(adap->dev, query, sizeof(query), state,
sizeof(state), 0);
......
......@@ -725,7 +725,7 @@ static struct max2165_config mygica_d689_max2165_cfg = {
/* Callbacks for DVB USB */
static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(simple_tuner_attach, adap->fe,
dvb_attach(simple_tuner_attach, adap->fe[0],
&adap->dev->i2c_adap, 0x61,
TUNER_PHILIPS_FMD1216ME_MK3);
return 0;
......@@ -733,27 +733,27 @@ static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(dvb_pll_attach, adap->fe, 0x61,
dvb_attach(dvb_pll_attach, adap->fe[0], 0x61,
NULL, DVB_PLL_THOMSON_DTT7579);
return 0;
}
static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, DVB_PLL_LG_Z201);
dvb_attach(dvb_pll_attach, adap->fe[0], 0x61, NULL, DVB_PLL_LG_Z201);
return 0;
}
static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(dvb_pll_attach, adap->fe, 0x60,
dvb_attach(dvb_pll_attach, adap->fe[0], 0x60,
NULL, DVB_PLL_THOMSON_DTT7579);
return 0;
}
static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(simple_tuner_attach, adap->fe,
dvb_attach(simple_tuner_attach, adap->fe[0],
&adap->dev->i2c_adap, 0x61, TUNER_LG_TDVS_H06XF);
return 0;
}
......@@ -795,9 +795,9 @@ static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
};
/* FIXME: generalize & move to common area */
adap->fe->callback = dvico_bluebird_xc2028_callback;
adap->fe[0]->callback = dvico_bluebird_xc2028_callback;
fe = dvb_attach(xc2028_attach, adap->fe, &cfg);
fe = dvb_attach(xc2028_attach, adap->fe[0], &cfg);
if (fe == NULL || fe->ops.tuner_ops.set_config == NULL)
return -EIO;
......@@ -808,7 +808,7 @@ static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
static int cxusb_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(mxl5005s_attach, adap->fe,
dvb_attach(mxl5005s_attach, adap->fe[0],
&adap->dev->i2c_adap, &aver_a868r_tuner);
return 0;
}
......@@ -816,7 +816,7 @@ static int cxusb_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
static int cxusb_d680_dmb_tuner_attach(struct dvb_usb_adapter *adap)
{
struct dvb_frontend *fe;
fe = dvb_attach(mxl5005s_attach, adap->fe,
fe = dvb_attach(mxl5005s_attach, adap->fe[0],
&adap->dev->i2c_adap, &d680_dmb_tuner);
return (fe == NULL) ? -EIO : 0;
}
......@@ -824,7 +824,7 @@ static int cxusb_d680_dmb_tuner_attach(struct dvb_usb_adapter *adap)
static int cxusb_mygica_d689_tuner_attach(struct dvb_usb_adapter *adap)
{
struct dvb_frontend *fe;
fe = dvb_attach(max2165_attach, adap->fe,
fe = dvb_attach(max2165_attach, adap->fe[0],
&adap->dev->i2c_adap, &mygica_d689_max2165_cfg);
return (fe == NULL) ? -EIO : 0;
}
......@@ -837,7 +837,7 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_adapter *adap)
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, &b, 1);
if ((adap->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config,
if ((adap->fe[0] = dvb_attach(cx22702_attach, &cxusb_cx22702_config,
&adap->dev->i2c_adap)) != NULL)
return 0;
......@@ -851,7 +851,7 @@ static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
if ((adap->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config,
if ((adap->fe[0] = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config,
&adap->dev->i2c_adap)) != NULL)
return 0;
......@@ -860,9 +860,9 @@ static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
static int cxusb_aver_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
{
adap->fe = dvb_attach(lgdt330x_attach, &cxusb_aver_lgdt3303_config,
adap->fe[0] = dvb_attach(lgdt330x_attach, &cxusb_aver_lgdt3303_config,
&adap->dev->i2c_adap);
if (adap->fe != NULL)
if (adap->fe[0] != NULL)
return 0;
return -EIO;
......@@ -876,7 +876,7 @@ static int cxusb_mt352_frontend_attach(struct dvb_usb_adapter *adap)
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
if ((adap->fe = dvb_attach(mt352_attach, &cxusb_mt352_config,
if ((adap->fe[0] = dvb_attach(mt352_attach, &cxusb_mt352_config,
&adap->dev->i2c_adap)) != NULL)
return 0;
......@@ -890,9 +890,9 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_adapter *adap)
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
if (((adap->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config,
if (((adap->fe[0] = dvb_attach(mt352_attach, &cxusb_dee1601_config,
&adap->dev->i2c_adap)) != NULL) ||
((adap->fe = dvb_attach(zl10353_attach,
((adap->fe[0] = dvb_attach(zl10353_attach,
&cxusb_zl10353_dee1601_config,
&adap->dev->i2c_adap)) != NULL))
return 0;
......@@ -917,7 +917,7 @@ static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap)
cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1);
cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
if ((adap->fe = dvb_attach(zl10353_attach,
if ((adap->fe[0] = dvb_attach(zl10353_attach,
&cxusb_zl10353_xc3028_config_no_i2c_gate,
&adap->dev->i2c_adap)) == NULL)
return -EIO;
......@@ -1031,9 +1031,9 @@ static int cxusb_dualdig4_rev2_frontend_attach(struct dvb_usb_adapter *adap)
return -ENODEV;
}
adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
adap->fe[0] = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
&cxusb_dualdig4_rev2_config);
if (adap->fe == NULL)
if (adap->fe[0] == NULL)
return -EIO;
return 0;
......@@ -1084,15 +1084,15 @@ static int cxusb_dualdig4_rev2_tuner_attach(struct dvb_usb_adapter *adap)
{
struct dib0700_adapter_state *st = adap->priv;
struct i2c_adapter *tun_i2c =
dib7000p_get_i2c_master(adap->fe,
dib7000p_get_i2c_master(adap->fe[0],
DIBX000_I2C_INTERFACE_TUNER, 1);
if (dvb_attach(dib0070_attach, adap->fe, tun_i2c,
if (dvb_attach(dib0070_attach, adap->fe[0], tun_i2c,
&dib7070p_dib0070_config) == NULL)
return -ENODEV;
st->set_param_save = adap->fe->ops.tuner_ops.set_params;
adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override;
st->set_param_save = adap->fe[0]->ops.tuner_ops.set_params;
adap->fe[0]->ops.tuner_ops.set_params = dib7070_set_param_override;
return 0;
}
......@@ -1108,12 +1108,12 @@ static int cxusb_nano2_frontend_attach(struct dvb_usb_adapter *adap)
cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1);
cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
if ((adap->fe = dvb_attach(zl10353_attach,
if ((adap->fe[0] = dvb_attach(zl10353_attach,
&cxusb_zl10353_xc3028_config,
&adap->dev->i2c_adap)) != NULL)
return 0;
if ((adap->fe = dvb_attach(mt352_attach,
if ((adap->fe[0] = dvb_attach(mt352_attach,
&cxusb_mt352_xc3028_config,
&adap->dev->i2c_adap)) != NULL)
return 0;
......@@ -1172,8 +1172,8 @@ static int cxusb_d680_dmb_frontend_attach(struct dvb_usb_adapter *adap)
msleep(100);
/* Attach frontend */
adap->fe = dvb_attach(lgs8gxx_attach, &d680_lgs8gl5_cfg, &d->i2c_adap);
if (adap->fe == NULL)
adap->fe[0] = dvb_attach(lgs8gxx_attach, &d680_lgs8gl5_cfg, &d->i2c_adap);
if (adap->fe[0] == NULL)
return -EIO;
return 0;
......@@ -1223,9 +1223,9 @@ static int cxusb_mygica_d689_frontend_attach(struct dvb_usb_adapter *adap)
msleep(100);
/* Attach frontend */
adap->fe = dvb_attach(atbm8830_attach, &mygica_d689_atbm8830_cfg,
adap->fe[0] = dvb_attach(atbm8830_attach, &mygica_d689_atbm8830_cfg,
&d->i2c_adap);
if (adap->fe == NULL)
if (adap->fe[0] == NULL)
return -EIO;
return 0;
......
This diff is collapsed.
......@@ -23,7 +23,7 @@ int dibusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
if (adap->priv != NULL) {
struct dibusb_state *st = adap->priv;
if (st->ops.fifo_ctrl != NULL)
if (st->ops.fifo_ctrl(adap->fe,onoff)) {
if (st->ops.fifo_ctrl(adap->fe[0],onoff)) {
err("error while controlling the fifo of the demod.");
return -ENODEV;
}
......@@ -37,7 +37,7 @@ int dibusb_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onof
if (adap->priv != NULL) {
struct dibusb_state *st = adap->priv;
if (st->ops.pid_ctrl != NULL)
st->ops.pid_ctrl(adap->fe,index,pid,onoff);
st->ops.pid_ctrl(adap->fe[0],index,pid,onoff);
}
return 0;
}
......@@ -48,7 +48,7 @@ int dibusb_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
if (adap->priv != NULL) {
struct dibusb_state *st = adap->priv;
if (st->ops.pid_parse != NULL)
if (st->ops.pid_parse(adap->fe,onoff) < 0)
if (st->ops.pid_parse(adap->fe[0],onoff) < 0)
err("could not handle pid_parser");
}
return 0;
......@@ -254,8 +254,8 @@ int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap)
msleep(1000);
}
if ((adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000P_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL ||
(adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000MC_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL) {
if ((adap->fe[0] = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000P_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL ||
(adap->fe[0] = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000MC_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL) {
if (adap->priv != NULL) {
struct dibusb_state *st = adap->priv;
st->ops.pid_parse = dib3000mc_pid_parse;
......@@ -309,15 +309,15 @@ int dibusb_dib3000mc_tuner_attach(struct dvb_usb_adapter *adap)
}
}
tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
if (dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk3000p_mt2060_config, if1) == NULL) {
tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe[0], 1);
if (dvb_attach(mt2060_attach, adap->fe[0], tun_i2c, &stk3000p_mt2060_config, if1) == NULL) {
/* not found - use panasonic pll parameters */
if (dvb_attach(dvb_pll_attach, adap->fe, 0x60, tun_i2c, DVB_PLL_ENV57H1XD5) == NULL)
if (dvb_attach(dvb_pll_attach, adap->fe[0], 0x60, tun_i2c, DVB_PLL_ENV57H1XD5) == NULL)
return -ENOMEM;
} else {
st->mt2060_present = 1;
/* set the correct parameters for the dib3000p */
dib3000mc_set_config(adap->fe, &stk3000p_dib3000p_config);
dib3000mc_set_config(adap->fe[0], &stk3000p_dib3000p_config);
}
return 0;
}
......
......@@ -31,11 +31,11 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
demod_cfg.demod_address = 0x8;
if ((adap->fe = dvb_attach(dib3000mb_attach, &demod_cfg,
if ((adap->fe[0] = dvb_attach(dib3000mb_attach, &demod_cfg,
&adap->dev->i2c_adap, &st->ops)) == NULL)
return -ENODEV;
adap->fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
adap->fe[0]->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
return 0;
}
......@@ -46,7 +46,7 @@ static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
st->tuner_addr = 0x61;
dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
dvb_attach(dvb_pll_attach, adap->fe[0], 0x61, &adap->dev->i2c_adap,
DVB_PLL_TUA6010XS);
return 0;
}
......@@ -57,7 +57,7 @@ static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
st->tuner_addr = 0x60;
dvb_attach(dvb_pll_attach, adap->fe, 0x60, &adap->dev->i2c_adap,
dvb_attach(dvb_pll_attach, adap->fe[0], 0x60, &adap->dev->i2c_adap,
DVB_PLL_TDA665X);
return 0;
}
......@@ -78,16 +78,16 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap)
/* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
msg[0].addr = msg[1].addr = st->tuner_addr = 0x60;
if (adap->fe->ops.i2c_gate_ctrl)
adap->fe->ops.i2c_gate_ctrl(adap->fe,1);
if (adap->fe[0]->ops.i2c_gate_ctrl)
adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0],1);
if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
err("tuner i2c write failed.");
ret = -EREMOTEIO;
}
if (adap->fe->ops.i2c_gate_ctrl)
adap->fe->ops.i2c_gate_ctrl(adap->fe,0);
if (adap->fe[0]->ops.i2c_gate_ctrl)
adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0],0);
if (b2[0] == 0xfe) {
info("This device has the Thomson Cable onboard. Which is default.");
......
......@@ -137,11 +137,11 @@ static int digitv_frontend_attach(struct dvb_usb_adapter *adap)
{
struct digitv_state *st = adap->dev->priv;
if ((adap->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) {
if ((adap->fe[0] = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) {
st->is_nxt6000 = 0;
return 0;
}
if ((adap->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) {
if ((adap->fe[0] = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) {
st->is_nxt6000 = 1;
return 0;
}
......@@ -152,11 +152,11 @@ static int digitv_tuner_attach(struct dvb_usb_adapter *adap)
{
struct digitv_state *st = adap->dev->priv;
if (!dvb_attach(dvb_pll_attach, adap->fe, 0x60, NULL, DVB_PLL_TDED4))
if (!dvb_attach(dvb_pll_attach, adap->fe[0], 0x60, NULL, DVB_PLL_TDED4))
return -ENODEV;
if (st->is_nxt6000)
adap->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params;
adap->fe[0]->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params;
return 0;
}
......
......@@ -90,7 +90,7 @@ static int dtt200u_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
static int dtt200u_frontend_attach(struct dvb_usb_adapter *adap)
{
adap->fe = dtt200u_fe_attach(adap->dev);
adap->fe[0] = dtt200u_fe_attach(adap->dev);
return 0;
}
......
......@@ -115,13 +115,13 @@ static struct zl10353_config dtv5100_zl10353_config = {
static int dtv5100_frontend_attach(struct dvb_usb_adapter *adap)
{
adap->fe = dvb_attach(zl10353_attach, &dtv5100_zl10353_config,
adap->fe[0] = dvb_attach(zl10353_attach, &dtv5100_zl10353_config,
&adap->dev->i2c_adap);
if (adap->fe == NULL)
if (adap->fe[0] == NULL)
return -EIO;
/* disable i2c gate, or it won't work... is this safe? */
adap->fe->ops.i2c_gate_ctrl = NULL;
adap->fe[0]->ops.i2c_gate_ctrl = NULL;
return 0;
}
......@@ -133,7 +133,7 @@ static struct qt1010_config dtv5100_qt1010_config = {
static int dtv5100_tuner_attach(struct dvb_usb_adapter *adap)
{
return dvb_attach(qt1010_attach,
adap->fe, &adap->dev->i2c_adap,
adap->fe[0], &adap->dev->i2c_adap,
&dtv5100_qt1010_config) == NULL ? -ENODEV : 0;
}
......
......@@ -186,14 +186,14 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
}
/* re-assign sleep and wakeup functions */
if (adap->props.frontend_attach(adap) == 0 && adap->fe != NULL) {
adap->fe_init = adap->fe->ops.init; adap->fe->ops.init = dvb_usb_fe_wakeup;
adap->fe_sleep = adap->fe->ops.sleep; adap->fe->ops.sleep = dvb_usb_fe_sleep;
if (adap->props.frontend_attach(adap) == 0 && adap->fe[0] != NULL) {
adap->fe_init = adap->fe[0]->ops.init; adap->fe[0]->ops.init = dvb_usb_fe_wakeup;
adap->fe_sleep = adap->fe[0]->ops.sleep; adap->fe[0]->ops.sleep = dvb_usb_fe_sleep;
if (dvb_register_frontend(&adap->dvb_adap, adap->fe)) {
if (dvb_register_frontend(&adap->dvb_adap, adap->fe[0])) {
err("Frontend registration failed.");
dvb_frontend_detach(adap->fe);
adap->fe = NULL;
dvb_frontend_detach(adap->fe[0]);
adap->fe[0] = NULL;
return -ENODEV;
}
......@@ -208,9 +208,9 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap)
{
if (adap->fe != NULL) {
dvb_unregister_frontend(adap->fe);
dvb_frontend_detach(adap->fe);
if (adap->fe[0] != NULL) {
dvb_unregister_frontend(adap->fe[0]);
dvb_frontend_detach(adap->fe[0]);
}
return 0;
}
......@@ -363,7 +363,7 @@ struct dvb_usb_adapter {
struct dmxdev dmxdev;
struct dvb_demux demux;
struct dvb_net dvb_net;
struct dvb_frontend *fe;
struct dvb_frontend *fe[1];
int max_feed_count;
int (*fe_init) (struct dvb_frontend *);
......
......@@ -992,18 +992,18 @@ static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
struct dvb_tuner_ops *tuner_ops = NULL;
if (demod_probe & 4) {
d->fe = dvb_attach(stv0900_attach, &dw2104a_stv0900_config,
d->fe[0] = dvb_attach(stv0900_attach, &dw2104a_stv0900_config,
&d->dev->i2c_adap, 0);
if (d->fe != NULL) {
if (dvb_attach(stb6100_attach, d->fe,
if (d->fe[0] != NULL) {
if (dvb_attach(stb6100_attach, d->fe[0],
&dw2104a_stb6100_config,
&d->dev->i2c_adap)) {
tuner_ops = &d->fe->ops.tuner_ops;
tuner_ops = &d->fe[0]->ops.tuner_ops;
tuner_ops->set_frequency = stb6100_set_freq;
tuner_ops->get_frequency = stb6100_get_freq;
tuner_ops->set_bandwidth = stb6100_set_bandw;
tuner_ops->get_bandwidth = stb6100_get_bandw;
d->fe->ops.set_voltage = dw210x_set_voltage;
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
info("Attached STV0900+STB6100!\n");
return 0;
}
......@@ -1011,13 +1011,13 @@ static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
}
if (demod_probe & 2) {
d->fe = dvb_attach(stv0900_attach, &dw2104_stv0900_config,
d->fe[0] = dvb_attach(stv0900_attach, &dw2104_stv0900_config,
&d->dev->i2c_adap, 0);
if (d->fe != NULL) {
if (dvb_attach(stv6110_attach, d->fe,
if (d->fe[0] != NULL) {
if (dvb_attach(stv6110_attach, d->fe[0],
&dw2104_stv6110_config,
&d->dev->i2c_adap)) {
d->fe->ops.set_voltage = dw210x_set_voltage;
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
info("Attached STV0900+STV6110A!\n");
return 0;
}
......@@ -1025,19 +1025,19 @@ static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
}
if (demod_probe & 1) {
d->fe = dvb_attach(cx24116_attach, &dw2104_config,
d->fe[0] = dvb_attach(cx24116_attach, &dw2104_config,
&d->dev->i2c_adap);
if (d->fe != NULL) {
d->fe->ops.set_voltage = dw210x_set_voltage;
if (d->fe[0] != NULL) {
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
info("Attached cx24116!\n");
return 0;
}
}
d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
d->fe[0] = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
&d->dev->i2c_adap);
if (d->fe != NULL) {
d->fe->ops.set_voltage = dw210x_set_voltage;
if (d->fe[0] != NULL) {
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
info("Attached DS3000!\n");
return 0;
}
......@@ -1053,22 +1053,22 @@ static int dw2102_frontend_attach(struct dvb_usb_adapter *d)
{
if (dw2102_properties.i2c_algo == &dw2102_serit_i2c_algo) {
/*dw2102_properties.adapter->tuner_attach = NULL;*/
d->fe = dvb_attach(si21xx_attach, &serit_sp1511lhb_config,
d->fe[0] = dvb_attach(si21xx_attach, &serit_sp1511lhb_config,
&d->dev->i2c_adap);
if (d->fe != NULL) {
d->fe->ops.set_voltage = dw210x_set_voltage;
if (d->fe[0] != NULL) {
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
info("Attached si21xx!\n");
return 0;
}
}
if (dw2102_properties.i2c_algo == &dw2102_earda_i2c_algo) {
d->fe = dvb_attach(stv0288_attach, &earda_config,
d->fe[0] = dvb_attach(stv0288_attach, &earda_config,
&d->dev->i2c_adap);
if (d->fe != NULL) {
if (dvb_attach(stb6000_attach, d->fe, 0x61,
if (d->fe[0] != NULL) {
if (dvb_attach(stb6000_attach, d->fe[0], 0x61,
&d->dev->i2c_adap)) {
d->fe->ops.set_voltage = dw210x_set_voltage;
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
info("Attached stv0288!\n");
return 0;
}
......@@ -1077,10 +1077,10 @@ static int dw2102_frontend_attach(struct dvb_usb_adapter *d)
if (dw2102_properties.i2c_algo == &dw2102_i2c_algo) {
/*dw2102_properties.adapter->tuner_attach = dw2102_tuner_attach;*/
d->fe = dvb_attach(stv0299_attach, &sharp_z0194a_config,
d->fe[0] = dvb_attach(stv0299_attach, &sharp_z0194a_config,
&d->dev->i2c_adap);
if (d->fe != NULL) {
d->fe->ops.set_voltage = dw210x_set_voltage;
if (d->fe[0] != NULL) {
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
info("Attached stv0299!\n");
return 0;
}
......@@ -1090,9 +1090,9 @@ static int dw2102_frontend_attach(struct dvb_usb_adapter *d)
static int dw3101_frontend_attach(struct dvb_usb_adapter *d)
{
d->fe = dvb_attach(tda10023_attach, &dw3101_tda10023_config,
d->fe[0] = dvb_attach(tda10023_attach, &dw3101_tda10023_config,
&d->dev->i2c_adap, 0x48);
if (d->fe != NULL) {
if (d->fe[0] != NULL) {
info("Attached tda10023!\n");
return 0;
}
......@@ -1101,12 +1101,12 @@ static int dw3101_frontend_attach(struct dvb_usb_adapter *d)
static int zl100313_frontend_attach(struct dvb_usb_adapter *d)
{
d->fe = dvb_attach(mt312_attach, &zl313_config,
d->fe[0] = dvb_attach(mt312_attach, &zl313_config,
&d->dev->i2c_adap);
if (d->fe != NULL) {
if (dvb_attach(zl10039_attach, d->fe, 0x60,
if (d->fe[0] != NULL) {
if (dvb_attach(zl10039_attach, d->fe[0], 0x60,
&d->dev->i2c_adap)) {
d->fe->ops.set_voltage = dw210x_set_voltage;
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
info("Attached zl100313+zl10039!\n");
return 0;
}
......@@ -1119,16 +1119,16 @@ static int stv0288_frontend_attach(struct dvb_usb_adapter *d)
{
u8 obuf[] = {7, 1};
d->fe = dvb_attach(stv0288_attach, &earda_config,
d->fe[0] = dvb_attach(stv0288_attach, &earda_config,
&d->dev->i2c_adap);
if (d->fe == NULL)
if (d->fe[0] == NULL)
return -EIO;
if (NULL == dvb_attach(stb6000_attach, d->fe, 0x61, &d->dev->i2c_adap))
if (NULL == dvb_attach(stb6000_attach, d->fe[0], 0x61, &d->dev->i2c_adap))
return -EIO;
d->fe->ops.set_voltage = dw210x_set_voltage;
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
......@@ -1143,14 +1143,14 @@ static int ds3000_frontend_attach(struct dvb_usb_adapter *d)
struct s6x0_state *st = (struct s6x0_state *)d->dev->priv;
u8 obuf[] = {7, 1};
d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
d->fe[0] = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
&d->dev->i2c_adap);
if (d->fe == NULL)
if (d->fe[0] == NULL)
return -EIO;
st->old_set_voltage = d->fe->ops.set_voltage;
d->fe->ops.set_voltage = s660_set_voltage;
st->old_set_voltage = d->fe[0]->ops.set_voltage;
d->fe[0]->ops.set_voltage = s660_set_voltage;
dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
......@@ -1163,12 +1163,12 @@ static int prof_7500_frontend_attach(struct dvb_usb_adapter *d)
{
u8 obuf[] = {7, 1};
d->fe = dvb_attach(stv0900_attach, &prof_7500_stv0900_config,
d->fe[0] = dvb_attach(stv0900_attach, &prof_7500_stv0900_config,
&d->dev->i2c_adap, 0);
if (d->fe == NULL)
if (d->fe[0] == NULL)
return -EIO;
d->fe->ops.set_voltage = dw210x_set_voltage;
d->fe[0]->ops.set_voltage = dw210x_set_voltage;
dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
......@@ -1204,9 +1204,9 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
err("command 0x51 transfer failed.");
d->fe = dvb_attach(ds3000_attach, &su3000_ds3000_config,
d->fe[0] = dvb_attach(ds3000_attach, &su3000_ds3000_config,
&d->dev->i2c_adap);
if (d->fe == NULL)
if (d->fe[0] == NULL)
return -EIO;
info("Attached DS3000!\n");
......@@ -1216,14 +1216,14 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(dvb_pll_attach, adap->fe, 0x60,
dvb_attach(dvb_pll_attach, adap->fe[0], 0x60,
&adap->dev->i2c_adap, DVB_PLL_OPERA1);
return 0;
}
static int dw3101_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(dvb_pll_attach, adap->fe, 0x60,
dvb_attach(dvb_pll_attach, adap->fe[0], 0x60,
&adap->dev->i2c_adap, DVB_PLL_TUA6034);
return 0;
......
......@@ -200,9 +200,9 @@ static struct ec100_config ec168_ec100_config = {
static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap)
{
deb_info("%s:\n", __func__);
adap->fe = dvb_attach(ec100_attach, &ec168_ec100_config,
adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config,
&adap->dev->i2c_adap);
if (adap->fe == NULL)
if (adap->fe[0] == NULL)
return -ENODEV;
return 0;
......@@ -228,7 +228,7 @@ static struct mxl5005s_config ec168_mxl5003s_config = {
static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{
deb_info("%s:\n", __func__);
return dvb_attach(mxl5005s_attach, adap->fe, &adap->dev->i2c_adap,
return dvb_attach(mxl5005s_attach, adap->fe[0], &adap->dev->i2c_adap,
&ec168_mxl5003s_config) == NULL ? -ENODEV : 0;
}
......
......@@ -403,8 +403,8 @@ static int friio_frontend_attach(struct dvb_usb_adapter *adap)
if (friio_initialize(adap->dev) < 0)
return -EIO;
adap->fe = jdvbt90502_attach(adap->dev);
if (adap->fe == NULL)
adap->fe[0] = jdvbt90502_attach(adap->dev);
if (adap->fe[0] == NULL)
return -EIO;
return 0;
......
......@@ -103,9 +103,9 @@ static struct zl10353_config gl861_zl10353_config = {
static int gl861_frontend_attach(struct dvb_usb_adapter *adap)
{
adap->fe = dvb_attach(zl10353_attach, &gl861_zl10353_config,
adap->fe[0] = dvb_attach(zl10353_attach, &gl861_zl10353_config,
&adap->dev->i2c_adap);
if (adap->fe == NULL)
if (adap->fe[0] == NULL)
return -EIO;
return 0;
......@@ -118,7 +118,7 @@ static struct qt1010_config gl861_qt1010_config = {
static int gl861_tuner_attach(struct dvb_usb_adapter *adap)
{
return dvb_attach(qt1010_attach,
adap->fe, &adap->dev->i2c_adap,
adap->fe[0], &adap->dev->i2c_adap,
&gl861_qt1010_config) == NULL ? -ENODEV : 0;
}
......
......@@ -230,7 +230,7 @@ static int gp8psk_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
static int gp8psk_frontend_attach(struct dvb_usb_adapter *adap)
{
adap->fe = gp8psk_fe_attach(adap->dev);
adap->fe[0] = gp8psk_fe_attach(adap->dev);
return 0;
}
......
......@@ -941,7 +941,7 @@ static int lme_name(struct dvb_usb_adapter *adap)
const char *desc = adap->dev->desc->name;
char *fe_name[] = {"", " LG TDQY-P001F", " SHARP:BS2F7HZ7395",
" SHARP:BS2F7HZ0194"};
char *name = adap->fe->ops.info.name;
char *name = adap->fe[0]->ops.info.name;
strlcpy(name, desc, 128);
strlcat(name, fe_name[st->tuner_config], 128);
......@@ -958,10 +958,10 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
st->i2c_talk_onoff = 1;
st->i2c_gate = 4;
adap->fe = dvb_attach(tda10086_attach, &tda10086_config,
adap->fe[0] = dvb_attach(tda10086_attach, &tda10086_config,
&adap->dev->i2c_adap);
if (adap->fe) {
if (adap->fe[0]) {
info("TUN Found Frontend TDA10086");
st->i2c_tuner_gate_w = 4;
st->i2c_tuner_gate_r = 4;
......@@ -975,9 +975,9 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
}
st->i2c_gate = 4;
adap->fe = dvb_attach(stv0299_attach, &sharp_z0194_config,
adap->fe[0] = dvb_attach(stv0299_attach, &sharp_z0194_config,
&adap->dev->i2c_adap);
if (adap->fe) {
if (adap->fe[0]) {
info("FE Found Stv0299");
st->i2c_tuner_gate_w = 4;
st->i2c_tuner_gate_r = 5;
......@@ -991,9 +991,9 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
}
st->i2c_gate = 5;
adap->fe = dvb_attach(stv0288_attach, &lme_config,
adap->fe[0] = dvb_attach(stv0288_attach, &lme_config,
&adap->dev->i2c_adap);
if (adap->fe) {
if (adap->fe[0]) {
info("FE Found Stv0288");
st->i2c_tuner_gate_w = 4;
st->i2c_tuner_gate_r = 5;
......@@ -1010,15 +1010,15 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
end: if (ret) {
if (adap->fe) {
dvb_frontend_detach(adap->fe);
adap->fe = NULL;
if (adap->fe[0]) {
dvb_frontend_detach(adap->fe[0]);
adap->fe[0] = NULL;
}
adap->dev->props.rc.core.rc_codes = NULL;
return -ENODEV;
}
adap->fe->ops.set_voltage = dm04_lme2510_set_voltage;
adap->fe[0]->ops.set_voltage = dm04_lme2510_set_voltage;
ret = lme_name(adap);
return ret;
}
......@@ -1031,17 +1031,17 @@ static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap)
switch (st->tuner_config) {
case TUNER_LG:
if (dvb_attach(tda826x_attach, adap->fe, 0xc0,
if (dvb_attach(tda826x_attach, adap->fe[0], 0xc0,
&adap->dev->i2c_adap, 1))
ret = st->tuner_config;
break;
case TUNER_S7395:
if (dvb_attach(ix2505v_attach , adap->fe, &lme_tuner,
if (dvb_attach(ix2505v_attach , adap->fe[0], &lme_tuner,
&adap->dev->i2c_adap))
ret = st->tuner_config;
break;
case TUNER_S0194:
if (dvb_attach(dvb_pll_attach , adap->fe, 0xc0,
if (dvb_attach(dvb_pll_attach , adap->fe[0], 0xc0,
&adap->dev->i2c_adap, DVB_PLL_OPERA1))
ret = st->tuner_config;
break;
......
......@@ -501,7 +501,7 @@ static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
if ((adap->fe = dvb_attach(mt352_attach,
if ((adap->fe[0] = dvb_attach(mt352_attach,
&m920x_mt352_config,
&adap->dev->i2c_adap)) == NULL)
return -EIO;
......@@ -513,7 +513,7 @@ static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
if ((adap->fe = dvb_attach(tda10046_attach,
if ((adap->fe[0] = dvb_attach(tda10046_attach,
&m920x_tda10046_08_config,
&adap->dev->i2c_adap)) == NULL)
return -EIO;
......@@ -525,7 +525,7 @@ static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
if ((adap->fe = dvb_attach(tda10046_attach,
if ((adap->fe[0] = dvb_attach(tda10046_attach,
&m920x_tda10046_0b_config,
&adap->dev->i2c_adap)) == NULL)
return -EIO;
......@@ -537,7 +537,7 @@ static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
if (dvb_attach(qt1010_attach, adap->fe, &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL)
if (dvb_attach(qt1010_attach, adap->fe[0], &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL)
return -ENODEV;
return 0;
......@@ -547,7 +547,7 @@ static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
if (dvb_attach(tda827x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, NULL) == NULL)
if (dvb_attach(tda827x_attach, adap->fe[0], 0x60, &adap->dev->i2c_adap, NULL) == NULL)
return -ENODEV;
return 0;
......@@ -557,7 +557,7 @@ static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap)
{
deb("%s\n",__func__);
if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL)
if (dvb_attach(tda827x_attach, adap->fe[0], 0x61, &adap->dev->i2c_adap, NULL) == NULL)
return -ENODEV;
return 0;
......@@ -565,7 +565,7 @@ static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap)
static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(simple_tuner_attach, adap->fe,
dvb_attach(simple_tuner_attach, adap->fe[0],
&adap->dev->i2c_adap, 0x61,
TUNER_PHILIPS_FMD1216ME_MK3);
return 0;
......
......@@ -263,10 +263,10 @@ static struct stv0299_config opera1_stv0299_config = {
static int opera1_frontend_attach(struct dvb_usb_adapter *d)
{
if ((d->fe =
if ((d->fe[0] =
dvb_attach(stv0299_attach, &opera1_stv0299_config,
&d->dev->i2c_adap)) != NULL) {
d->fe->ops.set_voltage = opera1_set_voltage;
d->fe[0]->ops.set_voltage = opera1_set_voltage;
return 0;
}
info("not attached stv0299");
......@@ -276,7 +276,7 @@ static int opera1_frontend_attach(struct dvb_usb_adapter *d)
static int opera1_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(
dvb_pll_attach, adap->fe, 0xc0>>1,
dvb_pll_attach, adap->fe[0], 0xc0>>1,
&adap->dev->i2c_adap, DVB_PLL_OPERA1
);
return 0;
......
......@@ -292,7 +292,7 @@ static void technisat_usb2_green_led_control(struct work_struct *work)
{
struct technisat_usb2_state *state =
container_of(work, struct technisat_usb2_state, green_led_work.work);
struct dvb_frontend *fe = state->dev->adapter[0].fe;
struct dvb_frontend *fe = state->dev->adapter[0].fe[0];
if (state->power_state == 0)
goto schedule;
......@@ -505,14 +505,14 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
struct usb_device *udev = a->dev->udev;
int ret;
a->fe = dvb_attach(stv090x_attach, &technisat_usb2_stv090x_config,
a->fe[0] = dvb_attach(stv090x_attach, &technisat_usb2_stv090x_config,
&a->dev->i2c_adap, STV090x_DEMODULATOR_0);
if (a->fe) {
if (a->fe[0]) {
struct stv6110x_devctl *ctl;
ctl = dvb_attach(stv6110x_attach,
a->fe,
a->fe[0],
&technisat_usb2_stv6110x_config,
&a->dev->i2c_adap);
......@@ -532,8 +532,8 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
/* call the init function once to initialize
tuner's clock output divider and demod's
master clock */
if (a->fe->ops.init)
a->fe->ops.init(a->fe);
if (a->fe[0]->ops.init)
a->fe[0]->ops.init(a->fe[0]);
if (mutex_lock_interruptible(&a->dev->i2c_mutex) < 0)
return -EAGAIN;
......@@ -548,20 +548,20 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
if (ret != 0)
err("could not set IF_CLK to external");
a->fe->ops.set_voltage = technisat_usb2_set_voltage;
a->fe[0]->ops.set_voltage = technisat_usb2_set_voltage;
/* if everything was successful assign a nice name to the frontend */
strlcpy(a->fe->ops.info.name, a->dev->desc->name,
sizeof(a->fe->ops.info.name));
strlcpy(a->fe[0]->ops.info.name, a->dev->desc->name,
sizeof(a->fe[0]->ops.info.name));
} else {
dvb_frontend_detach(a->fe);
a->fe = NULL;
dvb_frontend_detach(a->fe[0]);
a->fe[0] = NULL;
}
}
technisat_usb2_set_led_timer(a->dev, 1, 1);
return a->fe == NULL ? -ENODEV : 0;
return a->fe[0] == NULL ? -ENODEV : 0;
}
/* Remote control */
......
......@@ -195,7 +195,7 @@ static int ttusb2_frontend_tda10086_attach(struct dvb_usb_adapter *adap)
if (usb_set_interface(adap->dev->udev,0,3) < 0)
err("set interface to alts=3 failed");
if ((adap->fe = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) == NULL) {
if ((adap->fe[0] = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) == NULL) {
deb_info("TDA10086 attach failed\n");
return -ENODEV;
}
......@@ -207,7 +207,7 @@ static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap)
{
if (usb_set_interface(adap->dev->udev, 0, 3) < 0)
err("set interface to alts=3 failed");
if ((adap->fe = dvb_attach(tda10023_attach, &tda10023_config, &adap->dev->i2c_adap, 0x48)) == NULL) {
if ((adap->fe[0] = dvb_attach(tda10023_attach, &tda10023_config, &adap->dev->i2c_adap, 0x48)) == NULL) {
deb_info("TDA10023 attach failed\n");
return -ENODEV;
}
......@@ -216,7 +216,7 @@ static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap)
static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap)
{
if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL) {
if (dvb_attach(tda827x_attach, adap->fe[0], 0x61, &adap->dev->i2c_adap, NULL) == NULL) {
printk(KERN_ERR "%s: No tda827x found!\n", __func__);
return -ENODEV;
}
......@@ -225,12 +225,12 @@ static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap)
static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap)
{
if (dvb_attach(tda826x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) {
if (dvb_attach(tda826x_attach, adap->fe[0], 0x60, &adap->dev->i2c_adap, 0) == NULL) {
deb_info("TDA8263 attach failed\n");
return -ENODEV;
}
if (dvb_attach(lnbp21_attach, adap->fe, &adap->dev->i2c_adap, 0, 0) == NULL) {
if (dvb_attach(lnbp21_attach, adap->fe[0], &adap->dev->i2c_adap, 0, 0) == NULL) {
deb_info("LNBP21 attach failed\n");
return -ENODEV;
}
......
......@@ -60,14 +60,14 @@ static int umt_mt352_frontend_attach(struct dvb_usb_adapter *adap)
umt_config.demod_init = umt_mt352_demod_init;
umt_config.demod_address = 0xf;
adap->fe = dvb_attach(mt352_attach, &umt_config, &adap->dev->i2c_adap);
adap->fe[0] = dvb_attach(mt352_attach, &umt_config, &adap->dev->i2c_adap);
return 0;
}
static int umt_tuner_attach (struct dvb_usb_adapter *adap)
{
dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, DVB_PLL_TUA6034);
dvb_attach(dvb_pll_attach, adap->fe[0], 0x61, NULL, DVB_PLL_TUA6034);
return 0;
}
......
......@@ -320,7 +320,7 @@ static int vp702x_frontend_attach(struct dvb_usb_adapter *adap)
vp702x_init_pid_filter(adap);
adap->fe = vp702x_fe_attach(adap->dev);
adap->fe[0] = vp702x_fe_attach(adap->dev);
vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 1, 7, NULL, 0);
return 0;
......
......@@ -214,7 +214,7 @@ static int vp7045_frontend_attach(struct dvb_usb_adapter *adap)
/* Dump the EEPROM */
/* vp7045_read_eeprom(d,buf, 255, FX2_ID_ADDR); */
adap->fe = vp7045_fe_attach(adap->dev);
adap->fe[0] = vp7045_fe_attach(adap->dev);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment