diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb/ttusb2.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/ttusb2.c | 55 |
1 files changed, 41 insertions, 14 deletions
diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c index bda37ce0562..130d2960ddf 100644 --- a/drivers/media/dvb/dvb-usb/ttusb2.c +++ b/drivers/media/dvb/dvb-usb/ttusb2.c | |||
@@ -222,7 +222,7 @@ static int ttusb2_frontend_tda10086_attach(struct dvb_usb_adapter *adap) | |||
222 | if (usb_set_interface(adap->dev->udev,0,3) < 0) | 222 | if (usb_set_interface(adap->dev->udev,0,3) < 0) |
223 | err("set interface to alts=3 failed"); | 223 | err("set interface to alts=3 failed"); |
224 | 224 | ||
225 | if ((adap->fe[0] = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) == NULL) { | 225 | if ((adap->fe_adap[0].fe = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) == NULL) { |
226 | deb_info("TDA10086 attach failed\n"); | 226 | deb_info("TDA10086 attach failed\n"); |
227 | return -ENODEV; | 227 | return -ENODEV; |
228 | } | 228 | } |
@@ -234,7 +234,7 @@ static int ttusb2_ct3650_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) | |||
234 | { | 234 | { |
235 | struct dvb_usb_adapter *adap = fe->dvb->priv; | 235 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
236 | 236 | ||
237 | return adap->fe[0]->ops.i2c_gate_ctrl(adap->fe[0], enable); | 237 | return adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, enable); |
238 | } | 238 | } |
239 | 239 | ||
240 | static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap) | 240 | 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 | if (usb_set_interface(adap->dev->udev, 0, 3) < 0) | 242 | if (usb_set_interface(adap->dev->udev, 0, 3) < 0) |
243 | err("set interface to alts=3 failed"); | 243 | err("set interface to alts=3 failed"); |
244 | 244 | ||
245 | if (adap->fe[0] == NULL) { | 245 | if (adap->fe_adap[0].fe == NULL) { |
246 | /* FE 0 DVB-C */ | 246 | /* FE 0 DVB-C */ |
247 | adap->fe[0] = dvb_attach(tda10023_attach, | 247 | adap->fe_adap[0].fe = dvb_attach(tda10023_attach, |
248 | &tda10023_config, &adap->dev->i2c_adap, 0x48); | 248 | &tda10023_config, &adap->dev->i2c_adap, 0x48); |
249 | 249 | ||
250 | if (adap->fe[0] == NULL) { | 250 | if (adap->fe_adap[0].fe == NULL) { |
251 | deb_info("TDA10023 attach failed\n"); | 251 | deb_info("TDA10023 attach failed\n"); |
252 | return -ENODEV; | 252 | return -ENODEV; |
253 | } | 253 | } |
254 | } else { | 254 | } else { |
255 | adap->fe[1] = dvb_attach(tda10048_attach, | 255 | adap->fe_adap[1].fe = dvb_attach(tda10048_attach, |
256 | &tda10048_config, &adap->dev->i2c_adap); | 256 | &tda10048_config, &adap->dev->i2c_adap); |
257 | 257 | ||
258 | if (adap->fe[1] == NULL) { | 258 | if (adap->fe_adap[1].fe == NULL) { |
259 | deb_info("TDA10048 attach failed\n"); | 259 | deb_info("TDA10048 attach failed\n"); |
260 | return -ENODEV; | 260 | return -ENODEV; |
261 | } | 261 | } |
262 | 262 | ||
263 | /* tuner is behind TDA10023 I2C-gate */ | 263 | /* tuner is behind TDA10023 I2C-gate */ |
264 | adap->fe[1]->ops.i2c_gate_ctrl = ttusb2_ct3650_i2c_gate_ctrl; | 264 | adap->fe_adap[1].fe->ops.i2c_gate_ctrl = ttusb2_ct3650_i2c_gate_ctrl; |
265 | 265 | ||
266 | } | 266 | } |
267 | 267 | ||
@@ -273,10 +273,10 @@ static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap) | |||
273 | struct dvb_frontend *fe; | 273 | struct dvb_frontend *fe; |
274 | 274 | ||
275 | /* MFE: select correct FE to attach tuner since that's called twice */ | 275 | /* MFE: select correct FE to attach tuner since that's called twice */ |
276 | if (adap->fe[1] == NULL) | 276 | if (adap->fe_adap[1].fe == NULL) |
277 | fe = adap->fe[0]; | 277 | fe = adap->fe_adap[0].fe; |
278 | else | 278 | else |
279 | fe = adap->fe[1]; | 279 | fe = adap->fe_adap[1].fe; |
280 | 280 | ||
281 | /* attach tuner */ | 281 | /* attach tuner */ |
282 | if (dvb_attach(tda827x_attach, fe, 0x61, &adap->dev->i2c_adap, &tda827x_config) == NULL) { | 282 | 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 | 288 | ||
289 | static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap) | 289 | static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap) |
290 | { | 290 | { |
291 | if (dvb_attach(tda826x_attach, adap->fe[0], 0x60, &adap->dev->i2c_adap, 0) == NULL) { | 291 | if (dvb_attach(tda826x_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) { |
292 | deb_info("TDA8263 attach failed\n"); | 292 | deb_info("TDA8263 attach failed\n"); |
293 | return -ENODEV; | 293 | return -ENODEV; |
294 | } | 294 | } |
295 | 295 | ||
296 | if (dvb_attach(lnbp21_attach, adap->fe[0], &adap->dev->i2c_adap, 0, 0) == NULL) { | 296 | if (dvb_attach(lnbp21_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, 0, 0) == NULL) { |
297 | deb_info("LNBP21 attach failed\n"); | 297 | deb_info("LNBP21 attach failed\n"); |
298 | return -ENODEV; | 298 | return -ENODEV; |
299 | } | 299 | } |
@@ -340,6 +340,8 @@ static struct dvb_usb_device_properties ttusb2_properties = { | |||
340 | .num_adapters = 1, | 340 | .num_adapters = 1, |
341 | .adapter = { | 341 | .adapter = { |
342 | { | 342 | { |
343 | .num_frontends = 1, | ||
344 | .fe = {{ | ||
343 | .streaming_ctrl = NULL, // ttusb2_streaming_ctrl, | 345 | .streaming_ctrl = NULL, // ttusb2_streaming_ctrl, |
344 | 346 | ||
345 | .frontend_attach = ttusb2_frontend_tda10086_attach, | 347 | .frontend_attach = ttusb2_frontend_tda10086_attach, |
@@ -358,6 +360,7 @@ static struct dvb_usb_device_properties ttusb2_properties = { | |||
358 | } | 360 | } |
359 | } | 361 | } |
360 | } | 362 | } |
363 | }}, | ||
361 | } | 364 | } |
362 | }, | 365 | }, |
363 | 366 | ||
@@ -392,6 +395,8 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = { | |||
392 | .num_adapters = 1, | 395 | .num_adapters = 1, |
393 | .adapter = { | 396 | .adapter = { |
394 | { | 397 | { |
398 | .num_frontends = 1, | ||
399 | .fe = {{ | ||
395 | .streaming_ctrl = NULL, | 400 | .streaming_ctrl = NULL, |
396 | 401 | ||
397 | .frontend_attach = ttusb2_frontend_tda10086_attach, | 402 | .frontend_attach = ttusb2_frontend_tda10086_attach, |
@@ -410,6 +415,7 @@ static struct dvb_usb_device_properties ttusb2_properties_s2400 = { | |||
410 | } | 415 | } |
411 | } | 416 | } |
412 | } | 417 | } |
418 | }}, | ||
413 | } | 419 | } |
414 | }, | 420 | }, |
415 | 421 | ||
@@ -446,9 +452,10 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = { | |||
446 | .num_adapters = 1, | 452 | .num_adapters = 1, |
447 | .adapter = { | 453 | .adapter = { |
448 | { | 454 | { |
455 | .num_frontends = 2, | ||
456 | .fe = {{ | ||
449 | .streaming_ctrl = NULL, | 457 | .streaming_ctrl = NULL, |
450 | 458 | ||
451 | .num_frontends = 2, | ||
452 | .frontend_attach = ttusb2_frontend_tda10023_attach, | 459 | .frontend_attach = ttusb2_frontend_tda10023_attach, |
453 | .tuner_attach = ttusb2_tuner_tda827x_attach, | 460 | .tuner_attach = ttusb2_tuner_tda827x_attach, |
454 | 461 | ||
@@ -465,6 +472,26 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = { | |||
465 | } | 472 | } |
466 | } | 473 | } |
467 | } | 474 | } |
475 | },{ | ||
476 | .streaming_ctrl = NULL, | ||
477 | |||
478 | .frontend_attach = ttusb2_frontend_tda10023_attach, | ||
479 | .tuner_attach = ttusb2_tuner_tda827x_attach, | ||
480 | |||
481 | /* parameter for the MPEG2-data transfer */ | ||
482 | .stream = { | ||
483 | .type = USB_ISOC, | ||
484 | .count = 5, | ||
485 | .endpoint = 0x02, | ||
486 | .u = { | ||
487 | .isoc = { | ||
488 | .framesperurb = 4, | ||
489 | .framesize = 940, | ||
490 | .interval = 1, | ||
491 | } | ||
492 | } | ||
493 | } | ||
494 | }}, | ||
468 | }, | 495 | }, |
469 | }, | 496 | }, |
470 | 497 | ||