diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-09-30 06:53:48 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-10-03 15:10:54 -0300 |
commit | 4d43e13f723e12734257277cc38497fab1efc605 (patch) | |
tree | 7debc4f9b7997f7d768dcf387210436b532198f4 /drivers/media | |
parent | 8ccb3dcd1f8e80e8702642e1de26541b52f6bb7c (diff) |
V4L/DVB (4643): Multi-input patch for DVB-USB device
This patch is the first commit of the Multiple Input Patch for the DVB-USB frame
work.
It changes the DVB-USB-device to be able to have more than one streaming input
(e.g. multiple DVB-T sources) on one device. This is a necessary feature for
the upcoming DiB7700 driven devices.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
23 files changed, 1017 insertions, 1005 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index 0a3c35399be..135f287510c 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig @@ -39,20 +39,8 @@ config DVB_USB_DIBUSB_MB Support for USB 1.1 and 2.0 DVB-T receivers based on reference designs made by DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator. - Devices supported by this driver: - Artec T1 USB1.1 boxes - Avermedia AverTV DVBT USB1.1 - Compro Videomate DVB-U2000 - DVB-T USB - DiBcom USB1.1 reference devices (non-public) - Grandtec DVB-T USB - Hama DVB-T USB1.1-Box - KWorld/JetWay/ADSTech V-Stream XPERT DTV - DVB-T USB1.1 and USB2.0 - TwinhanDTV Magic Box (VP7041e) - TwinhanDTV USB-Ter (VP7041) - Ultima Electronic/Artec T1 USB TVBOX - - The VP7041 seems to be identical to "CTS Portable" (Chinese - Television System). + For an up-to-date list of devices supported by this driver, have a look + on the Linux-DVB Wiki at www.linuxtv.org. Say Y if you own such a device and want to use it. You should build it as a module. @@ -69,12 +57,28 @@ config DVB_USB_DIBUSB_MC select DVB_DIB3000MC select DVB_TUNER_MT2060 help - Support for 2.0 DVB-T receivers based on reference designs made by + Support for USB2.0 DVB-T receivers based on reference designs made by DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator. - Devices supported by this driver: - Artec T1 USB2.0 boxes - DiBcom USB2.0 reference devices (non-public) + For an up-to-date list of devices supported by this driver, have a look + on the Linux-DVB Wiki at www.linuxtv.org. + + Say Y if you own such a device and want to use it. You should build it as + a module. + +config DVB_USB_DIB0700 + tristate "DiBcom DiB0700 USB DVB devices (see help for supported devices)" + depends on DVB_USB + select DVB_DIB7000M + select DVB_TUNER_MT2060 + help + Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The + USB bridge is also present in devices having the DiB7700 DVB-T-USB + silicon. This chip can be found in devices offered by Hauppauge, + Avermedia and other big and small companies. + + For an up-to-date list of devices supported by this driver, have a look + on the Linux-DVB Wiki at www.linuxtv.org. Say Y if you own such a device and want to use it. You should build it as a module. diff --git a/drivers/media/dvb/dvb-usb/Makefile b/drivers/media/dvb/dvb-usb/Makefile index 9643f56c7fe..275cbc2925c 100644 --- a/drivers/media/dvb/dvb-usb/Makefile +++ b/drivers/media/dvb/dvb-usb/Makefile @@ -1,4 +1,4 @@ -dvb-usb-objs = dvb-usb-firmware.o dvb-usb-init.o dvb-usb-urb.o dvb-usb-i2c.o dvb-usb-dvb.o dvb-usb-remote.o +dvb-usb-objs = dvb-usb-firmware.o dvb-usb-init.o dvb-usb-urb.o dvb-usb-i2c.o dvb-usb-dvb.o dvb-usb-remote.o usb-urb.o obj-$(CONFIG_DVB_USB) += dvb-usb.o dvb-usb-vp7045-objs = vp7045.o vp7045-fe.o @@ -36,4 +36,6 @@ obj-$(CONFIG_DVB_USB_DIGITV) += dvb-usb-digitv.o dvb-usb-cxusb-objs = cxusb.o obj-$(CONFIG_DVB_USB_CXUSB) += dvb-usb-cxusb.o +dvb-usb-dib0700-objs = dib0700_core.o dib0700_devices.o + EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c index df0c384bd4c..2ed3eb62d78 100644 --- a/drivers/media/dvb/dvb-usb/a800.c +++ b/drivers/media/dvb/dvb-usb/a800.c @@ -27,7 +27,8 @@ static int a800_power_ctrl(struct dvb_usb_device *d, int onoff) } /* assure to put cold to 0 for iManufacturer == 1 */ -static int a800_identify_state(struct usb_device *udev, struct dvb_usb_properties *props,struct dvb_usb_device_description **desc, int *cold) +static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, + struct dvb_usb_device_description **desc, int *cold) { *cold = udev->descriptor.iManufacturer != 1; return 0; @@ -88,7 +89,7 @@ static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) } /* USB Driver stuff */ -static struct dvb_usb_properties a800_properties; +static struct dvb_usb_device_properties a800_properties; static int a800_probe(struct usb_interface *intf, const struct usb_device_id *id) @@ -104,35 +105,27 @@ static struct usb_device_id a800_table [] = { }; MODULE_DEVICE_TABLE (usb, a800_table); -static struct dvb_usb_properties a800_properties = { - .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, - .pid_filter_count = 32, +static struct dvb_usb_device_properties a800_properties = { + .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = CYPRESS_FX2, - .firmware = "dvb-usb-avertv-a800-02.fw", - .size_of_priv = sizeof(struct dibusb_state), - + .num_adapters = 1, + .adapter = { + { + .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, + .pid_filter_count = 32, .streaming_ctrl = dibusb2_0_streaming_ctrl, .pid_filter = dibusb_pid_filter, .pid_filter_ctrl = dibusb_pid_filter_ctrl, - .power_ctrl = a800_power_ctrl, + .frontend_attach = dibusb_dib3000mc_frontend_attach, .tuner_attach = dibusb_dib3000mc_tuner_attach, - .identify_state = a800_identify_state, - - .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = a800_rc_keys, - .rc_key_map_size = ARRAY_SIZE(a800_rc_keys), - .rc_query = a800_rc_query, - .i2c_algo = &dibusb_i2c_algo, - - .generic_bulk_ctrl_endpoint = 0x01, /* parameter for the MPEG2-data transfer */ - .urb = { - .type = DVB_USB_BULK, + .stream = { + .type = USB_BULK, .count = 7, .endpoint = 0x06, .u = { @@ -142,6 +135,21 @@ static struct dvb_usb_properties a800_properties = { } }, + .size_of_priv = sizeof(struct dibusb_state), + }, + }, + + .power_ctrl = a800_power_ctrl, + .identify_state = a800_identify_state, + + .rc_interval = DEFAULT_RC_INTERVAL, + .rc_key_map = a800_rc_keys, + .rc_key_map_size = ARRAY_SIZE(a800_rc_keys), + .rc_query = a800_rc_query, + + .i2c_algo = &dibusb_i2c_algo, + + .generic_bulk_ctrl_endpoint = 0x01, .num_device_descs = 1, .devices = { { "AVerMedia AverTV DVB-T USB 2.0 (A800)", diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index c710c0176e0..5ebfa3f0854 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c @@ -161,13 +161,13 @@ static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff) return 0; } -static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) +static int cxusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) { u8 buf[2] = { 0x03, 0x00 }; if (onoff) - cxusb_ctrl_msg(d,CMD_STREAMING_ON, buf, 2, NULL, 0); + cxusb_ctrl_msg(adap->dev, CMD_STREAMING_ON, buf, 2, NULL, 0); else - cxusb_ctrl_msg(d,CMD_STREAMING_OFF, NULL, 0, NULL, 0); + cxusb_ctrl_msg(adap->dev, CMD_STREAMING_OFF, NULL, 0, NULL, 0); return 0; } @@ -327,8 +327,8 @@ static int cxusb_mt352_demod_init(struct dvb_frontend* fe) static int cxusb_lgh064f_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) { - struct dvb_usb_device *d = fe->dvb->priv; - return lg_h06xf_pll_set(fe, &d->i2c_adap, fep); + struct dvb_usb_adapter *adap = fe->dvb->priv; + return lg_h06xf_pll_set(fe, &adap->dev->i2c_adap, fep); } static struct cx22702_config cxusb_cx22702_config = { @@ -359,98 +359,99 @@ static struct mt352_config cxusb_mt352_config = { }; /* Callbacks for DVB USB */ -static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) +static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap) { u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 }; - d->pll_addr = 0x61; - memcpy(d->pll_init, bpll, 4); - d->pll_desc = &dvb_pll_fmd1216me; + adap->pll_addr = 0x61; + memcpy(adap->pll_init, bpll, 4); + adap->pll_desc = &dvb_pll_fmd1216me; - d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; - d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; + adap->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; + adap->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; return 0; } -static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d) +static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap) { - d->pll_addr = 0x61; - d->pll_desc = &dvb_pll_thomson_dtt7579; - d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; + adap->pll_addr = 0x61; + adap->pll_desc = &dvb_pll_thomson_dtt7579; + adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; return 0; } -static int cxusb_lgz201_tuner_attach(struct dvb_usb_device *d) +static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap) { - d->pll_addr = 0x61; - d->pll_desc = &dvb_pll_lg_z201; - d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; + adap->pll_addr = 0x61; + adap->pll_desc = &dvb_pll_lg_z201; + adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; return 0; } -static int cxusb_dtt7579_tuner_attach(struct dvb_usb_device *d) +static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap) { - d->pll_addr = 0x60; - d->pll_desc = &dvb_pll_thomson_dtt7579; - d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; + adap->pll_addr = 0x60; + adap->pll_desc = &dvb_pll_thomson_dtt7579; + adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; return 0; } -static int cxusb_lgdt3303_tuner_attach(struct dvb_usb_device *d) +static int cxusb_lgdt3303_tuner_attach(struct dvb_usb_adapter *adap) { - d->fe->ops.tuner_ops.set_params = cxusb_lgh064f_tuner_set_params; + adap->fe->ops.tuner_ops.set_params = cxusb_lgh064f_tuner_set_params; return 0; } -static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) +static int cxusb_cx22702_frontend_attach(struct dvb_usb_adapter *adap) { u8 b; - if (usb_set_interface(d->udev,0,6) < 0) + if (usb_set_interface(adap->dev->udev, 0, 6) < 0) err("set interface failed"); - cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1); + cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, &b, 1); - if ((d->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config, &d->i2c_adap)) != NULL) + if ((adap->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config, &adap->dev->i2c_adap)) != NULL) return 0; return -EIO; } -static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d) +static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap) { - if (usb_set_interface(d->udev,0,7) < 0) + if (usb_set_interface(adap->dev->udev, 0, 7) < 0) err("set interface failed"); - cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); + cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); - if ((d->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config, &d->i2c_adap)) != NULL) + if ((adap->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config, &adap->dev->i2c_adap)) != NULL) return 0; return -EIO; } -static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d) -{ /* used in both lgz201 and th7579 */ - if (usb_set_interface(d->udev,0,0) < 0) +static int cxusb_mt352_frontend_attach(struct dvb_usb_adapter *adap) +{ + /* used in both lgz201 and th7579 */ + if (usb_set_interface(adap->dev->udev, 0, 0) < 0) err("set interface failed"); - cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); + cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); - if ((d->fe = dvb_attach(mt352_attach, &cxusb_mt352_config, &d->i2c_adap)) != NULL) + if ((adap->fe = dvb_attach(mt352_attach, &cxusb_mt352_config, &adap->dev->i2c_adap)) != NULL) return 0; return -EIO; } -static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d) +static int cxusb_dee1601_frontend_attach(struct dvb_usb_adapter *adap) { - if (usb_set_interface(d->udev,0,0) < 0) + if (usb_set_interface(adap->dev->udev, 0, 0) < 0) err("set interface failed"); - cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); + cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); - if (((d->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config, &d->i2c_adap)) != NULL) || - ((d->fe = dvb_attach(zl10353_attach, &cxusb_zl10353_dee1601_config, &d->i2c_adap)) != NULL)) + if (((adap->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config, &adap->dev->i2c_adap)) != NULL) || + ((adap->fe = dvb_attach(zl10353_attach, &cxusb_zl10353_dee1601_config, &adap->dev->i2c_adap)) != NULL)) return 0; return -EIO; @@ -480,11 +481,11 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, const } /* DVB USB Driver stuff */ -static struct dvb_usb_properties cxusb_medion_properties; -static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties; -static struct dvb_usb_properties cxusb_bluebird_dee1601_properties; -static struct dvb_usb_properties cxusb_bluebird_lgz201_properties; -static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties; +static struct dvb_usb_device_properties cxusb_medion_properties; +static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties; +static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties; +static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties; +static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties; static int cxusb_probe(struct usb_interface *intf, const struct usb_device_id *id) @@ -516,24 +517,22 @@ static struct usb_device_id cxusb_table [] = { }; MODULE_DEVICE_TABLE (usb, cxusb_table); -static struct dvb_usb_properties cxusb_medion_properties = { +static struct dvb_usb_device_properties cxusb_medion_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = CYPRESS_FX2, .size_of_priv = sizeof(struct cxusb_state), + .num_adapters = 1, + .adapter = { + { .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_power_ctrl, .frontend_attach = cxusb_cx22702_frontend_attach, .tuner_attach = cxusb_fmd1216me_tuner_attach, - - .i2c_algo = &cxusb_i2c_algo, - - .generic_bulk_ctrl_endpoint = 0x01, /* parameter for the MPEG2-data transfer */ - .urb = { - .type = DVB_USB_BULK, + .stream = { + .type = USB_BULK, .count = 5, .endpoint = 0x02, .u = { @@ -543,6 +542,14 @@ static struct dvb_usb_properties cxusb_medion_properties = { } }, + }, + }, + .power_ctrl = cxusb_power_ctrl, + + .i2c_algo = &cxusb_i2c_algo, + + .generic_bulk_ctrl_endpoint = 0x01, + .num_device_descs = 1, .devices = { { "Medion MD95700 (MDUSBTV-HYBRID)", @@ -552,7 +559,7 @@ static struct dvb_usb_properties cxusb_medion_properties = { } }; -static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { +static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = DEVICE_SPECIFIC, @@ -563,22 +570,16 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { .size_of_priv = sizeof(struct cxusb_state), + .num_adapters = 1, + .adapter = { + { .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_bluebird_power_ctrl, .frontend_attach = cxusb_lgdt3303_frontend_attach, .tuner_attach = cxusb_lgdt3303_tuner_attach, - .i2c_algo = &cxusb_i2c_algo, - - .rc_interval = 100, - .rc_key_map = dvico_portable_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), - .rc_query = cxusb_rc_query, - - .generic_bulk_ctrl_endpoint = 0x01, /* parameter for the MPEG2-data transfer */ - .urb = { - .type = DVB_USB_BULK, + .stream = { + .type = USB_BULK, .count = 5, .endpoint = 0x02, .u = { @@ -587,6 +588,19 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { } } }, + }, + }, + + .power_ctrl = cxusb_bluebird_power_ctrl, + + .i2c_algo = &cxusb_i2c_algo, + + .rc_interval = 100, + .rc_key_map = dvico_portable_rc_keys, + .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), + .rc_query = cxusb_rc_query, + + .generic_bulk_ctrl_endpoint = 0x01, .num_device_descs = 1, .devices = { @@ -597,7 +611,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { } }; -static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { +static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = DEVICE_SPECIFIC, @@ -608,22 +622,15 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { .size_of_priv = sizeof(struct cxusb_state), + .num_adapters = 1, + .adapter = { + { .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_bluebird_power_ctrl, .frontend_attach = cxusb_dee1601_frontend_attach, .tuner_attach = cxusb_dee1601_tuner_attach, - - .i2c_algo = &cxusb_i2c_algo, - - .rc_interval = 150, - .rc_key_map = dvico_mce_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys), - .rc_query = cxusb_rc_query, - - .generic_bulk_ctrl_endpoint = 0x01, /* parameter for the MPEG2-data transfer */ - .urb = { - .type = DVB_USB_BULK, + .stream = { + .type = USB_BULK, .count = 5, .endpoint = 0x04, .u = { @@ -632,6 +639,19 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { } } }, + }, + }, + + .power_ctrl = cxusb_bluebird_power_ctrl, + + .i2c_algo = &cxusb_i2c_algo, + + .rc_interval = 150, + .rc_key_map = dvico_mce_rc_keys, + .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys), + .rc_query = cxusb_rc_query, + + .generic_bulk_ctrl_endpoint = 0x01, .num_device_descs = 2, .devices = { @@ -646,7 +666,7 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { } }; -static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = { +static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = DEVICE_SPECIFIC, @@ -657,22 +677,16 @@ static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = { .size_of_priv = sizeof(struct cxusb_state), + .num_adapters = 2, + .adapter = { + { .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_bluebird_power_ctrl, .frontend_attach = cxusb_mt352_frontend_attach, .tuner_attach = cxusb_lgz201_tuner_attach, - .i2c_algo = &cxusb_i2c_algo, - - .rc_interval = 100, - .rc_key_map = dvico_portable_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), - .rc_query = cxusb_rc_query, - - .generic_bulk_ctrl_endpoint = 0x01, /* parameter for the MPEG2-data transfer */ - .urb = { - .type = DVB_USB_BULK, + .stream = { + .type = USB_BULK, .count = 5, .endpoint = 0x04, .u = { @@ -681,7 +695,18 @@ static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = { } } }, + }, + }, + .power_ctrl = cxusb_bluebird_power_ctrl, + + .i2c_algo = &cxusb_i2c_algo, + .rc_interval = 100, + .rc_key_map = dvico_portable_rc_keys, + .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), + .rc_query = cxusb_rc_query, + + .generic_bulk_ctrl_endpoint = 0x01, .num_device_descs = 1, .devices = { { "DViCO FusionHDTV DVB-T USB (LGZ201)", @@ -691,7 +716,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = { } }; -static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = { +static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties = { .caps = DVB_USB_IS_AN_I2C_ADAPTER, .usb_ctrl = DEVICE_SPECIFIC, @@ -702,22 +727,16 @@ static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = { .size_of_priv = sizeof(struct cxusb_state), + .num_adapters = 1, + .adapter = { + { .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_bluebird_power_ctrl, .frontend_attach = cxusb_mt352_frontend_attach, .tuner_attach = cxusb_dtt7579_tuner_attach, - .i2c_algo = &cxusb_i2c_algo, - - .rc_interval = 100, - .rc_key_map = dvico_portable_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), - .rc_query = cxusb_rc_query, - - .generic_bulk_ctrl_endpoint = 0x01, /* parameter for the MPEG2-data transfer */ - .urb = { - .type = DVB_USB_BULK, + .stream = { + .type = USB_BULK, .count = 5, .endpoint = 0x04, .u = { @@ -726,6 +745,18 @@ static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = { } } }, + }, + }, + .power_ctrl = cxusb_bluebird_power_ctrl, + + .i2c_algo = &cxusb_i2c_algo, + + .rc_interval = 100, + .rc_key_map = dvico_portable_rc_keys, + .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), + .rc_query = cxusb_rc_query, + + .generic_bulk_ctrl_endpoint = 0x01, .num_device_descs = 1, .devices = { diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index 124e25ac53b..5f8afec96a3 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c @@ -18,12 +18,12 @@ MODULE_LICENSE("GPL"); #define deb_info(args...) dprintk(debug,0x01,args) /* common stuff used by the different dibusb modules */ -int dibusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) +int dibusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) { - if (d->priv != NULL) { - struct dibusb_state *st = d->priv; + if (adap->priv != NULL) { + struct dibusb_state *st = adap->priv; if (st->ops.fifo_ctrl != NULL) - if (st->ops.fifo_ctrl(d->fe,onoff)) { + if (st->ops.fifo_ctrl(adap->fe,onoff)) { err("error while controlling the fifo of the demod."); return -ENODEV; } @@ -32,23 +32,23 @@ int dibusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) } EXPORT_SYMBOL(dibusb_streaming_ctrl); -int dibusb_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff) +int dibusb_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) { - if (d->priv != NULL) { - struct dibusb_state *st = d->priv; + if (adap->priv != NULL) { + struct dibusb_state *st = adap->priv; if (st->ops.pid_ctrl != NULL) - st->ops.pid_ctrl(d->fe,index,pid,onoff); + st->ops.pid_ctrl(adap->fe,index,pid,onoff); } return 0; } EXPORT_SYMBOL(dibusb_pid_filter); -int dibusb_pid_filter_ctrl(struct dvb_usb_device *d, int onoff) +int dibusb_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) { - if (d->priv != NULL) { - struct dibusb_state *st = d->priv; + if (adap->priv != NULL) { + struct dibusb_state *st = adap->priv; if (st->ops.pid_parse != NULL) - if (st->ops.pid_parse(d->fe,onoff) < 0) + if (st->ops.pid_parse(adap->fe,onoff) < 0) err("could not handle pid_parser"); } return 0; @@ -68,24 +68,24 @@ int dibusb_power_ctrl(struct dvb_usb_device *d, int onoff) } EXPORT_SYMBOL(dibusb_power_ctrl); -int dibusb2_0_streaming_ctrl(struct dvb_usb_device *d, int onoff) +int dibusb2_0_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) { u8 b[3] = { 0 }; int ret; - if ((ret = dibusb_streaming_ctrl(d,onoff)) < 0) + if ((ret = dibusb_streaming_ctrl(adap,onoff)) < 0) return ret; if (onoff) { b[0] = DIBUSB_REQ_SET_STREAMING_MODE; b[1] = 0x00; - if ((ret = dvb_usb_generic_write(d,b,2)) < 0) + if ((ret = dvb_usb_generic_write(adap->dev,b,2)) < 0) return ret; } b[0] = DIBUSB_REQ_SET_IOCTL; b[1] = onoff ? DIBUSB_IOCTL_CMD_ENABLE_STREAM : DIBUSB_IOCTL_CMD_DISABLE_STREAM; - return dvb_usb_generic_write(d,b,3); + return dvb_usb_generic_write(adap->dev,b,3); } EXPORT_SYMBOL(dibusb2_0_streaming_ctrl); @@ -228,12 +228,12 @@ static struct dib3000mc_config mod3000p_dib3000p_config = { .output_mpeg2_in_188_bytes = 1, }; -int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d) +int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap) { - if (dib3000mc_attach(&d->i2c_adap, 1, DEFAULT_DIB3000P_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &d->fe) == 0 || - dib3000mc_attach(&d->i2c_adap, 1, DEFAULT_DIB3000MC_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &d->fe) == 0) { - if (d->priv != NULL) { - struct dibusb_state *st = d->priv; + if (dib3000mc_attach(&adap->dev->i2c_adap, 1, DEFAULT_DIB3000P_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &adap->fe) == 0 || + dib3000mc_attach(&adap->dev->i2c_adap, 1, DEFAULT_DIB3000MC_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &adap->fe) == 0) { + if (adap->priv != NULL) { + struct dibusb_state *st = adap->priv; st->ops.pid_parse = dib3000mc_pid_parse; st->ops.pid_ctrl = dib3000mc_pid_control; } @@ -247,20 +247,20 @@ static struct mt2060_config stk3000p_mt2060_config = { 0x60 }; -int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) +int dibusb_dib3000mc_tuner_attach (struct dvb_usb_adapter *adap) { - struct dibusb_state *st = d->priv; + struct dibusb_state *st = adap->priv; int ret; u8 a,b; u16 if1 = 1220; struct i2c_adapter *tun_i2c; // First IF calibration for Liteon Sticks - if (d->udev->descriptor.idVendor == USB_VID_LITEON && - d->udev->descriptor.idProduct == USB_PID_LITEON_DVB_T_WARM) { + if (adap->dev->udev->descriptor.idVendor == USB_VID_LITEON && + adap->dev->udev->descriptor.idProduct == USB_PID_LITEON_DVB_T_WARM) { - dibusb_read_eeprom_byte(d,0x7E,&a); - dibusb_read_eeprom_byte(d,0x7F,&b); + dibusb_read_eeprom_byte(adap->dev,0x7E,&a); + dibusb_read_eeprom_byte(adap->dev,0x7F,&b); if (a == 0x00) if1 += b; @@ -269,14 +269,14 @@ int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) else warn("LITE-ON DVB-T: Strange IF1 calibration :%2X %2X\n", a, b); - } else if (d->udev->descriptor.idVendor == USB_VID_DIBCOM && - d->udev->descriptor.idProduct == USB_PID_DIBCOM_MOD3001_WARM) { + } else if (adap->dev->udev->descriptor.idVendor == USB_VID_DIBCOM && + adap->dev->udev->descriptor.idProduct == USB_PID_DIBCOM_MOD3001_WARM) { u8 desc; - dibusb_read_eeprom_byte(d, 7, &desc); + dibusb_read_eeprom_byte(adap->dev, 7, &desc); if (desc == 2) { a = 127; do { - dibusb_read_eeprom_byte(d, a, &desc); + dibusb_read_eeprom_byte(adap->dev, a, &desc); a--; } while (a > 7 && (desc == 0xff || desc == 0x00)); if (desc & 0x80) @@ -286,15 +286,15 @@ int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) } } - tun_i2c = dib3000mc_get_tuner_i2c_master(d->fe, 1); - if ((ret = mt2060_attach(d->fe, tun_i2c, &stk3000p_mt2060_config, if1)) != 0) { + tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); + if ((ret = mt2060_attach(adap->fe, tun_i2c, &stk3000p_mt2060_config, if1)) != 0) { /* not found - use panasonic pll parameters */ - if (dvb_pll_attach(d->fe, 0x60, tun_i2c, &dvb_pll_env57h1xd5) == NULL) + if (dvb_pll_attach(adap->fe, 0x60, tun_i2c, &dvb_pll_env57h1xd5) == NULL) return -ENOMEM; } else { st->mt2060_present = 1; /* set the correct parameters for the dib3000p */ - dib3000mc_set_config(d->fe, &stk3000p_dib3000p_config); + dib3000mc_set_config(adap->fe, &stk3000p_dib3000p_config); } return 0; } diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c index effd34cc4b0..4fe363e4835 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c @@ -14,35 +14,35 @@ */ #include "dibusb.h" -static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_device *d) +static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap) { struct dib3000_config demod_cfg; - struct dibusb_state *st = d->priv; + struct dibusb_state *st = adap->priv; demod_cfg.demod_address = 0x8; - if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL) + if ((adap->fe = dib3000mb_attach(&demod_cfg,&adap->dev->i2c_adap,&st->ops)) == NULL) return -ENODEV; - d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; - d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; + adap->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; + adap->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; - d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; + adap->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; return 0; } -static int dibusb_thomson_tuner_attach(struct dvb_usb_device *d) +static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap) { - d->pll_addr |