Commit 77eed219 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

[media] dvb-usb: refactor MFE code for individual streaming config per frontend

refactor MFE code to allow for individual streaming configuration
for each frontend
Signed-off-by: default avatarMichael Krufky <mkrufky@kernellabs.com>
Reviewed-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 4c66c920
...@@ -127,6 +127,8 @@ static struct dvb_usb_device_properties a800_properties = { ...@@ -127,6 +127,8 @@ static struct dvb_usb_device_properties a800_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
.pid_filter_count = 32, .pid_filter_count = 32,
.streaming_ctrl = dibusb2_0_streaming_ctrl, .streaming_ctrl = dibusb2_0_streaming_ctrl,
...@@ -147,7 +149,7 @@ static struct dvb_usb_device_properties a800_properties = { ...@@ -147,7 +149,7 @@ static struct dvb_usb_device_properties a800_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct dibusb_state), .size_of_priv = sizeof(struct dibusb_state),
}, },
}, },
......
...@@ -815,7 +815,7 @@ static int af9005_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -815,7 +815,7 @@ static int af9005_frontend_attach(struct dvb_usb_adapter *adap)
debug_dump(buf, 8, printk); debug_dump(buf, 8, printk);
} }
} }
adap->fe[0] = af9005_fe_attach(adap->dev); adap->fe_adap[0].fe = af9005_fe_attach(adap->dev);
return 0; return 0;
} }
...@@ -999,6 +999,8 @@ static struct dvb_usb_device_properties af9005_properties = { ...@@ -999,6 +999,8 @@ static struct dvb_usb_device_properties af9005_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = .caps =
DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -1018,6 +1020,7 @@ static struct dvb_usb_device_properties af9005_properties = { ...@@ -1018,6 +1020,7 @@ static struct dvb_usb_device_properties af9005_properties = {
} }
} }
}, },
}},
} }
}, },
.power_ctrl = af9005_power_ctrl, .power_ctrl = af9005_power_ctrl,
......
...@@ -861,13 +861,13 @@ static int af9015_read_config(struct usb_device *udev) ...@@ -861,13 +861,13 @@ static int af9015_read_config(struct usb_device *udev)
for (i = 0; i < af9015_properties_count; i++) { for (i = 0; i < af9015_properties_count; i++) {
/* USB1.1 set smaller buffersize and disable 2nd adapter */ /* USB1.1 set smaller buffersize and disable 2nd adapter */
if (udev->speed == USB_SPEED_FULL) { if (udev->speed == USB_SPEED_FULL) {
af9015_properties[i].adapter[0].stream.u.bulk.buffersize af9015_properties[i].adapter[0].fe[0].stream.u.bulk.buffersize
= TS_USB11_FRAME_SIZE; = TS_USB11_FRAME_SIZE;
/* disable 2nd adapter because we don't have /* disable 2nd adapter because we don't have
PID-filters */ PID-filters */
af9015_config.dual_mode = 0; af9015_config.dual_mode = 0;
} else { } else {
af9015_properties[i].adapter[0].stream.u.bulk.buffersize af9015_properties[i].adapter[0].fe[0].stream.u.bulk.buffersize
= TS_USB20_FRAME_SIZE; = TS_USB20_FRAME_SIZE;
} }
} }
...@@ -1113,10 +1113,10 @@ static int af9015_af9013_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -1113,10 +1113,10 @@ static int af9015_af9013_frontend_attach(struct dvb_usb_adapter *adap)
} }
/* attach demodulator */ /* attach demodulator */
adap->fe[0] = dvb_attach(af9013_attach, &af9015_af9013_config[adap->id], adap->fe_adap[0].fe = dvb_attach(af9013_attach, &af9015_af9013_config[adap->id],
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
return adap->fe[0] == NULL ? -ENODEV : 0; return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
} }
static struct mt2060_config af9015_mt2060_config = { static struct mt2060_config af9015_mt2060_config = {
...@@ -1190,49 +1190,49 @@ static int af9015_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -1190,49 +1190,49 @@ static int af9015_tuner_attach(struct dvb_usb_adapter *adap)
switch (af9015_af9013_config[adap->id].tuner) { switch (af9015_af9013_config[adap->id].tuner) {
case AF9013_TUNER_MT2060: case AF9013_TUNER_MT2060:
case AF9013_TUNER_MT2060_2: case AF9013_TUNER_MT2060_2:
ret = dvb_attach(mt2060_attach, adap->fe[0], &adap->dev->i2c_adap, ret = dvb_attach(mt2060_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
&af9015_mt2060_config, &af9015_mt2060_config,
af9015_config.mt2060_if1[adap->id]) af9015_config.mt2060_if1[adap->id])
== NULL ? -ENODEV : 0; == NULL ? -ENODEV : 0;
break; break;
case AF9013_TUNER_QT1010: case AF9013_TUNER_QT1010:
case AF9013_TUNER_QT1010A: case AF9013_TUNER_QT1010A:
ret = dvb_attach(qt1010_attach, adap->fe[0], &adap->dev->i2c_adap, ret = dvb_attach(qt1010_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
&af9015_qt1010_config) == NULL ? -ENODEV : 0; &af9015_qt1010_config) == NULL ? -ENODEV : 0;
break; break;
case AF9013_TUNER_TDA18271: case AF9013_TUNER_TDA18271:
ret = dvb_attach(tda18271_attach, adap->fe[0], 0xc0, ret = dvb_attach(tda18271_attach, adap->fe_adap[0].fe, 0xc0,
&adap->dev->i2c_adap, &adap->dev->i2c_adap,
&af9015_tda18271_config) == NULL ? -ENODEV : 0; &af9015_tda18271_config) == NULL ? -ENODEV : 0;
break; break;
case AF9013_TUNER_TDA18218: case AF9013_TUNER_TDA18218:
ret = dvb_attach(tda18218_attach, adap->fe[0], ret = dvb_attach(tda18218_attach, adap->fe_adap[0].fe,
&adap->dev->i2c_adap, &adap->dev->i2c_adap,
&af9015_tda18218_config) == NULL ? -ENODEV : 0; &af9015_tda18218_config) == NULL ? -ENODEV : 0;
break; break;
case AF9013_TUNER_MXL5003D: case AF9013_TUNER_MXL5003D:
ret = dvb_attach(mxl5005s_attach, adap->fe[0], ret = dvb_attach(mxl5005s_attach, adap->fe_adap[0].fe,
&adap->dev->i2c_adap, &adap->dev->i2c_adap,
&af9015_mxl5003_config) == NULL ? -ENODEV : 0; &af9015_mxl5003_config) == NULL ? -ENODEV : 0;
break; break;
case AF9013_TUNER_MXL5005D: case AF9013_TUNER_MXL5005D:
case AF9013_TUNER_MXL5005R: case AF9013_TUNER_MXL5005R:
ret = dvb_attach(mxl5005s_attach, adap->fe[0], ret = dvb_attach(mxl5005s_attach, adap->fe_adap[0].fe,
&adap->dev->i2c_adap, &adap->dev->i2c_adap,
&af9015_mxl5005_config) == NULL ? -ENODEV : 0; &af9015_mxl5005_config) == NULL ? -ENODEV : 0;
break; break;
case AF9013_TUNER_ENV77H11D5: case AF9013_TUNER_ENV77H11D5:
ret = dvb_attach(dvb_pll_attach, adap->fe[0], 0xc0, ret = dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0xc0,
&adap->dev->i2c_adap, &adap->dev->i2c_adap,
DVB_PLL_TDA665X) == NULL ? -ENODEV : 0; DVB_PLL_TDA665X) == NULL ? -ENODEV : 0;
break; break;
case AF9013_TUNER_MC44S803: case AF9013_TUNER_MC44S803:
ret = dvb_attach(mc44s803_attach, adap->fe[0], ret = dvb_attach(mc44s803_attach, adap->fe_adap[0].fe,
&adap->dev->i2c_adap, &adap->dev->i2c_adap,
&af9015_mc44s803_config) == NULL ? -ENODEV : 0; &af9015_mc44s803_config) == NULL ? -ENODEV : 0;
break; break;
case AF9013_TUNER_MXL5007T: case AF9013_TUNER_MXL5007T:
ret = dvb_attach(mxl5007t_attach, adap->fe[0], ret = dvb_attach(mxl5007t_attach, adap->fe_adap[0].fe,
&adap->dev->i2c_adap, &adap->dev->i2c_adap,
0xc0, &af9015_mxl5007t_config) == NULL ? -ENODEV : 0; 0xc0, &af9015_mxl5007t_config) == NULL ? -ENODEV : 0;
break; break;
...@@ -1306,6 +1306,8 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1306,6 +1306,8 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.num_adapters = 2, .num_adapters = 2,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -1321,8 +1323,11 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1321,8 +1323,11 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.count = 6, .count = 6,
.endpoint = 0x84, .endpoint = 0x84,
}, },
}},
}, },
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = .frontend_attach =
af9015_af9013_frontend_attach, af9015_af9013_frontend_attach,
.tuner_attach = af9015_tuner_attach, .tuner_attach = af9015_tuner_attach,
...@@ -1337,6 +1342,7 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1337,6 +1342,7 @@ static struct dvb_usb_device_properties af9015_properties[] = {
} }
} }
}, },
}},
} }
}, },
...@@ -1434,6 +1440,8 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1434,6 +1440,8 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.num_adapters = 2, .num_adapters = 2,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -1449,8 +1457,11 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1449,8 +1457,11 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.count = 6, .count = 6,
.endpoint = 0x84, .endpoint = 0x84,
}, },
}},
}, },
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = .frontend_attach =
af9015_af9013_frontend_attach, af9015_af9013_frontend_attach,
.tuner_attach = af9015_tuner_attach, .tuner_attach = af9015_tuner_attach,
...@@ -1465,6 +1476,7 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1465,6 +1476,7 @@ static struct dvb_usb_device_properties af9015_properties[] = {
} }
} }
}, },
}},
} }
}, },
...@@ -1551,6 +1563,8 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1551,6 +1563,8 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.num_adapters = 2, .num_adapters = 2,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -1566,8 +1580,11 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1566,8 +1580,11 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.count = 6, .count = 6,
.endpoint = 0x84, .endpoint = 0x84,
}, },
}},
}, },
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = .frontend_attach =
af9015_af9013_frontend_attach, af9015_af9013_frontend_attach,
.tuner_attach = af9015_tuner_attach, .tuner_attach = af9015_tuner_attach,
...@@ -1582,6 +1599,7 @@ static struct dvb_usb_device_properties af9015_properties[] = { ...@@ -1582,6 +1599,7 @@ static struct dvb_usb_device_properties af9015_properties[] = {
} }
} }
}, },
}},
} }
}, },
......
...@@ -575,7 +575,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -575,7 +575,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
}; };
/* detect hardware only once */ /* detect hardware only once */
if (adap->fe[0] == NULL) { if (adap->fe_adap[0].fe == NULL) {
/* Check which hardware we have. /* Check which hardware we have.
* We must do this call two times to get reliable values (hw bug). * We must do this call two times to get reliable values (hw bug).
*/ */
...@@ -595,7 +595,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -595,7 +595,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
} }
/* set current frondend ID for devices having two frondends */ /* set current frondend ID for devices having two frondends */
if (adap->fe[0]) if (adap->fe_adap[0].fe)
state->fe_id++; state->fe_id++;
switch (state->hw) { switch (state->hw) {
...@@ -606,13 +606,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -606,13 +606,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
break; break;
/* attach demod */ /* attach demod */
adap->fe[0] = dvb_attach(mt352_attach, &anysee_mt352_config, adap->fe_adap[0].fe = dvb_attach(mt352_attach, &anysee_mt352_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0]) if (adap->fe_adap[0].fe)
break; break;
/* attach demod */ /* attach demod */
adap->fe[0] = dvb_attach(zl10353_attach, &anysee_zl10353_config, adap->fe_adap[0].fe = dvb_attach(zl10353_attach, &anysee_zl10353_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
break; break;
...@@ -633,7 +633,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -633,7 +633,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach demod */ /* attach demod */
adap->fe[0] = dvb_attach(zl10353_attach, adap->fe_adap[0].fe = dvb_attach(zl10353_attach,
&anysee_zl10353_config, &adap->dev->i2c_adap); &anysee_zl10353_config, &adap->dev->i2c_adap);
break; break;
...@@ -649,7 +649,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -649,7 +649,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach demod */ /* attach demod */
adap->fe[0] = dvb_attach(tda10023_attach, adap->fe_adap[0].fe = dvb_attach(tda10023_attach,
&anysee_tda10023_config, &adap->dev->i2c_adap, 0x48); &anysee_tda10023_config, &adap->dev->i2c_adap, 0x48);
break; break;
...@@ -665,7 +665,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -665,7 +665,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach demod */ /* attach demod */
adap->fe[0] = dvb_attach(cx24116_attach, &anysee_cx24116_config, adap->fe_adap[0].fe = dvb_attach(cx24116_attach, &anysee_cx24116_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
break; break;
...@@ -707,13 +707,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -707,13 +707,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
/* attach demod */ /* attach demod */
if (tmp == 0xc7) { if (tmp == 0xc7) {
/* TDA18212 config */ /* TDA18212 config */
adap->fe[state->fe_id] = dvb_attach( adap->fe_adap[state->fe_id].fe = dvb_attach(
tda10023_attach, tda10023_attach,
&anysee_tda10023_tda18212_config, &anysee_tda10023_tda18212_config,
&adap->dev->i2c_adap, 0x48); &adap->dev->i2c_adap, 0x48);
} else { } else {
/* PLL config */ /* PLL config */
adap->fe[state->fe_id] = dvb_attach( adap->fe_adap[state->fe_id].fe = dvb_attach(
tda10023_attach, tda10023_attach,
&anysee_tda10023_config, &anysee_tda10023_config,
&adap->dev->i2c_adap, 0x48); &adap->dev->i2c_adap, 0x48);
...@@ -734,13 +734,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -734,13 +734,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
/* attach demod */ /* attach demod */
if (tmp == 0xc7) { if (tmp == 0xc7) {
/* TDA18212 config */ /* TDA18212 config */
adap->fe[state->fe_id] = dvb_attach( adap->fe_adap[state->fe_id].fe = dvb_attach(
zl10353_attach, zl10353_attach,
&anysee_zl10353_tda18212_config2, &anysee_zl10353_tda18212_config2,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
} else { } else {
/* PLL config */ /* PLL config */
adap->fe[state->fe_id] = dvb_attach( adap->fe_adap[state->fe_id].fe = dvb_attach(
zl10353_attach, zl10353_attach,
&anysee_zl10353_config, &anysee_zl10353_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
...@@ -772,7 +772,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -772,7 +772,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach demod */ /* attach demod */
adap->fe[state->fe_id] = dvb_attach(tda10023_attach, adap->fe_adap[state->fe_id].fe = dvb_attach(tda10023_attach,
&anysee_tda10023_tda18212_config, &anysee_tda10023_tda18212_config,
&adap->dev->i2c_adap, 0x48); &adap->dev->i2c_adap, 0x48);
} else { } else {
...@@ -789,7 +789,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -789,7 +789,7 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach demod */ /* attach demod */
adap->fe[state->fe_id] = dvb_attach(zl10353_attach, adap->fe_adap[state->fe_id].fe = dvb_attach(zl10353_attach,
&anysee_zl10353_tda18212_config, &anysee_zl10353_tda18212_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
} }
...@@ -814,13 +814,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -814,13 +814,13 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach demod */ /* attach demod */
adap->fe[0] = dvb_attach(stv0900_attach, &anysee_stv0900_config, adap->fe_adap[0].fe = dvb_attach(stv0900_attach, &anysee_stv0900_config,
&adap->dev->i2c_adap, 0); &adap->dev->i2c_adap, 0);
break; break;
} }
if (!adap->fe[0]) { if (!adap->fe_adap[0].fe) {
/* we have no frontend :-( */ /* we have no frontend :-( */
ret = -ENODEV; ret = -ENODEV;
err("Unsupported Anysee version. " \ err("Unsupported Anysee version. " \
...@@ -842,7 +842,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -842,7 +842,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E30 */ /* E30 */
/* attach tuner */ /* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe[0], (0xc2 >> 1), fe = dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, (0xc2 >> 1),
NULL, DVB_PLL_THOMSON_DTT7579); NULL, DVB_PLL_THOMSON_DTT7579);
break; break;
...@@ -850,7 +850,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -850,7 +850,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E30 Plus */ /* E30 Plus */
/* attach tuner */ /* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe[0], (0xc2 >> 1), fe = dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, (0xc2 >> 1),
&adap->dev->i2c_adap, DVB_PLL_THOMSON_DTT7579); &adap->dev->i2c_adap, DVB_PLL_THOMSON_DTT7579);
break; break;
...@@ -858,7 +858,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -858,7 +858,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E30 C Plus */ /* E30 C Plus */
/* attach tuner */ /* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe[0], (0xc0 >> 1), fe = dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, (0xc0 >> 1),
&adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A); &adap->dev->i2c_adap, DVB_PLL_SAMSUNG_DTOS403IH102A);
break; break;
...@@ -866,7 +866,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -866,7 +866,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E30 S2 Plus */ /* E30 S2 Plus */
/* attach LNB controller */ /* attach LNB controller */
fe = dvb_attach(isl6423_attach, adap->fe[0], fe = dvb_attach(isl6423_attach, adap->fe_adap[0].fe,
&adap->dev->i2c_adap, &anysee_isl6423_config); &adap->dev->i2c_adap, &anysee_isl6423_config);
break; break;
...@@ -883,7 +883,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -883,7 +883,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach tuner */ /* attach tuner */
fe = dvb_attach(tda18212_attach, adap->fe[state->fe_id], fe = dvb_attach(tda18212_attach, adap->fe_adap[state->fe_id].fe,
&adap->dev->i2c_adap, &anysee_tda18212_config); &adap->dev->i2c_adap, &anysee_tda18212_config);
if (fe) if (fe)
break; break;
...@@ -894,7 +894,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -894,7 +894,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach tuner */ /* attach tuner */
fe = dvb_attach(dvb_pll_attach, adap->fe[state->fe_id], fe = dvb_attach(dvb_pll_attach, adap->fe_adap[state->fe_id].fe,
(0xc0 >> 1), &adap->dev->i2c_adap, (0xc0 >> 1), &adap->dev->i2c_adap,
DVB_PLL_SAMSUNG_DTOS403IH102A); DVB_PLL_SAMSUNG_DTOS403IH102A);
...@@ -910,7 +910,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -910,7 +910,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
goto error; goto error;
/* attach tuner */ /* attach tuner */
fe = dvb_attach(tda18212_attach, adap->fe[state->fe_id], fe = dvb_attach(tda18212_attach, adap->fe_adap[state->fe_id].fe,
&adap->dev->i2c_adap, &anysee_tda18212_config); &adap->dev->i2c_adap, &anysee_tda18212_config);
break; break;
...@@ -920,12 +920,12 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -920,12 +920,12 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
/* E7 PS2 */ /* E7 PS2 */
/* attach tuner */ /* attach tuner */
fe = dvb_attach(stv6110_attach, adap->fe[0], fe = dvb_attach(stv6110_attach, adap->fe_adap[0].fe,
&anysee_stv6110_config, &adap->dev->i2c_adap); &anysee_stv6110_config, &adap->dev->i2c_adap);
if (fe) { if (fe) {
/* attach LNB controller */ /* attach LNB controller */
fe = dvb_attach(isl6423_attach, adap->fe[0], fe = dvb_attach(isl6423_attach, adap->fe_adap[0].fe,
&adap->dev->i2c_adap, &anysee_isl6423_config); &adap->dev->i2c_adap, &anysee_isl6423_config);
} }
...@@ -1029,6 +1029,7 @@ static struct dvb_usb_device_properties anysee_properties = { ...@@ -1029,6 +1029,7 @@ static struct dvb_usb_device_properties anysee_properties = {
{ {
.num_frontends = 2, .num_frontends = 2,
.frontend_ctrl = anysee_frontend_ctrl, .frontend_ctrl = anysee_frontend_ctrl,
.fe = {{
.streaming_ctrl = anysee_streaming_ctrl, .streaming_ctrl = anysee_streaming_ctrl,
.frontend_attach = anysee_frontend_attach, .frontend_attach = anysee_frontend_attach,
.tuner_attach = anysee_tuner_attach, .tuner_attach = anysee_tuner_attach,
...@@ -1042,6 +1043,21 @@ static struct dvb_usb_device_properties anysee_properties = { ...@@ -1042,6 +1043,21 @@ static struct dvb_usb_device_properties anysee_properties = {
} }
} }
}, },
}, {
.streaming_ctrl = anysee_streaming_ctrl,
.frontend_attach = anysee_frontend_attach,
.tuner_attach = anysee_tuner_attach,
.stream = {
.type = USB_BULK,
.count = 8,
.endpoint = 0x82,
.u = {
.bulk = {
.buffersize = (16*512),
}
}
},
}},
} }
}, },
......
...@@ -140,9 +140,9 @@ static struct zl10353_config au6610_zl10353_config = { ...@@ -140,9 +140,9 @@ static struct zl10353_config au6610_zl10353_config = {
static int au6610_zl10353_frontend_attach(struct dvb_usb_adapter *adap) static int au6610_zl10353_frontend_attach(struct dvb_usb_adapter *adap)
{ {
adap->fe[0] = dvb_attach(zl10353_attach, &au6610_zl10353_config, adap->fe_adap[0].fe = dvb_attach(zl10353_attach, &au6610_zl10353_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0] == NULL) if (adap->fe_adap[0].fe == NULL)
return -ENODEV; return -ENODEV;
return 0; return 0;
...@@ -155,7 +155,7 @@ static struct qt1010_config au6610_qt1010_config = { ...@@ -155,7 +155,7 @@ static struct qt1010_config au6610_qt1010_config = {
static int au6610_qt1010_tuner_attach(struct dvb_usb_adapter *adap) static int au6610_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
{ {
return dvb_attach(qt1010_attach, return dvb_attach(qt1010_attach,
adap->fe[0], &adap->dev->i2c_adap, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
&au6610_qt1010_config) == NULL ? -ENODEV : 0; &au6610_qt1010_config) == NULL ? -ENODEV : 0;
} }
...@@ -204,6 +204,8 @@ static struct dvb_usb_device_properties au6610_properties = { ...@@ -204,6 +204,8 @@ static struct dvb_usb_device_properties au6610_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = au6610_zl10353_frontend_attach, .frontend_attach = au6610_zl10353_frontend_attach,
.tuner_attach = au6610_qt1010_tuner_attach, .tuner_attach = au6610_qt1010_tuner_attach,
...@@ -219,6 +221,7 @@ static struct dvb_usb_device_properties au6610_properties = { ...@@ -219,6 +221,7 @@ static struct dvb_usb_device_properties au6610_properties = {
} }
} }
}, },
}},
} }
}, },
......
...@@ -910,16 +910,16 @@ static int az6027_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -910,16 +910,16 @@ static int az6027_frontend_attach(struct dvb_usb_adapter *adap)
az6027_frontend_reset(adap); az6027_frontend_reset(adap);
deb_info("adap = %p, dev = %p\n", adap, adap->dev); deb_info("adap = %p, dev = %p\n", adap, adap->dev);
adap->fe[0] = stb0899_attach(&az6027_stb0899_config, &adap->dev->i2c_adap); adap->fe_adap[0].fe = stb0899_attach(&az6027_stb0899_config, &adap->dev->i2c_adap);
if (adap->fe[0]) { if (adap->fe_adap[0].fe) {
deb_info("found STB0899 DVB-S/DVB-S2 frontend @0x%02x", az6027_stb0899_config.demod_address); deb_info("found STB0899 DVB-S/DVB-S2 frontend @0x%02x", az6027_stb0899_config.demod_address);
if (stb6100_attach(adap->fe[0], &az6027_stb6100_config, &adap->dev->i2c_adap)) { if (stb6100_attach(adap->fe_adap[0].fe, &az6027_stb6100_config, &adap->dev->i2c_adap)) {
deb_info("found STB6100 DVB-S/DVB-S2 frontend @0x%02x", az6027_stb6100_config.tuner_address); deb_info("found STB6100 DVB-S/DVB-S2 frontend @0x%02x", az6027_stb6100_config.tuner_address);
adap->fe[0]->ops.set_voltage = az6027_set_voltage; adap->fe_adap[0].fe->ops.set_voltage = az6027_set_voltage;
az6027_ci_init(adap); az6027_ci_init(adap);
} else { } else {
adap->fe[0] = NULL; adap->fe_adap[0].fe = NULL;
} }
} else } else
warn("no front-end attached\n"); warn("no front-end attached\n");
...@@ -1106,6 +1106,8 @@ static struct dvb_usb_device_properties az6027_properties = { ...@@ -1106,6 +1106,8 @@ static struct dvb_usb_device_properties az6027_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.streaming_ctrl = az6027_streaming_ctrl, .streaming_ctrl = az6027_streaming_ctrl,
.frontend_attach = az6027_frontend_attach, .frontend_attach = az6027_frontend_attach,
...@@ -1120,6 +1122,7 @@ static struct dvb_usb_device_properties az6027_properties = { ...@@ -1120,6 +1122,7 @@ static struct dvb_usb_device_properties az6027_properties = {
} }
} }
}, },
}},
} }
}, },
/* /*
......
...@@ -186,9 +186,9 @@ static struct zl10353_config ce6230_zl10353_config = { ...@@ -186,9 +186,9 @@ static struct zl10353_config ce6230_zl10353_config = {
static int ce6230_zl10353_frontend_attach(struct dvb_usb_adapter *adap) static int ce6230_zl10353_frontend_attach(struct dvb_usb_adapter *adap)
{ {
deb_info("%s:\n", __func__); deb_info("%s:\n", __func__);
adap->fe[0] = dvb_attach(zl10353_attach, &ce6230_zl10353_config, adap->fe_adap[0].fe = dvb_attach(zl10353_attach, &ce6230_zl10353_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0] == NULL) if (adap->fe_adap[0].fe == NULL)
return -ENODEV; return -ENODEV;
return 0; return 0;
} }
...@@ -214,7 +214,7 @@ static int ce6230_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -214,7 +214,7 @@ static int ce6230_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{ {
int ret; int ret;
deb_info("%s:\n", __func__); deb_info("%s:\n", __func__);
ret = dvb_attach(mxl5005s_attach, adap->fe[0], &adap->dev->i2c_adap, ret = dvb_attach(mxl5005s_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
&ce6230_mxl5003s_config) == NULL ? -ENODEV : 0; &ce6230_mxl5003s_config) == NULL ? -ENODEV : 0;
return ret; return ret;
} }
...@@ -273,6 +273,8 @@ static struct dvb_usb_device_properties ce6230_properties = { ...@@ -273,6 +273,8 @@ static struct dvb_usb_device_properties ce6230_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = ce6230_zl10353_frontend_attach, .frontend_attach = ce6230_zl10353_frontend_attach,
.tuner_attach = ce6230_mxl5003s_tuner_attach, .tuner_attach = ce6230_mxl5003s_tuner_attach,
.stream = { .stream = {
...@@ -285,6 +287,7 @@ static struct dvb_usb_device_properties ce6230_properties = { ...@@ -285,6 +287,7 @@ static struct dvb_usb_device_properties ce6230_properties = {
} }
} }
}, },
}},
} }
}, },
......
...@@ -69,7 +69,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -69,7 +69,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap)
char state[3]; char state[3];
int ret; int ret;
adap->fe[0] = cinergyt2_fe_attach(adap->dev); adap->fe_adap[0].fe = cinergyt2_fe_attach(adap->dev);
ret = dvb_usb_generic_rw(adap->dev, query, sizeof(query), state, ret = dvb_usb_generic_rw(adap->dev, query, sizeof(query), state,
sizeof(state), 0); sizeof(state), 0);
...@@ -198,6 +198,8 @@ static struct dvb_usb_device_properties cinergyt2_properties = { ...@@ -198,6 +198,8 @@ static struct dvb_usb_device_properties cinergyt2_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.streaming_ctrl = cinergyt2_streaming_ctrl, .streaming_ctrl = cinergyt2_streaming_ctrl,
.frontend_attach = cinergyt2_frontend_attach, .frontend_attach = cinergyt2_frontend_attach,
...@@ -212,6 +214,7 @@ static struct dvb_usb_device_properties cinergyt2_properties = { ...@@ -212,6 +214,7 @@ static struct dvb_usb_device_properties cinergyt2_properties = {
} }
} }
}, },
}},
} }
}, },
......
This diff is collapsed.
...@@ -528,13 +528,13 @@ int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw ...@@ -528,13 +528,13 @@ int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw
for (adap_num = 0; adap_num < dib0700_devices[i].num_adapters; for (adap_num = 0; adap_num < dib0700_devices[i].num_adapters;
adap_num++) { adap_num++) {
if (fw_version >= 0x10201) { if (fw_version >= 0x10201) {
dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = 188*nb_packet_buffer_size; dib0700_devices[i].adapter[adap_num].fe[0].stream.u.bulk.buffersize = 188*nb_packet_buffer_size;
} else { } else {
/* for fw version older than 1.20.1, /* for fw version older than 1.20.1,
* the buffersize has to be n times 512 */ * the buffersize has to be n times 512 */
dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = ((188*nb_packet_buffer_size+188/2)/512)*512; dib0700_devices[i].adapter[adap_num].fe[0].stream.u.bulk.buffersize = ((188*nb_packet_buffer_size+188/2)/512)*512;
if (dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize < 512) if (dib0700_devices[i].adapter[adap_num].fe[0].stream.u.bulk.buffersize < 512)
dib0700_devices[i].adapter[adap_num].stream.u.bulk.buffersize = 512; dib0700_devices[i].adapter[adap_num].fe[0].stream.u.bulk.buffersize = 512;
} }
} }
} }
...@@ -579,18 +579,18 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) ...@@ -579,18 +579,18 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
deb_info("modifying (%d) streaming state for %d\n", onoff, adap->id); deb_info("modifying (%d) streaming state for %d\n", onoff, adap->id);
st->channel_state &= ~0x3; st->channel_state &= ~0x3;
if ((adap->stream.props.endpoint != 2) if ((adap->fe_adap[0].stream.props.endpoint != 2)
&& (adap->stream.props.endpoint != 3)) { && (adap->fe_adap[0].stream.props.endpoint != 3)) {
deb_info("the endpoint number (%i) is not correct, use the adapter id instead", adap->stream.props.endpoint); deb_info("the endpoint number (%i) is not correct, use the adapter id instead", adap->fe_adap[0].stream.props.endpoint);
if (onoff) if (onoff)
st->channel_state |= 1 << (adap->id); st->channel_state |= 1 << (adap->id);
else else
st->channel_state |= 1 << ~(adap->id); st->channel_state |= 1 << ~(adap->id);
} else { } else {
if (onoff) if (onoff)
st->channel_state |= 1 << (adap->stream.props.endpoint-2); st->channel_state |= 1 << (adap->fe_adap[0].stream.props.endpoint-2);
else else
st->channel_state |= 1 << (3-adap->stream.props.endpoint); st->channel_state |= 1 << (3-adap->fe_adap[0].stream.props.endpoint);
} }
st->buf[2] |= st->channel_state; st->buf[2] |= st->channel_state;
......
This diff is collapsed.
...@@ -23,7 +23,7 @@ int dibusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) ...@@ -23,7 +23,7 @@ int dibusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
if (adap->priv != NULL) { if (adap->priv != NULL) {
struct dibusb_state *st = adap->priv; struct dibusb_state *st = adap->priv;
if (st->ops.fifo_ctrl != NULL) if (st->ops.fifo_ctrl != NULL)
if (st->ops.fifo_ctrl(adap->fe[0],onoff)) { if (st->ops.fifo_ctrl(adap->fe_adap[0].fe,onoff)) {
err("error while controlling the fifo of the demod."); err("error while controlling the fifo of the demod.");
return -ENODEV; return -ENODEV;
} }
...@@ -37,7 +37,7 @@ int dibusb_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onof ...@@ -37,7 +37,7 @@ int dibusb_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onof
if (adap->priv != NULL) { if (adap->priv != NULL) {
struct dibusb_state *st = adap->priv; struct dibusb_state *st = adap->priv;
if (st->ops.pid_ctrl != NULL) if (st->ops.pid_ctrl != NULL)
st->ops.pid_ctrl(adap->fe[0],index,pid,onoff); st->ops.pid_ctrl(adap->fe_adap[0].fe,index,pid,onoff);
} }
return 0; return 0;
} }
...@@ -48,7 +48,7 @@ int dibusb_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) ...@@ -48,7 +48,7 @@ int dibusb_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
if (adap->priv != NULL) { if (adap->priv != NULL) {
struct dibusb_state *st = adap->priv; struct dibusb_state *st = adap->priv;
if (st->ops.pid_parse != NULL) if (st->ops.pid_parse != NULL)
if (st->ops.pid_parse(adap->fe[0],onoff) < 0) if (st->ops.pid_parse(adap->fe_adap[0].fe,onoff) < 0)
err("could not handle pid_parser"); err("could not handle pid_parser");
} }
return 0; return 0;
...@@ -254,8 +254,8 @@ int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -254,8 +254,8 @@ int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap)
msleep(1000); msleep(1000);
} }
if ((adap->fe[0] = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000P_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL || if ((adap->fe_adap[0].fe = 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) { (adap->fe_adap[0].fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000MC_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL) {
if (adap->priv != NULL) { if (adap->priv != NULL) {
struct dibusb_state *st = adap->priv; struct dibusb_state *st = adap->priv;
st->ops.pid_parse = dib3000mc_pid_parse; st->ops.pid_parse = dib3000mc_pid_parse;
...@@ -309,15 +309,15 @@ int dibusb_dib3000mc_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -309,15 +309,15 @@ int dibusb_dib3000mc_tuner_attach(struct dvb_usb_adapter *adap)
} }
} }
tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe[0], 1); tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe_adap[0].fe, 1);
if (dvb_attach(mt2060_attach, adap->fe[0], tun_i2c, &stk3000p_mt2060_config, if1) == NULL) { if (dvb_attach(mt2060_attach, adap->fe_adap[0].fe, tun_i2c, &stk3000p_mt2060_config, if1) == NULL) {
/* not found - use panasonic pll parameters */ /* not found - use panasonic pll parameters */
if (dvb_attach(dvb_pll_attach, adap->fe[0], 0x60, tun_i2c, DVB_PLL_ENV57H1XD5) == NULL) if (dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60, tun_i2c, DVB_PLL_ENV57H1XD5) == NULL)
return -ENOMEM; return -ENOMEM;
} else { } else {
st->mt2060_present = 1; st->mt2060_present = 1;
/* set the correct parameters for the dib3000p */ /* set the correct parameters for the dib3000p */
dib3000mc_set_config(adap->fe[0], &stk3000p_dib3000p_config); dib3000mc_set_config(adap->fe_adap[0].fe, &stk3000p_dib3000p_config);
} }
return 0; return 0;
} }
......
...@@ -31,11 +31,11 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -31,11 +31,11 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
demod_cfg.demod_address = 0x8; demod_cfg.demod_address = 0x8;
if ((adap->fe[0] = dvb_attach(dib3000mb_attach, &demod_cfg, if ((adap->fe_adap[0].fe = dvb_attach(dib3000mb_attach, &demod_cfg,
&adap->dev->i2c_adap, &st->ops)) == NULL) &adap->dev->i2c_adap, &st->ops)) == NULL)
return -ENODEV; return -ENODEV;
adap->fe[0]->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl; adap->fe_adap[0].fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
return 0; return 0;
} }
...@@ -46,7 +46,7 @@ static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -46,7 +46,7 @@ static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
st->tuner_addr = 0x61; st->tuner_addr = 0x61;
dvb_attach(dvb_pll_attach, adap->fe[0], 0x61, &adap->dev->i2c_adap, dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x61, &adap->dev->i2c_adap,
DVB_PLL_TUA6010XS); DVB_PLL_TUA6010XS);
return 0; return 0;
} }
...@@ -57,7 +57,7 @@ static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -57,7 +57,7 @@ static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
st->tuner_addr = 0x60; st->tuner_addr = 0x60;
dvb_attach(dvb_pll_attach, adap->fe[0], 0x60, &adap->dev->i2c_adap, dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap,
DVB_PLL_TDA665X); DVB_PLL_TDA665X);
return 0; return 0;
} }
...@@ -78,16 +78,16 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap) ...@@ -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 */ /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
msg[0].addr = msg[1].addr = st->tuner_addr = 0x60; msg[0].addr = msg[1].addr = st->tuner_addr = 0x60;
if (adap->fe[0]->ops.i2c_gate_ctrl) if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0],1); adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe,1);
if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) { if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
err("tuner i2c write failed."); err("tuner i2c write failed.");
ret = -EREMOTEIO; ret = -EREMOTEIO;
} }
if (adap->fe[0]->ops.i2c_gate_ctrl) if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0],0); adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe,0);
if (b2[0] == 0xfe) { if (b2[0] == 0xfe) {
info("This device has the Thomson Cable onboard. Which is default."); info("This device has the Thomson Cable onboard. Which is default.");
...@@ -185,6 +185,8 @@ static struct dvb_usb_device_properties dibusb1_1_properties = { ...@@ -185,6 +185,8 @@ static struct dvb_usb_device_properties dibusb1_1_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
.pid_filter_count = 16, .pid_filter_count = 16,
...@@ -205,6 +207,7 @@ static struct dvb_usb_device_properties dibusb1_1_properties = { ...@@ -205,6 +207,7 @@ static struct dvb_usb_device_properties dibusb1_1_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct dibusb_state), .size_of_priv = sizeof(struct dibusb_state),
} }
}, },
...@@ -272,6 +275,8 @@ static struct dvb_usb_device_properties dibusb1_1_an2235_properties = { ...@@ -272,6 +275,8 @@ static struct dvb_usb_device_properties dibusb1_1_an2235_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER, .caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER,
.pid_filter_count = 16, .pid_filter_count = 16,
...@@ -292,6 +297,7 @@ static struct dvb_usb_device_properties dibusb1_1_an2235_properties = { ...@@ -292,6 +297,7 @@ static struct dvb_usb_device_properties dibusb1_1_an2235_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct dibusb_state), .size_of_priv = sizeof(struct dibusb_state),
}, },
}, },
...@@ -338,6 +344,8 @@ static struct dvb_usb_device_properties dibusb2_0b_properties = { ...@@ -338,6 +344,8 @@ static struct dvb_usb_device_properties dibusb2_0b_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
.pid_filter_count = 16, .pid_filter_count = 16,
...@@ -358,6 +366,7 @@ static struct dvb_usb_device_properties dibusb2_0b_properties = { ...@@ -358,6 +366,7 @@ static struct dvb_usb_device_properties dibusb2_0b_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct dibusb_state), .size_of_priv = sizeof(struct dibusb_state),
} }
}, },
...@@ -398,6 +407,8 @@ static struct dvb_usb_device_properties artec_t1_usb2_properties = { ...@@ -398,6 +407,8 @@ static struct dvb_usb_device_properties artec_t1_usb2_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
.pid_filter_count = 16, .pid_filter_count = 16,
...@@ -417,6 +428,7 @@ static struct dvb_usb_device_properties artec_t1_usb2_properties = { ...@@ -417,6 +428,7 @@ static struct dvb_usb_device_properties artec_t1_usb2_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct dibusb_state), .size_of_priv = sizeof(struct dibusb_state),
} }
}, },
......
...@@ -57,6 +57,8 @@ static struct dvb_usb_device_properties dibusb_mc_properties = { ...@@ -57,6 +57,8 @@ static struct dvb_usb_device_properties dibusb_mc_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
.pid_filter_count = 32, .pid_filter_count = 32,
.streaming_ctrl = dibusb2_0_streaming_ctrl, .streaming_ctrl = dibusb2_0_streaming_ctrl,
...@@ -76,6 +78,7 @@ static struct dvb_usb_device_properties dibusb_mc_properties = { ...@@ -76,6 +78,7 @@ static struct dvb_usb_device_properties dibusb_mc_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct dibusb_state), .size_of_priv = sizeof(struct dibusb_state),
} }
}, },
......
...@@ -137,11 +137,11 @@ static int digitv_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -137,11 +137,11 @@ static int digitv_frontend_attach(struct dvb_usb_adapter *adap)
{ {
struct digitv_state *st = adap->dev->priv; struct digitv_state *st = adap->dev->priv;
if ((adap->fe[0] = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) { if ((adap->fe_adap[0].fe = dvb_attach(mt352_attach, &digitv_mt352_config, &adap->dev->i2c_adap)) != NULL) {
st->is_nxt6000 = 0; st->is_nxt6000 = 0;
return 0; return 0;
} }
if ((adap->fe[0] = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) { if ((adap->fe_adap[0].fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &adap->dev->i2c_adap)) != NULL) {
st->is_nxt6000 = 1; st->is_nxt6000 = 1;
return 0; return 0;
} }
...@@ -152,11 +152,11 @@ static int digitv_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -152,11 +152,11 @@ static int digitv_tuner_attach(struct dvb_usb_adapter *adap)
{ {
struct digitv_state *st = adap->dev->priv; struct digitv_state *st = adap->dev->priv;
if (!dvb_attach(dvb_pll_attach, adap->fe[0], 0x60, NULL, DVB_PLL_TDED4)) if (!dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60, NULL, DVB_PLL_TDED4))
return -ENODEV; return -ENODEV;
if (st->is_nxt6000) if (st->is_nxt6000)
adap->fe[0]->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; adap->fe_adap[0].fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params;
return 0; return 0;
} }
...@@ -292,6 +292,8 @@ static struct dvb_usb_device_properties digitv_properties = { ...@@ -292,6 +292,8 @@ static struct dvb_usb_device_properties digitv_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = digitv_frontend_attach, .frontend_attach = digitv_frontend_attach,
.tuner_attach = digitv_tuner_attach, .tuner_attach = digitv_tuner_attach,
...@@ -306,6 +308,7 @@ static struct dvb_usb_device_properties digitv_properties = { ...@@ -306,6 +308,7 @@ static struct dvb_usb_device_properties digitv_properties = {
} }
} }
}, },
}},
} }
}, },
.identify_state = digitv_identify_state, .identify_state = digitv_identify_state,
......
...@@ -90,7 +90,7 @@ static int dtt200u_rc_query(struct dvb_usb_device *d, u32 *event, int *state) ...@@ -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) static int dtt200u_frontend_attach(struct dvb_usb_adapter *adap)
{ {
adap->fe[0] = dtt200u_fe_attach(adap->dev); adap->fe_adap[0].fe = dtt200u_fe_attach(adap->dev);
return 0; return 0;
} }
...@@ -140,6 +140,8 @@ static struct dvb_usb_device_properties dtt200u_properties = { ...@@ -140,6 +140,8 @@ static struct dvb_usb_device_properties dtt200u_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
.pid_filter_count = 15, .pid_filter_count = 15,
...@@ -157,6 +159,7 @@ static struct dvb_usb_device_properties dtt200u_properties = { ...@@ -157,6 +159,7 @@ static struct dvb_usb_device_properties dtt200u_properties = {
} }
} }
}, },
}},
} }
}, },
.power_ctrl = dtt200u_power_ctrl, .power_ctrl = dtt200u_power_ctrl,
...@@ -187,6 +190,8 @@ static struct dvb_usb_device_properties wt220u_properties = { ...@@ -187,6 +190,8 @@ static struct dvb_usb_device_properties wt220u_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
.pid_filter_count = 15, .pid_filter_count = 15,
...@@ -204,6 +209,7 @@ static struct dvb_usb_device_properties wt220u_properties = { ...@@ -204,6 +209,7 @@ static struct dvb_usb_device_properties wt220u_properties = {
} }
} }
}, },
}},
} }
}, },
.power_ctrl = dtt200u_power_ctrl, .power_ctrl = dtt200u_power_ctrl,
...@@ -234,6 +240,8 @@ static struct dvb_usb_device_properties wt220u_fc_properties = { ...@@ -234,6 +240,8 @@ static struct dvb_usb_device_properties wt220u_fc_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
.pid_filter_count = 15, .pid_filter_count = 15,
...@@ -251,6 +259,7 @@ static struct dvb_usb_device_properties wt220u_fc_properties = { ...@@ -251,6 +259,7 @@ static struct dvb_usb_device_properties wt220u_fc_properties = {
} }
} }
}, },
}},
} }
}, },
.power_ctrl = dtt200u_power_ctrl, .power_ctrl = dtt200u_power_ctrl,
...@@ -281,6 +290,8 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = { ...@@ -281,6 +290,8 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
.pid_filter_count = 15, .pid_filter_count = 15,
...@@ -298,6 +309,7 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = { ...@@ -298,6 +309,7 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = {
} }
} }
}, },
}},
} }
}, },
.power_ctrl = dtt200u_power_ctrl, .power_ctrl = dtt200u_power_ctrl,
......
...@@ -115,13 +115,13 @@ static struct zl10353_config dtv5100_zl10353_config = { ...@@ -115,13 +115,13 @@ static struct zl10353_config dtv5100_zl10353_config = {
static int dtv5100_frontend_attach(struct dvb_usb_adapter *adap) static int dtv5100_frontend_attach(struct dvb_usb_adapter *adap)
{ {
adap->fe[0] = dvb_attach(zl10353_attach, &dtv5100_zl10353_config, adap->fe_adap[0].fe = dvb_attach(zl10353_attach, &dtv5100_zl10353_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0] == NULL) if (adap->fe_adap[0].fe == NULL)
return -EIO; return -EIO;
/* disable i2c gate, or it won't work... is this safe? */ /* disable i2c gate, or it won't work... is this safe? */
adap->fe[0]->ops.i2c_gate_ctrl = NULL; adap->fe_adap[0].fe->ops.i2c_gate_ctrl = NULL;
return 0; return 0;
} }
...@@ -133,7 +133,7 @@ static struct qt1010_config dtv5100_qt1010_config = { ...@@ -133,7 +133,7 @@ static struct qt1010_config dtv5100_qt1010_config = {
static int dtv5100_tuner_attach(struct dvb_usb_adapter *adap) static int dtv5100_tuner_attach(struct dvb_usb_adapter *adap)
{ {
return dvb_attach(qt1010_attach, return dvb_attach(qt1010_attach,
adap->fe[0], &adap->dev->i2c_adap, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
&dtv5100_qt1010_config) == NULL ? -ENODEV : 0; &dtv5100_qt1010_config) == NULL ? -ENODEV : 0;
} }
...@@ -180,6 +180,8 @@ static struct dvb_usb_device_properties dtv5100_properties = { ...@@ -180,6 +180,8 @@ static struct dvb_usb_device_properties dtv5100_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = {{ .adapter = {{
.num_frontends = 1,
.fe = {{
.frontend_attach = dtv5100_frontend_attach, .frontend_attach = dtv5100_frontend_attach,
.tuner_attach = dtv5100_tuner_attach, .tuner_attach = dtv5100_tuner_attach,
...@@ -193,6 +195,7 @@ static struct dvb_usb_device_properties dtv5100_properties = { ...@@ -193,6 +195,7 @@ static struct dvb_usb_device_properties dtv5100_properties = {
} }
} }
}, },
}},
} }, } },
.i2c_algo = &dtv5100_i2c_algo, .i2c_algo = &dtv5100_i2c_algo,
......
...@@ -17,15 +17,19 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -17,15 +17,19 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
if (adap == NULL) if (adap == NULL)
return -ENODEV; return -ENODEV;
if (adap->active_fe < 0) {
return -EINVAL;
}
newfeedcount = adap->feedcount + (onoff ? 1 : -1); newfeedcount = adap->feedcount + (onoff ? 1 : -1);
/* stop feed before setting a new pid if there will be no pid anymore */ /* stop feed before setting a new pid if there will be no pid anymore */
if (newfeedcount == 0) { if (newfeedcount == 0) {
deb_ts("stop feeding\n"); deb_ts("stop feeding\n");
usb_urb_kill(&adap->stream); usb_urb_kill(&adap->fe_adap[adap->active_fe].stream);
if (adap->props.streaming_ctrl != NULL) { if (adap->props.fe[adap->active_fe].streaming_ctrl != NULL) {
ret = adap->props.streaming_ctrl(adap, 0); ret = adap->props.fe[adap->active_fe].streaming_ctrl(adap, 0);
if (ret < 0) { if (ret < 0) {
err("error while stopping stream."); err("error while stopping stream.");
return ret; return ret;
...@@ -36,36 +40,36 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -36,36 +40,36 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
adap->feedcount = newfeedcount; adap->feedcount = newfeedcount;
/* activate the pid on the device specific pid_filter */ /* activate the pid on the device specific pid_filter */
deb_ts("setting pid (%s): %5d %04x at index %d '%s'\n",adap->pid_filtering ? deb_ts("setting pid (%s): %5d %04x at index %d '%s'\n",adap->fe_adap[adap->active_fe].pid_filtering ?
"yes" : "no", dvbdmxfeed->pid,dvbdmxfeed->pid,dvbdmxfeed->index,onoff ? "yes" : "no", dvbdmxfeed->pid,dvbdmxfeed->pid,dvbdmxfeed->index,onoff ?
"on" : "off"); "on" : "off");
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && if (adap->props.fe[adap->active_fe].caps & DVB_USB_ADAP_HAS_PID_FILTER &&
adap->pid_filtering && adap->fe_adap[adap->active_fe].pid_filtering &&
adap->props.pid_filter != NULL) adap->props.fe[adap->active_fe].pid_filter != NULL)
adap->props.pid_filter(adap, dvbdmxfeed->index, dvbdmxfeed->pid,onoff); adap->props.fe[adap->active_fe].pid_filter(adap, dvbdmxfeed->index, dvbdmxfeed->pid, onoff);
/* start the feed if this was the first feed and there is still a feed /* start the feed if this was the first feed and there is still a feed
* for reception. * for reception.
*/ */
if (adap->feedcount == onoff && adap->feedcount > 0) { if (adap->feedcount == onoff && adap->feedcount > 0) {
deb_ts("submitting all URBs\n"); deb_ts("submitting all URBs\n");
usb_urb_submit(&adap->stream); usb_urb_submit(&adap->fe_adap[adap->active_fe].stream);
deb_ts("controlling pid parser\n"); deb_ts("controlling pid parser\n");
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && if (adap->props.fe[adap->active_fe].caps & DVB_USB_ADAP_HAS_PID_FILTER &&
adap->props.caps & adap->props.fe[adap->active_fe].caps &
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF && DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF &&
adap->props.pid_filter_ctrl != NULL) { adap->props.fe[adap->active_fe].pid_filter_ctrl != NULL) {
ret = adap->props.pid_filter_ctrl(adap, ret = adap->props.fe[adap->active_fe].pid_filter_ctrl(adap,
adap->pid_filtering); adap->fe_adap[adap->active_fe].pid_filtering);
if (ret < 0) { if (ret < 0) {
err("could not handle pid_parser"); err("could not handle pid_parser");
return ret; return ret;
} }
} }
deb_ts("start feeding\n"); deb_ts("start feeding\n");
if (adap->props.streaming_ctrl != NULL) { if (adap->props.fe[adap->active_fe].streaming_ctrl != NULL) {
ret = adap->props.streaming_ctrl(adap, 1); ret = adap->props.fe[adap->active_fe].streaming_ctrl(adap, 1);
if (ret < 0) { if (ret < 0) {
err("error while enabling fifo."); err("error while enabling fifo.");
return ret; return ret;
...@@ -73,6 +77,9 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -73,6 +77,9 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
} }
} }
if ((adap->feedcount == onoff) && (!onoff))
adap->active_fe = -1;
return 0; return 0;
} }
...@@ -90,6 +97,7 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -90,6 +97,7 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums) int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
{ {
int i;
int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name, int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
adap->dev->owner, &adap->dev->udev->dev, adap->dev->owner, &adap->dev->udev->dev,
adapter_nums); adapter_nums);
...@@ -112,7 +120,12 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums) ...@@ -112,7 +120,12 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
adap->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING; adap->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING;
adap->demux.priv = adap; adap->demux.priv = adap;
adap->demux.feednum = adap->demux.filternum = adap->max_feed_count; adap->demux.filternum = 0;
for (i = 0; i < adap->props.num_frontends; i++) {
if (adap->demux.filternum < adap->fe_adap[i].max_feed_count)
adap->demux.filternum = adap->fe_adap[i].max_feed_count;
}
adap->demux.feednum = adap->demux.filternum;
adap->demux.start_feed = dvb_usb_start_feed; adap->demux.start_feed = dvb_usb_start_feed;
adap->demux.stop_feed = dvb_usb_stop_feed; adap->demux.stop_feed = dvb_usb_stop_feed;
adap->demux.write_to_decoder = NULL; adap->demux.write_to_decoder = NULL;
...@@ -156,17 +169,33 @@ int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap) ...@@ -156,17 +169,33 @@ int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap)
return 0; return 0;
} }
static int dvb_usb_set_active_fe(struct dvb_frontend *fe, int onoff)
{
struct dvb_usb_adapter *adap = fe->dvb->priv;
int ret = (adap->props.frontend_ctrl) ?
adap->props.frontend_ctrl(fe, onoff) : 0;
if (ret < 0) {
err("frontend_ctrl request failed");
return ret;
}
if (onoff)
adap->active_fe = fe->id;
return 0;
}
static int dvb_usb_fe_wakeup(struct dvb_frontend *fe) static int dvb_usb_fe_wakeup(struct dvb_frontend *fe)
{ {
struct dvb_usb_adapter *adap = fe->dvb->priv; struct dvb_usb_adapter *adap = fe->dvb->priv;
dvb_usb_device_power_ctrl(adap->dev, 1); dvb_usb_device_power_ctrl(adap->dev, 1);
if (adap->props.frontend_ctrl) dvb_usb_set_active_fe(fe, 1);
adap->props.frontend_ctrl(fe, 1);
if (adap->fe_init[fe->id]) if (adap->fe_adap[fe->id].fe_init)
adap->fe_init[fe->id](fe); adap->fe_adap[fe->id].fe_init(fe);
return 0; return 0;
} }
...@@ -175,37 +204,31 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe) ...@@ -175,37 +204,31 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe)
{ {
struct dvb_usb_adapter *adap = fe->dvb->priv; struct dvb_usb_adapter *adap = fe->dvb->priv;
if (adap->fe_sleep[fe->id]) if (adap->fe_adap[fe->id].fe_sleep)
adap->fe_sleep[fe->id](fe); adap->fe_adap[fe->id].fe_sleep(fe);
if (adap->props.frontend_ctrl) dvb_usb_set_active_fe(fe, 0);
adap->props.frontend_ctrl(fe, 0);
return dvb_usb_device_power_ctrl(adap->dev, 0); return dvb_usb_device_power_ctrl(adap->dev, 0);
} }
int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap) int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
{ {
int ret, i, x; int ret, i;
memset(adap->fe, 0, sizeof(adap->fe)); /* register all given adapter frontends */
for (i = 0; i < adap->props.num_frontends; i++) {
if (adap->props.frontend_attach == NULL) { if (adap->props.fe[i].frontend_attach == NULL) {
err("strange: '%s' #%d doesn't want to attach a frontend.", err("strange: '%s' #%d,%d "
adap->dev->desc->name, adap->id); "doesn't want to attach a frontend.",
adap->dev->desc->name, adap->id, i);
return 0; return 0;
} }
/* register all given adapter frontends */ ret = adap->props.fe[i].frontend_attach(adap);
if (adap->props.num_frontends) if (ret || adap->fe_adap[i].fe == NULL) {
x = adap->props.num_frontends - 1;
else
x = 0;
for (i = 0; i <= x; i++) {
ret = adap->props.frontend_attach(adap);
if (ret || adap->fe[i] == NULL) {
/* only print error when there is no FE at all */ /* only print error when there is no FE at all */
if (i == 0) if (i == 0)
err("no frontend was attached by '%s'", err("no frontend was attached by '%s'",
...@@ -214,18 +237,18 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap) ...@@ -214,18 +237,18 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
return 0; return 0;
} }
adap->fe[i]->id = i; adap->fe_adap[i].fe->id = i;
/* re-assign sleep and wakeup functions */ /* re-assign sleep and wakeup functions */
adap->fe_init[i] = adap->fe[i]->ops.init; adap->fe_adap[i].fe_init = adap->fe_adap[i].fe->ops.init;
adap->fe[i]->ops.init = dvb_usb_fe_wakeup; adap->fe_adap[i].fe->ops.init = dvb_usb_fe_wakeup;
adap->fe_sleep[i] = adap->fe[i]->ops.sleep; adap->fe_adap[i].fe_sleep = adap->fe_adap[i].fe->ops.sleep;
adap->fe[i]->ops.sleep = dvb_usb_fe_sleep; adap->fe_adap[i].fe->ops.sleep = dvb_usb_fe_sleep;
if (dvb_register_frontend(&adap->dvb_adap, adap->fe[i])) { if (dvb_register_frontend(&adap->dvb_adap, adap->fe_adap[i].fe)) {
err("Frontend %d registration failed.", i); err("Frontend %d registration failed.", i);
dvb_frontend_detach(adap->fe[i]); dvb_frontend_detach(adap->fe_adap[i].fe);
adap->fe[i] = NULL; adap->fe_adap[i].fe = NULL;
/* In error case, do not try register more FEs, /* In error case, do not try register more FEs,
* still leaving already registered FEs alive. */ * still leaving already registered FEs alive. */
if (i == 0) if (i == 0)
...@@ -235,8 +258,10 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap) ...@@ -235,8 +258,10 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
} }
/* only attach the tuner if the demod is there */ /* only attach the tuner if the demod is there */
if (adap->props.tuner_attach != NULL) if (adap->props.fe[i].tuner_attach != NULL)
adap->props.tuner_attach(adap); adap->props.fe[i].tuner_attach(adap);
adap->num_frontends_initialized++;
} }
return 0; return 0;
...@@ -244,20 +269,16 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap) ...@@ -244,20 +269,16 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap)
int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap) int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap)
{ {
int i; int i = adap->num_frontends_initialized - 1;
/* unregister all given adapter frontends */ /* unregister all given adapter frontends */
if (adap->props.num_frontends)
i = adap->props.num_frontends - 1;
else
i = 0;
for (; i >= 0; i--) { for (; i >= 0; i--) {
if (adap->fe[i] != NULL) { if (adap->fe_adap[i].fe != NULL) {
dvb_unregister_frontend(adap->fe[i]); dvb_unregister_frontend(adap->fe_adap[i].fe);
dvb_frontend_detach(adap->fe[i]); dvb_frontend_detach(adap->fe_adap[i].fe);
} }
} }
adap->num_frontends_initialized = 0;
return 0; return 0;
} }
...@@ -29,7 +29,7 @@ MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID ...@@ -29,7 +29,7 @@ MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID
static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs) static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
{ {
struct dvb_usb_adapter *adap; struct dvb_usb_adapter *adap;
int ret, n; int ret, n, o;
for (n = 0; n < d->props.num_adapters; n++) { for (n = 0; n < d->props.num_adapters; n++) {
adap = &d->adapter[n]; adap = &d->adapter[n];
...@@ -38,29 +38,40 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs) ...@@ -38,29 +38,40 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties)); memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties));
for (o = 0; o < adap->props.num_frontends; o++) {
struct dvb_usb_adapter_fe_properties *props = &adap->props.fe[o];
/* speed - when running at FULL speed we need a HW PID filter */ /* speed - when running at FULL speed we need a HW PID filter */
if (d->udev->speed == USB_SPEED_FULL && !(adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER)) { if (d->udev->speed == USB_SPEED_FULL && !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)"); err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)");
return -ENODEV; return -ENODEV;
} }
if ((d->udev->speed == USB_SPEED_FULL && adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER) || if ((d->udev->speed == USB_SPEED_FULL && props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
(adap->props.caps & DVB_USB_ADAP_NEED_PID_FILTERING)) { (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
info("will use the device's hardware PID filter (table count: %d).", adap->props.pid_filter_count); info("will use the device's hardware PID filter (table count: %d).", props->pid_filter_count);
adap->pid_filtering = 1; adap->fe_adap[o].pid_filtering = 1;
adap->max_feed_count = adap->props.pid_filter_count; adap->fe_adap[o].max_feed_count = props->pid_filter_count;
} else { } else {
info("will pass the complete MPEG2 transport stream to the software demuxer."); info("will pass the complete MPEG2 transport stream to the software demuxer.");
adap->pid_filtering = 0; adap->fe_adap[o].pid_filtering = 0;
adap->max_feed_count = 255; adap->fe_adap[o].max_feed_count = 255;
} }
if (!adap->pid_filtering && if (!adap->fe_adap[o].pid_filtering &&
dvb_usb_force_pid_filter_usage && dvb_usb_force_pid_filter_usage &&
adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER) { props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
info("pid filter enabled by module option."); info("pid filter enabled by module option.");
adap->pid_filtering = 1; adap->fe_adap[o].pid_filtering = 1;
adap->max_feed_count = adap->props.pid_filter_count; adap->fe_adap[o].max_feed_count = props->pid_filter_count;
}
if (props->size_of_priv > 0) {
adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL);
if (adap->fe_adap[o].priv == NULL) {
err("no memory for priv for adapter %d fe %d.", n, o);
return -ENOMEM;
}
}
} }
if (adap->props.size_of_priv > 0) { if (adap->props.size_of_priv > 0) {
...@@ -78,7 +89,7 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs) ...@@ -78,7 +89,7 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
} }
/* use exclusive FE lock if there is multiple shared FEs */ /* use exclusive FE lock if there is multiple shared FEs */
if (adap->fe[1]) if (adap->fe_adap[1].fe)
adap->dvb_adap.mfe_shared = 1; adap->dvb_adap.mfe_shared = 1;
d->num_adapters_initialized++; d->num_adapters_initialized++;
......
...@@ -82,16 +82,28 @@ static void dvb_usb_data_complete_204(struct usb_data_stream *stream, u8 *buffer ...@@ -82,16 +82,28 @@ static void dvb_usb_data_complete_204(struct usb_data_stream *stream, u8 *buffer
int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap) int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap)
{ {
adap->stream.udev = adap->dev->udev; int i, ret = 0;
if (adap->props.caps & DVB_USB_ADAP_RECEIVES_204_BYTE_TS) for (i = 0; i < adap->props.num_frontends; i++) {
adap->stream.complete = dvb_usb_data_complete_204;
adap->fe_adap[i].stream.udev = adap->dev->udev;
if (adap->props.fe[i].caps & DVB_USB_ADAP_RECEIVES_204_BYTE_TS)
adap->fe_adap[i].stream.complete =
dvb_usb_data_complete_204;
else else
adap->stream.complete = dvb_usb_data_complete; adap->fe_adap[i].stream.complete = dvb_usb_data_complete;
adap->stream.user_priv = adap; adap->fe_adap[i].stream.user_priv = adap;
return usb_urb_init(&adap->stream, &adap->props.stream); ret = usb_urb_init(&adap->fe_adap[i].stream,
&adap->props.fe[i].stream);
if (ret < 0)
break;
}
return ret;
} }
int dvb_usb_adapter_stream_exit(struct dvb_usb_adapter *adap) int dvb_usb_adapter_stream_exit(struct dvb_usb_adapter *adap)
{ {
return usb_urb_exit(&adap->stream); int i;
for (i = 0; i < adap->props.num_frontends; i++)
usb_urb_exit(&adap->fe_adap[i].stream);
return 0;
} }
...@@ -136,16 +136,14 @@ struct usb_data_stream_properties { ...@@ -136,16 +136,14 @@ struct usb_data_stream_properties {
* pll_desc and pll_init_buf of struct dvb_usb_device). * pll_desc and pll_init_buf of struct dvb_usb_device).
* @stream: configuration of the USB streaming * @stream: configuration of the USB streaming
*/ */
struct dvb_usb_adapter_properties { struct dvb_usb_adapter_fe_properties {
#define DVB_USB_ADAP_HAS_PID_FILTER 0x01 #define DVB_USB_ADAP_HAS_PID_FILTER 0x01
#define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02 #define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02
#define DVB_USB_ADAP_NEED_PID_FILTERING 0x04 #define DVB_USB_ADAP_NEED_PID_FILTERING 0x04
#define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08 #define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08
int caps; int caps;
int pid_filter_count; int pid_filter_count;
int num_frontends;
int (*frontend_ctrl) (struct dvb_frontend *, int);
int (*streaming_ctrl) (struct dvb_usb_adapter *, int); int (*streaming_ctrl) (struct dvb_usb_adapter *, int);
int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int); int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int);
int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int); int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int);
...@@ -156,9 +154,18 @@ struct dvb_usb_adapter_properties { ...@@ -156,9 +154,18 @@ struct dvb_usb_adapter_properties {
struct usb_data_stream_properties stream; struct usb_data_stream_properties stream;
int size_of_priv; int size_of_priv;
};
#define MAX_NO_OF_FE_PER_ADAP 2
struct dvb_usb_adapter_properties {
int size_of_priv;
int (*frontend_ctrl) (struct dvb_frontend *, int);
int (*fe_ioctl_override) (struct dvb_frontend *, int (*fe_ioctl_override) (struct dvb_frontend *,
unsigned int, void *, unsigned int); unsigned int, void *, unsigned int);
int num_frontends;
struct dvb_usb_adapter_fe_properties fe[MAX_NO_OF_FE_PER_ADAP];
}; };
/** /**
...@@ -349,7 +356,20 @@ struct usb_data_stream { ...@@ -349,7 +356,20 @@ struct usb_data_stream {
* *
* @stream: the usb data stream. * @stream: the usb data stream.
*/ */
#define MAX_NO_OF_FE_PER_ADAP 2 struct dvb_usb_fe_adapter {
struct dvb_frontend *fe;
int (*fe_init) (struct dvb_frontend *);
int (*fe_sleep) (struct dvb_frontend *);
struct usb_data_stream stream;
int pid_filtering;
int max_feed_count;
void *priv;
};
struct dvb_usb_adapter { struct dvb_usb_adapter {
struct dvb_usb_device *dev; struct dvb_usb_device *dev;
struct dvb_usb_adapter_properties props; struct dvb_usb_adapter_properties props;
...@@ -361,20 +381,16 @@ struct dvb_usb_adapter { ...@@ -361,20 +381,16 @@ struct dvb_usb_adapter {
u8 id; u8 id;
int feedcount; int feedcount;
int pid_filtering;
/* dvb */ /* dvb */
struct dvb_adapter dvb_adap; struct dvb_adapter dvb_adap;
struct dmxdev dmxdev; struct dmxdev dmxdev;
struct dvb_demux demux; struct dvb_demux demux;
struct dvb_net dvb_net; struct dvb_net dvb_net;
struct dvb_frontend *fe[MAX_NO_OF_FE_PER_ADAP];
int max_feed_count;
int (*fe_init[MAX_NO_OF_FE_PER_ADAP]) (struct dvb_frontend *);
int (*fe_sleep[MAX_NO_OF_FE_PER_ADAP]) (struct dvb_frontend *);
struct usb_data_stream stream; struct dvb_usb_fe_adapter fe_adap[MAX_NO_OF_FE_PER_ADAP];
int active_fe;
int num_frontends_initialized;
void *priv; void *priv;
}; };
......
This diff is collapsed.
...@@ -200,9 +200,9 @@ static struct ec100_config ec168_ec100_config = { ...@@ -200,9 +200,9 @@ static struct ec100_config ec168_ec100_config = {
static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap) static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap)
{ {
deb_info("%s:\n", __func__); deb_info("%s:\n", __func__);
adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config, adap->fe_adap[0].fe = dvb_attach(ec100_attach, &ec168_ec100_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0] == NULL) if (adap->fe_adap[0].fe == NULL)
return -ENODEV; return -ENODEV;
return 0; return 0;
...@@ -228,7 +228,7 @@ static struct mxl5005s_config ec168_mxl5003s_config = { ...@@ -228,7 +228,7 @@ static struct mxl5005s_config ec168_mxl5003s_config = {
static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
{ {
deb_info("%s:\n", __func__); deb_info("%s:\n", __func__);
return dvb_attach(mxl5005s_attach, adap->fe[0], &adap->dev->i2c_adap, return dvb_attach(mxl5005s_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
&ec168_mxl5003s_config) == NULL ? -ENODEV : 0; &ec168_mxl5003s_config) == NULL ? -ENODEV : 0;
} }
...@@ -382,6 +382,8 @@ static struct dvb_usb_device_properties ec168_properties = { ...@@ -382,6 +382,8 @@ static struct dvb_usb_device_properties ec168_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.streaming_ctrl = ec168_streaming_ctrl, .streaming_ctrl = ec168_streaming_ctrl,
.frontend_attach = ec168_ec100_frontend_attach, .frontend_attach = ec168_ec100_frontend_attach,
.tuner_attach = ec168_mxl5003s_tuner_attach, .tuner_attach = ec168_mxl5003s_tuner_attach,
...@@ -395,6 +397,7 @@ static struct dvb_usb_device_properties ec168_properties = { ...@@ -395,6 +397,7 @@ static struct dvb_usb_device_properties ec168_properties = {
} }
} }
}, },
}},
} }
}, },
......
...@@ -403,8 +403,8 @@ static int friio_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -403,8 +403,8 @@ static int friio_frontend_attach(struct dvb_usb_adapter *adap)
if (friio_initialize(adap->dev) < 0) if (friio_initialize(adap->dev) < 0)
return -EIO; return -EIO;
adap->fe[0] = jdvbt90502_attach(adap->dev); adap->fe_adap[0].fe = jdvbt90502_attach(adap->dev);
if (adap->fe[0] == NULL) if (adap->fe_adap[0].fe == NULL)
return -EIO; return -EIO;
return 0; return 0;
...@@ -473,6 +473,8 @@ static struct dvb_usb_device_properties friio_properties = { ...@@ -473,6 +473,8 @@ static struct dvb_usb_device_properties friio_properties = {
/* caps:0 => no pid filter, 188B TS packet */ /* caps:0 => no pid filter, 188B TS packet */
/* GL861 has a HW pid filter, but no info available. */ /* GL861 has a HW pid filter, but no info available. */
{ {
.num_frontends = 1,
.fe = {{
.caps = 0, .caps = 0,
.frontend_attach = friio_frontend_attach, .frontend_attach = friio_frontend_attach,
...@@ -490,6 +492,7 @@ static struct dvb_usb_device_properties friio_properties = { ...@@ -490,6 +492,7 @@ static struct dvb_usb_device_properties friio_properties = {
} }
} }
}, },
}},
} }
}, },
.i2c_algo = &gl861_i2c_algo, .i2c_algo = &gl861_i2c_algo,
......
...@@ -103,9 +103,9 @@ static struct zl10353_config gl861_zl10353_config = { ...@@ -103,9 +103,9 @@ static struct zl10353_config gl861_zl10353_config = {
static int gl861_frontend_attach(struct dvb_usb_adapter *adap) static int gl861_frontend_attach(struct dvb_usb_adapter *adap)
{ {
adap->fe[0] = dvb_attach(zl10353_attach, &gl861_zl10353_config, adap->fe_adap[0].fe = dvb_attach(zl10353_attach, &gl861_zl10353_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0] == NULL) if (adap->fe_adap[0].fe == NULL)
return -EIO; return -EIO;
return 0; return 0;
...@@ -118,7 +118,7 @@ static struct qt1010_config gl861_qt1010_config = { ...@@ -118,7 +118,7 @@ static struct qt1010_config gl861_qt1010_config = {
static int gl861_tuner_attach(struct dvb_usb_adapter *adap) static int gl861_tuner_attach(struct dvb_usb_adapter *adap)
{ {
return dvb_attach(qt1010_attach, return dvb_attach(qt1010_attach,
adap->fe[0], &adap->dev->i2c_adap, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
&gl861_qt1010_config) == NULL ? -ENODEV : 0; &gl861_qt1010_config) == NULL ? -ENODEV : 0;
} }
...@@ -167,6 +167,8 @@ static struct dvb_usb_device_properties gl861_properties = { ...@@ -167,6 +167,8 @@ static struct dvb_usb_device_properties gl861_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = {{ .adapter = {{
.num_frontends = 1,
.fe = {{
.frontend_attach = gl861_frontend_attach, .frontend_attach = gl861_frontend_attach,
.tuner_attach = gl861_tuner_attach, .tuner_attach = gl861_tuner_attach,
...@@ -181,6 +183,7 @@ static struct dvb_usb_device_properties gl861_properties = { ...@@ -181,6 +183,7 @@ static struct dvb_usb_device_properties gl861_properties = {
} }
} }
}, },
}},
} }, } },
.i2c_algo = &gl861_i2c_algo, .i2c_algo = &gl861_i2c_algo,
......
...@@ -230,7 +230,7 @@ static int gp8psk_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) ...@@ -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) static int gp8psk_frontend_attach(struct dvb_usb_adapter *adap)
{ {
adap->fe[0] = gp8psk_fe_attach(adap->dev); adap->fe_adap[0].fe = gp8psk_fe_attach(adap->dev);
return 0; return 0;
} }
...@@ -268,6 +268,8 @@ static struct dvb_usb_device_properties gp8psk_properties = { ...@@ -268,6 +268,8 @@ static struct dvb_usb_device_properties gp8psk_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.streaming_ctrl = gp8psk_streaming_ctrl, .streaming_ctrl = gp8psk_streaming_ctrl,
.frontend_attach = gp8psk_frontend_attach, .frontend_attach = gp8psk_frontend_attach,
/* parameter for the MPEG2-data transfer */ /* parameter for the MPEG2-data transfer */
...@@ -281,6 +283,7 @@ static struct dvb_usb_device_properties gp8psk_properties = { ...@@ -281,6 +283,7 @@ static struct dvb_usb_device_properties gp8psk_properties = {
} }
} }
}, },
}},
} }
}, },
.power_ctrl = gp8psk_power_ctrl, .power_ctrl = gp8psk_power_ctrl,
......
...@@ -436,7 +436,7 @@ static int it913x_name(struct dvb_usb_adapter *adap) ...@@ -436,7 +436,7 @@ static int it913x_name(struct dvb_usb_adapter *adap)
{ {
const char *desc = adap->dev->desc->name; const char *desc = adap->dev->desc->name;
char *fe_name[] = {"_1", "_2", "_3", "_4"}; char *fe_name[] = {"_1", "_2", "_3", "_4"};
char *name = adap->fe[0]->ops.info.name; char *name = adap->fe_adap[0].fe->ops.info.name;
strlcpy(name, desc, 128); strlcpy(name, desc, 128);
strlcat(name, fe_name[adap->id], 128); strlcat(name, fe_name[adap->id], 128);
...@@ -450,12 +450,12 @@ static int it913x_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -450,12 +450,12 @@ static int it913x_frontend_attach(struct dvb_usb_adapter *adap)
int ret = 0; int ret = 0;
u8 adf = it913x_read_reg(udev, IO_MUX_POWER_CLK); u8 adf = it913x_read_reg(udev, IO_MUX_POWER_CLK);
u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5); u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5);
u16 ep_size = adap->props.stream.u.bulk.buffersize; u16 ep_size = adap->props.fe[0].stream.u.bulk.buffersize;
adap->fe[0] = dvb_attach(it913x_fe_attach, adap->fe_adap[0].fe = dvb_attach(it913x_fe_attach,
&adap->dev->i2c_adap, adap_addr, adf, IT9137); &adap->dev->i2c_adap, adap_addr, adf, IT9137);
if (adap->id == 0 && adap->fe[0]) { if (adap->id == 0 && adap->fe_adap[0].fe) {
ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x1); ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x1);
ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2IF2_SW_RST, 0x1); ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2IF2_SW_RST, 0x1);
ret = it913x_wr_reg(udev, DEV_0, EP0_TX_EN, 0x0f); ret = it913x_wr_reg(udev, DEV_0, EP0_TX_EN, 0x0f);
...@@ -465,7 +465,7 @@ static int it913x_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -465,7 +465,7 @@ static int it913x_frontend_attach(struct dvb_usb_adapter *adap)
ep_size & 0xff); ep_size & 0xff);
ret = it913x_wr_reg(udev, DEV_0, EP4_TX_LEN_MSB, ep_size >> 8); ret = it913x_wr_reg(udev, DEV_0, EP4_TX_LEN_MSB, ep_size >> 8);
ret = it913x_wr_reg(udev, DEV_0, EP4_MAX_PKT, 0x80); ret = it913x_wr_reg(udev, DEV_0, EP4_MAX_PKT, 0x80);
} else if (adap->id == 1 && adap->fe[0]) { } else if (adap->id == 1 && adap->fe_adap[0].fe) {
ret = it913x_wr_reg(udev, DEV_0, EP0_TX_EN, 0x6f); ret = it913x_wr_reg(udev, DEV_0, EP0_TX_EN, 0x6f);
ret = it913x_wr_reg(udev, DEV_0, EP5_TX_LEN_LSB, ret = it913x_wr_reg(udev, DEV_0, EP5_TX_LEN_LSB,
ep_size & 0xff); ep_size & 0xff);
...@@ -524,6 +524,8 @@ static struct dvb_usb_device_properties it913x_properties = { ...@@ -524,6 +524,8 @@ static struct dvb_usb_device_properties it913x_properties = {
.num_adapters = 2, .num_adapters = 2,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER| .caps = DVB_USB_ADAP_HAS_PID_FILTER|
DVB_USB_ADAP_NEED_PID_FILTERING| DVB_USB_ADAP_NEED_PID_FILTERING|
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -544,8 +546,11 @@ static struct dvb_usb_device_properties it913x_properties = { ...@@ -544,8 +546,11 @@ static struct dvb_usb_device_properties it913x_properties = {
} }
} }
} }
}},
}, },
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER| .caps = DVB_USB_ADAP_HAS_PID_FILTER|
DVB_USB_ADAP_NEED_PID_FILTERING| DVB_USB_ADAP_NEED_PID_FILTERING|
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -566,6 +571,7 @@ static struct dvb_usb_device_properties it913x_properties = { ...@@ -566,6 +571,7 @@ static struct dvb_usb_device_properties it913x_properties = {
} }
} }
} }
}},
} }
}, },
.identify_state = it913x_identify_state, .identify_state = it913x_identify_state,
......
...@@ -941,7 +941,7 @@ static int lme_name(struct dvb_usb_adapter *adap) ...@@ -941,7 +941,7 @@ static int lme_name(struct dvb_usb_adapter *adap)
const char *desc = adap->dev->desc->name; const char *desc = adap->dev->desc->name;
char *fe_name[] = {"", " LG TDQY-P001F", " SHARP:BS2F7HZ7395", char *fe_name[] = {"", " LG TDQY-P001F", " SHARP:BS2F7HZ7395",
" SHARP:BS2F7HZ0194"}; " SHARP:BS2F7HZ0194"};
char *name = adap->fe[0]->ops.info.name; char *name = adap->fe_adap[0].fe->ops.info.name;
strlcpy(name, desc, 128); strlcpy(name, desc, 128);
strlcat(name, fe_name[st->tuner_config], 128); strlcat(name, fe_name[st->tuner_config], 128);
...@@ -958,10 +958,10 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -958,10 +958,10 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
st->i2c_talk_onoff = 1; st->i2c_talk_onoff = 1;
st->i2c_gate = 4; st->i2c_gate = 4;
adap->fe[0] = dvb_attach(tda10086_attach, &tda10086_config, adap->fe_adap[0].fe = dvb_attach(tda10086_attach, &tda10086_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0]) { if (adap->fe_adap[0].fe) {
info("TUN Found Frontend TDA10086"); info("TUN Found Frontend TDA10086");
st->i2c_tuner_gate_w = 4; st->i2c_tuner_gate_w = 4;
st->i2c_tuner_gate_r = 4; st->i2c_tuner_gate_r = 4;
...@@ -975,9 +975,9 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -975,9 +975,9 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
} }
st->i2c_gate = 4; st->i2c_gate = 4;
adap->fe[0] = dvb_attach(stv0299_attach, &sharp_z0194_config, adap->fe_adap[0].fe = dvb_attach(stv0299_attach, &sharp_z0194_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0]) { if (adap->fe_adap[0].fe) {
info("FE Found Stv0299"); info("FE Found Stv0299");
st->i2c_tuner_gate_w = 4; st->i2c_tuner_gate_w = 4;
st->i2c_tuner_gate_r = 5; st->i2c_tuner_gate_r = 5;
...@@ -991,9 +991,9 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -991,9 +991,9 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
} }
st->i2c_gate = 5; st->i2c_gate = 5;
adap->fe[0] = dvb_attach(stv0288_attach, &lme_config, adap->fe_adap[0].fe = dvb_attach(stv0288_attach, &lme_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0]) { if (adap->fe_adap[0].fe) {
info("FE Found Stv0288"); info("FE Found Stv0288");
st->i2c_tuner_gate_w = 4; st->i2c_tuner_gate_w = 4;
st->i2c_tuner_gate_r = 5; st->i2c_tuner_gate_r = 5;
...@@ -1010,15 +1010,15 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -1010,15 +1010,15 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
end: if (ret) { end: if (ret) {
if (adap->fe[0]) { if (adap->fe_adap[0].fe) {
dvb_frontend_detach(adap->fe[0]); dvb_frontend_detach(adap->fe_adap[0].fe);
adap->fe[0] = NULL; adap->fe_adap[0].fe = NULL;
} }
adap->dev->props.rc.core.rc_codes = NULL; adap->dev->props.rc.core.rc_codes = NULL;
return -ENODEV; return -ENODEV;
} }
adap->fe[0]->ops.set_voltage = dm04_lme2510_set_voltage; adap->fe_adap[0].fe->ops.set_voltage = dm04_lme2510_set_voltage;
ret = lme_name(adap); ret = lme_name(adap);
return ret; return ret;
} }
...@@ -1031,17 +1031,17 @@ static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap) ...@@ -1031,17 +1031,17 @@ static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap)
switch (st->tuner_config) { switch (st->tuner_config) {
case TUNER_LG: case TUNER_LG:
if (dvb_attach(tda826x_attach, adap->fe[0], 0xc0, if (dvb_attach(tda826x_attach, adap->fe_adap[0].fe, 0xc0,
&adap->dev->i2c_adap, 1)) &adap->dev->i2c_adap, 1))
ret = st->tuner_config; ret = st->tuner_config;
break; break;
case TUNER_S7395: case TUNER_S7395:
if (dvb_attach(ix2505v_attach , adap->fe[0], &lme_tuner, if (dvb_attach(ix2505v_attach , adap->fe_adap[0].fe, &lme_tuner,
&adap->dev->i2c_adap)) &adap->dev->i2c_adap))
ret = st->tuner_config; ret = st->tuner_config;
break; break;
case TUNER_S0194: case TUNER_S0194:
if (dvb_attach(dvb_pll_attach , adap->fe[0], 0xc0, if (dvb_attach(dvb_pll_attach , adap->fe_adap[0].fe, 0xc0,
&adap->dev->i2c_adap, DVB_PLL_OPERA1)) &adap->dev->i2c_adap, DVB_PLL_OPERA1))
ret = st->tuner_config; ret = st->tuner_config;
break; break;
...@@ -1145,6 +1145,8 @@ static struct dvb_usb_device_properties lme2510_properties = { ...@@ -1145,6 +1145,8 @@ static struct dvb_usb_device_properties lme2510_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER| .caps = DVB_USB_ADAP_HAS_PID_FILTER|
DVB_USB_ADAP_NEED_PID_FILTERING| DVB_USB_ADAP_NEED_PID_FILTERING|
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -1166,6 +1168,7 @@ static struct dvb_usb_device_properties lme2510_properties = { ...@@ -1166,6 +1168,7 @@ static struct dvb_usb_device_properties lme2510_properties = {
} }
} }
} }
}},
} }
}, },
.rc.core = { .rc.core = {
...@@ -1193,6 +1196,8 @@ static struct dvb_usb_device_properties lme2510c_properties = { ...@@ -1193,6 +1196,8 @@ static struct dvb_usb_device_properties lme2510c_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER| .caps = DVB_USB_ADAP_HAS_PID_FILTER|
DVB_USB_ADAP_NEED_PID_FILTERING| DVB_USB_ADAP_NEED_PID_FILTERING|
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -1214,6 +1219,7 @@ static struct dvb_usb_device_properties lme2510c_properties = { ...@@ -1214,6 +1219,7 @@ static struct dvb_usb_device_properties lme2510c_properties = {
} }
} }
} }
}},
} }
}, },
.rc.core = { .rc.core = {
...@@ -1241,7 +1247,7 @@ static void *lme2510_exit_int(struct dvb_usb_device *d) ...@@ -1241,7 +1247,7 @@ static void *lme2510_exit_int(struct dvb_usb_device *d)
void *buffer = NULL; void *buffer = NULL;
if (adap != NULL) { if (adap != NULL) {
lme2510_kill_urb(&adap->stream); lme2510_kill_urb(&adap->fe_adap[0].stream);
adap->feedcount = 0; adap->feedcount = 0;
} }
......
...@@ -86,12 +86,12 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq) ...@@ -86,12 +86,12 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
} }
for (i = 0; i < d->props.num_adapters; i++) for (i = 0; i < d->props.num_adapters; i++)
flags |= d->adapter[i].props.caps; flags |= d->adapter[i].props.fe[0].caps;
/* Some devices(Dposh) might crash if we attempt touch at all. */ /* Some devices(Dposh) might crash if we attempt touch at all. */
if (flags & DVB_USB_ADAP_HAS_PID_FILTER) { if (flags & DVB_USB_ADAP_HAS_PID_FILTER) {
for (i = 0; i < d->props.num_adapters; i++) { for (i = 0; i < d->props.num_adapters; i++) {
epi = d->adapter[i].props.stream.endpoint - 0x81; epi = d->adapter[i].props.fe[0].stream.endpoint - 0x81;
if (epi < 0 || epi >= M9206_MAX_ADAPTERS) { if (epi < 0 || epi >= M9206_MAX_ADAPTERS) {
printk(KERN_INFO "m920x: Unexpected adapter endpoint!\n"); printk(KERN_INFO "m920x: Unexpected adapter endpoint!\n");
...@@ -292,7 +292,7 @@ static int m920x_update_filters(struct dvb_usb_adapter *adap) ...@@ -292,7 +292,7 @@ static int m920x_update_filters(struct dvb_usb_adapter *adap)
struct m920x_state *m = adap->dev->priv; struct m920x_state *m = adap->dev->priv;
int enabled = m->filtering_enabled[adap->id]; int enabled = m->filtering_enabled[adap->id];
int i, ret = 0, filter = 0; int i, ret = 0, filter = 0;
int ep = adap->props.stream.endpoint; int ep = adap->props.fe[0].stream.endpoint;
for (i = 0; i < M9206_MAX_FILTERS; i++) for (i = 0; i < M9206_MAX_FILTERS; i++)
if (m->filters[adap->id][i] == 8192) if (m->filters[adap->id][i] == 8192)
...@@ -501,7 +501,7 @@ static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -501,7 +501,7 @@ static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
{ {
deb("%s\n",__func__); deb("%s\n",__func__);
if ((adap->fe[0] = dvb_attach(mt352_attach, if ((adap->fe_adap[0].fe = dvb_attach(mt352_attach,
&m920x_mt352_config, &m920x_mt352_config,
&adap->dev->i2c_adap)) == NULL) &adap->dev->i2c_adap)) == NULL)
return -EIO; return -EIO;
...@@ -513,7 +513,7 @@ static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -513,7 +513,7 @@ static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
{ {
deb("%s\n",__func__); deb("%s\n",__func__);
if ((adap->fe[0] = dvb_attach(tda10046_attach, if ((adap->fe_adap[0].fe = dvb_attach(tda10046_attach,
&m920x_tda10046_08_config, &m920x_tda10046_08_config,
&adap->dev->i2c_adap)) == NULL) &adap->dev->i2c_adap)) == NULL)
return -EIO; return -EIO;
...@@ -525,7 +525,7 @@ static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -525,7 +525,7 @@ static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap)
{ {
deb("%s\n",__func__); deb("%s\n",__func__);
if ((adap->fe[0] = dvb_attach(tda10046_attach, if ((adap->fe_adap[0].fe = dvb_attach(tda10046_attach,
&m920x_tda10046_0b_config, &m920x_tda10046_0b_config,
&adap->dev->i2c_adap)) == NULL) &adap->dev->i2c_adap)) == NULL)
return -EIO; return -EIO;
...@@ -537,7 +537,7 @@ static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -537,7 +537,7 @@ static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
{ {
deb("%s\n",__func__); deb("%s\n",__func__);
if (dvb_attach(qt1010_attach, adap->fe[0], &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL) if (dvb_attach(qt1010_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL)
return -ENODEV; return -ENODEV;
return 0; return 0;
...@@ -547,7 +547,7 @@ static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -547,7 +547,7 @@ static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap)
{ {
deb("%s\n",__func__); deb("%s\n",__func__);
if (dvb_attach(tda827x_attach, adap->fe[0], 0x60, &adap->dev->i2c_adap, NULL) == NULL) if (dvb_attach(tda827x_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap, NULL) == NULL)
return -ENODEV; return -ENODEV;
return 0; return 0;
...@@ -557,7 +557,7 @@ static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -557,7 +557,7 @@ static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap)
{ {
deb("%s\n",__func__); deb("%s\n",__func__);
if (dvb_attach(tda827x_attach, adap->fe[0], 0x61, &adap->dev->i2c_adap, NULL) == NULL) if (dvb_attach(tda827x_attach, adap->fe_adap[0].fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL)
return -ENODEV; return -ENODEV;
return 0; return 0;
...@@ -565,7 +565,7 @@ static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -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) static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
{ {
dvb_attach(simple_tuner_attach, adap->fe[0], dvb_attach(simple_tuner_attach, adap->fe_adap[0].fe,
&adap->dev->i2c_adap, 0x61, &adap->dev->i2c_adap, 0x61,
TUNER_PHILIPS_FMD1216ME_MK3); TUNER_PHILIPS_FMD1216ME_MK3);
return 0; return 0;
...@@ -807,6 +807,9 @@ static struct dvb_usb_device_properties megasky_properties = { ...@@ -807,6 +807,9 @@ static struct dvb_usb_device_properties megasky_properties = {
.identify_state = m920x_identify_state, .identify_state = m920x_identify_state,
.num_adapters = 1, .num_adapters = 1,
.adapter = {{ .adapter = {{
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -828,6 +831,7 @@ static struct dvb_usb_device_properties megasky_properties = { ...@@ -828,6 +831,7 @@ static struct dvb_usb_device_properties megasky_properties = {
} }
}, },
}}, }},
}},
.i2c_algo = &m920x_i2c_algo, .i2c_algo = &m920x_i2c_algo,
.num_device_descs = 1, .num_device_descs = 1,
...@@ -851,6 +855,9 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = { ...@@ -851,6 +855,9 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = {
.identify_state = m920x_identify_state, .identify_state = m920x_identify_state,
.num_adapters = 1, .num_adapters = 1,
.adapter = {{ .adapter = {{
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -872,6 +879,7 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = { ...@@ -872,6 +879,7 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties = {
} }
}, },
}}, }},
}},
.i2c_algo = &m920x_i2c_algo, .i2c_algo = &m920x_i2c_algo,
.num_device_descs = 1, .num_device_descs = 1,
...@@ -910,6 +918,9 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = { ...@@ -910,6 +918,9 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = {
.identify_state = m920x_identify_state, .identify_state = m920x_identify_state,
.num_adapters = 2, .num_adapters = 2,
.adapter = {{ .adapter = {{
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -929,7 +940,11 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = { ...@@ -929,7 +940,11 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = {
.buffersize = 512, .buffersize = 512,
} }
} }
}},
}},{ }},{
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -949,6 +964,7 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = { ...@@ -949,6 +964,7 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = {
.buffersize = 512, .buffersize = 512,
} }
} }
}},
}, },
}}, }},
.i2c_algo = &m920x_i2c_algo, .i2c_algo = &m920x_i2c_algo,
...@@ -974,6 +990,8 @@ static struct dvb_usb_device_properties dposh_properties = { ...@@ -974,6 +990,8 @@ static struct dvb_usb_device_properties dposh_properties = {
.identify_state = m920x_identify_state, .identify_state = m920x_identify_state,
.num_adapters = 1, .num_adapters = 1,
.adapter = {{ .adapter = {{
.num_frontends = 1,
.fe = {{
/* Hardware pid filters don't work with this device/firmware */ /* Hardware pid filters don't work with this device/firmware */
.frontend_attach = m920x_mt352_frontend_attach, .frontend_attach = m920x_mt352_frontend_attach,
...@@ -990,6 +1008,7 @@ static struct dvb_usb_device_properties dposh_properties = { ...@@ -990,6 +1008,7 @@ static struct dvb_usb_device_properties dposh_properties = {
} }
}, },
}}, }},
}},
.i2c_algo = &m920x_i2c_algo, .i2c_algo = &m920x_i2c_algo,
.num_device_descs = 1, .num_device_descs = 1,
...@@ -1019,6 +1038,9 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = { ...@@ -1019,6 +1038,9 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = {
.identify_state = m920x_identify_state, .identify_state = m920x_identify_state,
.num_adapters = 1, .num_adapters = 1,
.adapter = {{ .adapter = {{
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | .caps = DVB_USB_ADAP_HAS_PID_FILTER |
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
...@@ -1041,6 +1063,7 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = { ...@@ -1041,6 +1063,7 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = {
} }
} }
}, },
}},
} }, } },
.i2c_algo = &m920x_i2c_algo, .i2c_algo = &m920x_i2c_algo,
......
...@@ -253,7 +253,8 @@ static int mxl111sf_adap_fe_init(struct dvb_frontend *fe) ...@@ -253,7 +253,8 @@ static int mxl111sf_adap_fe_init(struct dvb_frontend *fe)
struct dvb_usb_adapter *adap = fe->dvb->priv; struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dvb_usb_device *d = adap->dev; struct dvb_usb_device *d = adap->dev;
struct mxl111sf_state *state = d->priv; struct mxl111sf_state *state = d->priv;
struct mxl111sf_adap_state *adap_state = adap->priv; struct mxl111sf_adap_state *adap_state = adap->fe_adap[fe->id].priv;
int err; int err;
/* exit if we didnt initialize the driver yet */ /* exit if we didnt initialize the driver yet */
...@@ -311,7 +312,7 @@ static int mxl111sf_adap_fe_sleep(struct dvb_frontend *fe) ...@@ -311,7 +312,7 @@ static int mxl111sf_adap_fe_sleep(struct dvb_frontend *fe)
struct dvb_usb_adapter *adap = fe->dvb->priv; struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dvb_usb_device *d = adap->dev; struct dvb_usb_device *d = adap->dev;
struct mxl111sf_state *state = d->priv; struct mxl111sf_state *state = d->priv;
struct mxl111sf_adap_state *adap_state = adap->priv; struct mxl111sf_adap_state *adap_state = adap->fe_adap[fe->id].priv;
int err; int err;
/* exit if we didnt initialize the driver yet */ /* exit if we didnt initialize the driver yet */
...@@ -336,7 +337,7 @@ static int mxl111sf_ep6_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) ...@@ -336,7 +337,7 @@ static int mxl111sf_ep6_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
{ {
struct dvb_usb_device *d = adap->dev; struct dvb_usb_device *d = adap->dev;
struct mxl111sf_state *state = d->priv; struct mxl111sf_state *state = d->priv;
struct mxl111sf_adap_state *adap_state = adap->priv; struct mxl111sf_adap_state *adap_state = adap->fe_adap[adap->active_fe].priv;
int ret = 0; int ret = 0;
u8 tmp; u8 tmp;
...@@ -378,7 +379,7 @@ static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -378,7 +379,7 @@ static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap)
{ {
struct dvb_usb_device *d = adap->dev; struct dvb_usb_device *d = adap->dev;
struct mxl111sf_state *state = d->priv; struct mxl111sf_state *state = d->priv;
struct mxl111sf_adap_state *adap_state = adap->priv; struct mxl111sf_adap_state *adap_state = adap->fe_adap[0].priv;
int ret; int ret;
deb_adv("%s()\n", __func__); deb_adv("%s()\n", __func__);
...@@ -421,14 +422,14 @@ static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -421,14 +422,14 @@ static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap)
if (mxl_fail(ret)) if (mxl_fail(ret))
goto fail; goto fail;
adap->fe[0] = dvb_attach(lgdt3305_attach, adap->fe_adap[0].fe = dvb_attach(lgdt3305_attach,
&hauppauge_lgdt3305_config, &hauppauge_lgdt3305_config,
&adap->dev->i2c_adap); &adap->dev->i2c_adap);
if (adap->fe[0]) { if (adap->fe_adap[0].fe) {
adap_state->fe_init = adap->fe[0]->ops.init; adap_state->fe_init = adap->fe_adap[0].fe->ops.init;
adap->fe[0]->ops.init = mxl111sf_adap_fe_init; adap->fe_adap[0].fe->ops.init = mxl111sf_adap_fe_init;
adap_state->fe_sleep = adap->fe[0]->ops.sleep; adap_state->fe_sleep = adap->fe_adap[0].fe->ops.sleep;
adap->fe[0]->ops.sleep = mxl111sf_adap_fe_sleep; adap->fe_adap[0].fe->ops.sleep = mxl111sf_adap_fe_sleep;
return 0; return 0;
} }
ret = -EIO; ret = -EIO;
...@@ -516,7 +517,7 @@ static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap) ...@@ -516,7 +517,7 @@ static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap)
deb_adv("%s()\n", __func__); deb_adv("%s()\n", __func__);
if (NULL != dvb_attach(mxl111sf_tuner_attach, adap->fe[0], state, if (NULL != dvb_attach(mxl111sf_tuner_attach, adap->fe_adap[0].fe, state,
&mxl_tuner_config)) &mxl_tuner_config))
return 0; return 0;
...@@ -714,13 +715,16 @@ static struct dvb_usb_device_properties mxl111sf_atsc_bulk_properties = { ...@@ -714,13 +715,16 @@ static struct dvb_usb_device_properties mxl111sf_atsc_bulk_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.size_of_priv = sizeof(struct mxl111sf_adap_state),
.fe_ioctl_override = mxl111sf_fe_ioctl_override, .fe_ioctl_override = mxl111sf_fe_ioctl_override,
.num_frontends = 1,
.fe = {{
.size_of_priv = sizeof(struct mxl111sf_adap_state),
.frontend_attach = mxl111sf_lgdt3305_frontend_attach, .frontend_attach = mxl111sf_lgdt3305_frontend_attach,
.tuner_attach = mxl111sf_attach_tuner, .tuner_attach = mxl111sf_attach_tuner,
MXL111SF_EP6_BULK_STREAMING_CONFIG, MXL111SF_EP6_BULK_STREAMING_CONFIG,
}},
}, },
}, },
.num_device_descs = 6, .num_device_descs = 6,
...@@ -768,13 +772,16 @@ static struct dvb_usb_device_properties mxl111sf_atsc_isoc_properties = { ...@@ -768,13 +772,16 @@ static struct dvb_usb_device_properties mxl111sf_atsc_isoc_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.size_of_priv = sizeof(struct mxl111sf_adap_state),
.fe_ioctl_override = mxl111sf_fe_ioctl_override, .fe_ioctl_override = mxl111sf_fe_ioctl_override,
.num_frontends = 1,
.fe = {{
.size_of_priv = sizeof(struct mxl111sf_adap_state),
.frontend_attach = mxl111sf_lgdt3305_frontend_attach, .frontend_attach = mxl111sf_lgdt3305_frontend_attach,
.tuner_attach = mxl111sf_attach_tuner, .tuner_attach = mxl111sf_attach_tuner,
MXL111SF_EP6_ISOC_STREAMING_CONFIG, MXL111SF_EP6_ISOC_STREAMING_CONFIG,
}},
}, },
}, },
.num_device_descs = 6, .num_device_descs = 6,
......
...@@ -166,6 +166,8 @@ static struct dvb_usb_device_properties nova_t_properties = { ...@@ -166,6 +166,8 @@ static struct dvb_usb_device_properties nova_t_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
.pid_filter_count = 32, .pid_filter_count = 32,
...@@ -186,7 +188,7 @@ static struct dvb_usb_device_properties nova_t_properties = { ...@@ -186,7 +188,7 @@ static struct dvb_usb_device_properties nova_t_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct dibusb_state), .size_of_priv = sizeof(struct dibusb_state),
} }
}, },
......
...@@ -263,10 +263,10 @@ static struct stv0299_config opera1_stv0299_config = { ...@@ -263,10 +263,10 @@ static struct stv0299_config opera1_stv0299_config = {
static int opera1_frontend_attach(struct dvb_usb_adapter *d) static int opera1_frontend_attach(struct dvb_usb_adapter *d)
{ {
if ((d->fe[0] = if ((d->fe_adap[0].fe =
dvb_attach(stv0299_attach, &opera1_stv0299_config, dvb_attach(stv0299_attach, &opera1_stv0299_config,
&d->dev->i2c_adap)) != NULL) { &d->dev->i2c_adap)) != NULL) {
d->fe[0]->ops.set_voltage = opera1_set_voltage; d->fe_adap[0].fe->ops.set_voltage = opera1_set_voltage;
return 0; return 0;
} }
info("not attached stv0299"); info("not attached stv0299");
...@@ -276,7 +276,7 @@ static int opera1_frontend_attach(struct dvb_usb_adapter *d) ...@@ -276,7 +276,7 @@ static int opera1_frontend_attach(struct dvb_usb_adapter *d)
static int opera1_tuner_attach(struct dvb_usb_adapter *adap) static int opera1_tuner_attach(struct dvb_usb_adapter *adap)
{ {
dvb_attach( dvb_attach(
dvb_pll_attach, adap->fe[0], 0xc0>>1, dvb_pll_attach, adap->fe_adap[0].fe, 0xc0>>1,
&adap->dev->i2c_adap, DVB_PLL_OPERA1 &adap->dev->i2c_adap, DVB_PLL_OPERA1
); );
return 0; return 0;
...@@ -516,6 +516,8 @@ static struct dvb_usb_device_properties opera1_properties = { ...@@ -516,6 +516,8 @@ static struct dvb_usb_device_properties opera1_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = opera1_frontend_attach, .frontend_attach = opera1_frontend_attach,
.streaming_ctrl = opera1_streaming_ctrl, .streaming_ctrl = opera1_streaming_ctrl,
.tuner_attach = opera1_tuner_attach, .tuner_attach = opera1_tuner_attach,
...@@ -535,6 +537,7 @@ static struct dvb_usb_device_properties opera1_properties = { ...@@ -535,6 +537,7 @@ static struct dvb_usb_device_properties opera1_properties = {
} }
} }
}, },
}},
} }
}, },
.num_device_descs = 1, .num_device_descs = 1,
......
...@@ -292,7 +292,7 @@ static void technisat_usb2_green_led_control(struct work_struct *work) ...@@ -292,7 +292,7 @@ static void technisat_usb2_green_led_control(struct work_struct *work)
{ {
struct technisat_usb2_state *state = struct technisat_usb2_state *state =
container_of(work, struct technisat_usb2_state, green_led_work.work); container_of(work, struct technisat_usb2_state, green_led_work.work);
struct dvb_frontend *fe = state->dev->adapter[0].fe[0]; struct dvb_frontend *fe = state->dev->adapter[0].fe_adap[0].fe;
if (state->power_state == 0) if (state->power_state == 0)
goto schedule; goto schedule;
...@@ -505,14 +505,14 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a) ...@@ -505,14 +505,14 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
struct usb_device *udev = a->dev->udev; struct usb_device *udev = a->dev->udev;
int ret; int ret;
a->fe[0] = dvb_attach(stv090x_attach, &technisat_usb2_stv090x_config, a->fe_adap[0].fe = dvb_attach(stv090x_attach, &technisat_usb2_stv090x_config,
&a->dev->i2c_adap, STV090x_DEMODULATOR_0); &a->dev->i2c_adap, STV090x_DEMODULATOR_0);
if (a->fe[0]) { if (a->fe_adap[0].fe) {
struct stv6110x_devctl *ctl; struct stv6110x_devctl *ctl;
ctl = dvb_attach(stv6110x_attach, ctl = dvb_attach(stv6110x_attach,
a->fe[0], a->fe_adap[0].fe,
&technisat_usb2_stv6110x_config, &technisat_usb2_stv6110x_config,
&a->dev->i2c_adap); &a->dev->i2c_adap);
...@@ -532,8 +532,8 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a) ...@@ -532,8 +532,8 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
/* call the init function once to initialize /* call the init function once to initialize
tuner's clock output divider and demod's tuner's clock output divider and demod's
master clock */ master clock */
if (a->fe[0]->ops.init) if (a->fe_adap[0].fe->ops.init)
a->fe[0]->ops.init(a->fe[0]); a->fe_adap[0].fe->ops.init(a->fe_adap[0].fe);
if (mutex_lock_interruptible(&a->dev->i2c_mutex) < 0) if (mutex_lock_interruptible(&a->dev->i2c_mutex) < 0)
return -EAGAIN; return -EAGAIN;
...@@ -548,20 +548,20 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a) ...@@ -548,20 +548,20 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
if (ret != 0) if (ret != 0)
err("could not set IF_CLK to external"); err("could not set IF_CLK to external");
a->fe[0]->ops.set_voltage = technisat_usb2_set_voltage; a->fe_adap[0].fe->ops.set_voltage = technisat_usb2_set_voltage;
/* if everything was successful assign a nice name to the frontend */ /* if everything was successful assign a nice name to the frontend */
strlcpy(a->fe[0]->ops.info.name, a->dev->desc->name, strlcpy(a->fe_adap[0].fe->ops.info.name, a->dev->desc->name,
sizeof(a->fe[0]->ops.info.name)); sizeof(a->fe_adap[0].fe->ops.info.name));
} else { } else {
dvb_frontend_detach(a->fe[0]); dvb_frontend_detach(a->fe_adap[0].fe);
a->fe[0] = NULL; a->fe_adap[0].fe = NULL;
} }
} }
technisat_usb2_set_led_timer(a->dev, 1, 1); technisat_usb2_set_led_timer(a->dev, 1, 1);
return a->fe[0] == NULL ? -ENODEV : 0; return a->fe_adap[0].fe == NULL ? -ENODEV : 0;
} }
/* Remote control */ /* Remote control */
...@@ -697,6 +697,8 @@ static struct dvb_usb_device_properties technisat_usb2_devices = { ...@@ -697,6 +697,8 @@ static struct dvb_usb_device_properties technisat_usb2_devices = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = technisat_usb2_frontend_attach, .frontend_attach = technisat_usb2_frontend_attach,
.stream = { .stream = {
...@@ -711,7 +713,7 @@ static struct dvb_usb_device_properties technisat_usb2_devices = { ...@@ -711,7 +713,7 @@ static struct dvb_usb_device_properties technisat_usb2_devices = {
} }
} }
}, },
}},
.size_of_priv = 0, .size_of_priv = 0,
}, },
}, },
......
...@@ -222,7 +222,7 @@ static int ttusb2_frontend_tda10086_attach(struct dvb_usb_adapter *adap) ...@@ -222,7 +222,7 @@ static int ttusb2_frontend_tda10086_attach(struct dvb_usb_adapter *adap)
if (usb_set_interface(adap->dev->udev,0,3) < 0) if (usb_set_interface(adap->dev->udev,0,3) < 0)
err("set interface to alts=3 failed"); err("set interface to alts=3 failed");
if ((adap->fe[0] = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) == NULL) { if ((adap->fe_adap[0].fe = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) == NULL) {
deb_info("TDA10086 attach failed\n"); deb_info("TDA10086 attach failed\n");
return -ENODEV; return -ENODEV;
} }
...@@ -234,7 +234,7 @@ static int ttusb2_ct3650_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) ...@@ -234,7 +234,7 @@ static int ttusb2_ct3650_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{ {
struct dvb_usb_adapter *adap = fe->dvb->priv; struct dvb_usb_adapter *adap = fe->dvb->priv;
return adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0], enable); return adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, enable);
} }
static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap) static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap)
...@@ -242,26 +242,26 @@ static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap) ...@@ -242,26 +242,26 @@ static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap)
if (usb_set_interface(adap->dev->udev, 0, 3) < 0) if (usb_set_interface(adap->dev->udev, 0, 3) < 0)
err("set interface to alts=3 failed"); err("set interface to alts=3 failed");
if (adap->fe[0] == NULL) { if (adap->fe_adap[0].fe == NULL) {
/* FE 0 DVB-C */ /* FE 0 DVB-C */
adap->fe[0] = dvb_attach(tda10023_attach, adap->fe_adap[0].fe = dvb_attach(tda10023_attach,
&tda10023_config, &adap->dev->i2c_adap, 0x48); &tda10023_config, &adap->dev->i2c_adap, 0x48);
if (adap->fe[0] == NULL) { if (adap->fe_adap[0].fe == NULL) {
deb_info("TDA10023 attach failed\n"); deb_info("TDA10023 attach failed\n");
return -ENODEV; return -ENODEV;
} }
} else { } else {
adap->fe[1] = dvb_attach(tda10048_attach, adap->fe_adap[1].fe = dvb_attach(tda10048_attach,
&tda10048_config, &adap->dev->i2c_adap); &tda10048_config, &adap->dev->i2c_adap);
if (adap->fe[1] == NULL) { if (adap->fe_adap[1].fe == NULL) {
deb_info("TDA10048 attach failed\n"); deb_info("TDA10048 attach failed\n");
return -ENODEV; return -ENODEV;
} }
/* tuner is behind TDA10023 I2C-gate */ /* tuner is behind TDA10023 I2C-gate */
adap->fe[1]->ops.i2c_gate_ctrl = ttusb2_ct3650_i2c_gate_ctrl; adap->fe_adap[1].fe->ops.i2c_gate_ctrl = ttusb2_ct3650_i2c_gate_ctrl;
} }
...@@ -273,10 +273,10 @@ static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap) ...@@ -273,10 +273,10 @@ static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap)
struct dvb_frontend *fe; struct dvb_frontend *fe;
/* MFE: select correct FE to attach tuner since that's called twice */ /* MFE: select correct FE to attach tuner since that's called twice */
if (adap->fe[1] == NULL) if (adap->fe_adap[1].fe == NULL)
fe = adap->fe[0]; fe = adap->fe_adap[0].fe;
else else
fe = adap->fe[1]; fe = adap->fe_adap[1].fe;
/* attach tuner */ /* attach tuner */
if (dvb_attach(tda827x_attach, fe, 0x61, &adap->dev->i2c_adap, &tda827x_config) == NULL) { if (dvb_attach(tda827x_attach, fe, 0x61, &adap->dev->i2c_adap, &tda827x_config) == NULL) {
...@@ -288,12 +288,12 @@ static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap) ...@@ -288,12 +288,12 @@ static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap)
static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap) static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap)
{ {
if (dvb_attach(tda826x_attach, adap->fe[0], 0x60, &adap->dev->i2c_adap, 0) == NULL) { if (dvb_attach(tda826x_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) {
deb_info("TDA8263 attach failed\n"); deb_info("TDA8263 attach failed\n");
return -ENODEV; return -ENODEV;
} }
if (dvb_attach(lnbp21_attach, adap->fe[0], &adap->dev->i2c_adap, 0, 0) == NULL) { if (dvb_attach(lnbp21_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, 0, 0) == NULL) {
deb_info("LNBP21 attach failed\n"); deb_info("LNBP21 attach failed\n");
return -ENODEV; return -ENODEV;
} }
...@@ -340,6 +340,8 @@ static struct dvb_usb_device_properties ttusb2_properties = { ...@@ -340,6 +340,8 @@ static struct dvb_usb_device_properties ttusb2_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.streaming_ctrl = NULL, // ttusb2_streaming_ctrl, .streaming_ctrl = NULL, // ttusb2_streaming_ctrl,
.frontend_attach = ttusb2_frontend_tda10086_attach, .frontend_attach = ttusb2_frontend_tda10086_attach,
...@@ -358,6 +360,7 @@ static struct dvb_usb_device_properties ttusb2_properties = { ...@@ -358,6 +360,7 @@ static struct dvb_usb_device_properties ttusb2_properties = {
} }
} }
} }
}},
} }
}, },
...@@ -392,6 +395,8 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = { ...@@ -392,6 +395,8 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.streaming_ctrl = NULL, .streaming_ctrl = NULL,
.frontend_attach = ttusb2_frontend_tda10086_attach, .frontend_attach = ttusb2_frontend_tda10086_attach,
...@@ -410,6 +415,7 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = { ...@@ -410,6 +415,7 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = {
} }
} }
} }
}},
} }
}, },
...@@ -446,9 +452,29 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = { ...@@ -446,9 +452,29 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 2,
.fe = {{
.streaming_ctrl = NULL,
.frontend_attach = ttusb2_frontend_tda10023_attach,
.tuner_attach = ttusb2_tuner_tda827x_attach,
/* parameter for the MPEG2-data transfer */
.stream = {
.type = USB_ISOC,
.count = 5,
.endpoint = 0x02,
.u = {
.isoc = {
.framesperurb = 4,
.framesize = 940,
.interval = 1,
}
}
}
},{
.streaming_ctrl = NULL, .streaming_ctrl = NULL,
.num_frontends = 2,
.frontend_attach = ttusb2_frontend_tda10023_attach, .frontend_attach = ttusb2_frontend_tda10023_attach,
.tuner_attach = ttusb2_tuner_tda827x_attach, .tuner_attach = ttusb2_tuner_tda827x_attach,
...@@ -465,6 +491,7 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = { ...@@ -465,6 +491,7 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = {
} }
} }
} }
}},
}, },
}, },
......
...@@ -60,14 +60,14 @@ static int umt_mt352_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -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_init = umt_mt352_demod_init;
umt_config.demod_address = 0xf; umt_config.demod_address = 0xf;
adap->fe[0] = dvb_attach(mt352_attach, &umt_config, &adap->dev->i2c_adap); adap->fe_adap[0].fe = dvb_attach(mt352_attach, &umt_config, &adap->dev->i2c_adap);
return 0; return 0;
} }
static int umt_tuner_attach (struct dvb_usb_adapter *adap) static int umt_tuner_attach (struct dvb_usb_adapter *adap)
{ {
dvb_attach(dvb_pll_attach, adap->fe[0], 0x61, NULL, DVB_PLL_TUA6034); dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x61, NULL, DVB_PLL_TUA6034);
return 0; return 0;
} }
...@@ -100,6 +100,8 @@ static struct dvb_usb_device_properties umt_properties = { ...@@ -100,6 +100,8 @@ static struct dvb_usb_device_properties umt_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.streaming_ctrl = dibusb2_0_streaming_ctrl, .streaming_ctrl = dibusb2_0_streaming_ctrl,
.frontend_attach = umt_mt352_frontend_attach, .frontend_attach = umt_mt352_frontend_attach,
.tuner_attach = umt_tuner_attach, .tuner_attach = umt_tuner_attach,
...@@ -115,7 +117,7 @@ static struct dvb_usb_device_properties umt_properties = { ...@@ -115,7 +117,7 @@ static struct dvb_usb_device_properties umt_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct dibusb_state), .size_of_priv = sizeof(struct dibusb_state),
} }
}, },
......
...@@ -320,7 +320,7 @@ static int vp702x_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -320,7 +320,7 @@ static int vp702x_frontend_attach(struct dvb_usb_adapter *adap)
vp702x_init_pid_filter(adap); vp702x_init_pid_filter(adap);
adap->fe[0] = vp702x_fe_attach(adap->dev); adap->fe_adap[0].fe = vp702x_fe_attach(adap->dev);
vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 1, 7, NULL, 0); vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 1, 7, NULL, 0);
return 0; return 0;
...@@ -383,6 +383,8 @@ static struct dvb_usb_device_properties vp702x_properties = { ...@@ -383,6 +383,8 @@ static struct dvb_usb_device_properties vp702x_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.caps = DVB_USB_ADAP_RECEIVES_204_BYTE_TS, .caps = DVB_USB_ADAP_RECEIVES_204_BYTE_TS,
.streaming_ctrl = vp702x_streaming_ctrl, .streaming_ctrl = vp702x_streaming_ctrl,
...@@ -399,6 +401,7 @@ static struct dvb_usb_device_properties vp702x_properties = { ...@@ -399,6 +401,7 @@ static struct dvb_usb_device_properties vp702x_properties = {
} }
} }
}, },
}},
.size_of_priv = sizeof(struct vp702x_adapter_state), .size_of_priv = sizeof(struct vp702x_adapter_state),
} }
}, },
......
...@@ -214,7 +214,7 @@ static int vp7045_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -214,7 +214,7 @@ static int vp7045_frontend_attach(struct dvb_usb_adapter *adap)
/* Dump the EEPROM */ /* Dump the EEPROM */
/* vp7045_read_eeprom(d,buf, 255, FX2_ID_ADDR); */ /* vp7045_read_eeprom(d,buf, 255, FX2_ID_ADDR); */
adap->fe[0] = vp7045_fe_attach(adap->dev); adap->fe_adap[0].fe = vp7045_fe_attach(adap->dev);
return 0; return 0;
} }
...@@ -263,6 +263,8 @@ static struct dvb_usb_device_properties vp7045_properties = { ...@@ -263,6 +263,8 @@ static struct dvb_usb_device_properties vp7045_properties = {
.num_adapters = 1, .num_adapters = 1,
.adapter = { .adapter = {
{ {
.num_frontends = 1,
.fe = {{
.frontend_attach = vp7045_frontend_attach, .frontend_attach = vp7045_frontend_attach,
/* parameter for the MPEG2-data transfer */ /* parameter for the MPEG2-data transfer */
.stream = { .stream = {
...@@ -275,6 +277,7 @@ static struct dvb_usb_device_properties vp7045_properties = { ...@@ -275,6 +277,7 @@ static struct dvb_usb_device_properties vp7045_properties = {
} }
} }
}, },
}},
} }
}, },
.power_ctrl = vp7045_power_ctrl, .power_ctrl = vp7045_power_ctrl,
......
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