diff options
Diffstat (limited to 'drivers/media/usb/dvb-usb-v2')
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/dvb_usb.h | 1 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 58 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/dvbsky.c | 26 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 8 |
5 files changed, 78 insertions, 17 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/Kconfig b/drivers/media/usb/dvb-usb-v2/Kconfig index 0982e734fab5..9facc92c8dea 100644 --- a/drivers/media/usb/dvb-usb-v2/Kconfig +++ b/drivers/media/usb/dvb-usb-v2/Kconfig @@ -146,7 +146,7 @@ config DVB_USB_DVBSKY depends on DVB_USB_V2 select DVB_M88DS3103 if MEDIA_SUBDRV_AUTOSELECT select DVB_SI2168 if MEDIA_SUBDRV_AUTOSELECT - select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT + select DVB_TS2020 if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_SI2157 if MEDIA_SUBDRV_AUTOSELECT select DVB_SP2 if MEDIA_SUBDRV_AUTOSELECT help diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb.h b/drivers/media/usb/dvb-usb-v2/dvb_usb.h index 41c6363dff08..023d91f7e654 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb.h +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb.h @@ -25,6 +25,7 @@ #include <linux/usb/input.h> #include <linux/firmware.h> #include <media/rc-core.h> +#include <media/media-device.h> #include "dvb_frontend.h" #include "dvb_demux.h" diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index 9913e0f59485..f5df9eaba04f 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -400,10 +400,61 @@ skip_feed_stop: return ret; } +static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap) +{ +#ifdef CONFIG_MEDIA_CONTROLLER_DVB + struct media_device *mdev; + struct dvb_usb_device *d = adap_to_d(adap); + struct usb_device *udev = d->udev; + int ret; + + mdev = kzalloc(sizeof(*mdev), GFP_KERNEL); + if (!mdev) + return; + + mdev->dev = &udev->dev; + strlcpy(mdev->model, d->name, sizeof(mdev->model)); + if (udev->serial) + strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial)); + strcpy(mdev->bus_info, udev->devpath); + mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice); + mdev->driver_version = LINUX_VERSION_CODE; + + ret = media_device_register(mdev); + if (ret) { + dev_err(&d->udev->dev, + "Couldn't create a media device. Error: %d\n", + ret); + kfree(mdev); + return; + } + + dvb_register_media_controller(&adap->dvb_adap, mdev); + + dev_info(&d->udev->dev, "media controller created\n"); + +#endif +} + +static void dvb_usbv2_media_device_unregister(struct dvb_usb_adapter *adap) +{ +#ifdef CONFIG_MEDIA_CONTROLLER_DVB + + if (!adap->dvb_adap.mdev) + return; + + media_device_unregister(adap->dvb_adap.mdev); + kfree(adap->dvb_adap.mdev); + adap->dvb_adap.mdev = NULL; + +#endif +} + static int dvb_usbv2_adapter_dvb_init(struct dvb_usb_adapter *adap) { int ret; struct dvb_usb_device *d = adap_to_d(adap); + dev_dbg(&d->udev->dev, "%s: adap=%d\n", __func__, adap->id); ret = dvb_register_adapter(&adap->dvb_adap, d->name, d->props->owner, @@ -416,6 +467,8 @@ static int dvb_usbv2_adapter_dvb_init(struct dvb_usb_adapter *adap) adap->dvb_adap.priv = adap; + dvb_usbv2_media_device_register(adap); + if (d->props->read_mac_address) { ret = d->props->read_mac_address(adap, adap->dvb_adap.proposed_mac); @@ -464,6 +517,7 @@ err_dvb_net_init: err_dvb_dmxdev_init: dvb_dmx_release(&adap->demux); err_dvb_dmx_init: + dvb_usbv2_media_device_unregister(adap); dvb_unregister_adapter(&adap->dvb_adap); err_dvb_register_adapter: adap->dvb_adap.priv = NULL; @@ -480,6 +534,7 @@ static int dvb_usbv2_adapter_dvb_exit(struct dvb_usb_adapter *adap) adap->demux.dmx.close(&adap->demux.dmx); dvb_dmxdev_release(&adap->dmxdev); dvb_dmx_release(&adap->demux); + dvb_usbv2_media_device_unregister(adap); dvb_unregister_adapter(&adap->dvb_adap); } @@ -643,6 +698,8 @@ static int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap) } } + dvb_create_media_graph(&adap->dvb_adap); + return 0; err_dvb_unregister_frontend: @@ -955,6 +1012,7 @@ void dvb_usbv2_disconnect(struct usb_interface *intf) struct dvb_usb_device *d = usb_get_intfdata(intf); const char *name = d->name; struct device dev = d->udev->dev; + dev_dbg(&d->udev->dev, "%s: bInterfaceNumber=%d\n", __func__, intf->cur_altsetting->desc.bInterfaceNumber); diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c index 9b5add4499e3..cdf59bcd760c 100644 --- a/drivers/media/usb/dvb-usb-v2/dvbsky.c +++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c @@ -20,7 +20,7 @@ #include "dvb_usb.h" #include "m88ds3103.h" -#include "m88ts2022.h" +#include "ts2020.h" #include "sp2.h" #include "si2168.h" #include "si2157.h" @@ -315,9 +315,7 @@ static int dvbsky_s960_attach(struct dvb_usb_adapter *adap) struct i2c_adapter *i2c_adapter; struct i2c_client *client; struct i2c_board_info info; - struct m88ts2022_config m88ts2022_config = { - .clock = 27000000, - }; + struct ts2020_config ts2020_config = {}; memset(&info, 0, sizeof(struct i2c_board_info)); /* attach demod */ @@ -332,11 +330,11 @@ static int dvbsky_s960_attach(struct dvb_usb_adapter *adap) } /* attach tuner */ - m88ts2022_config.fe = adap->fe[0]; - strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE); + ts2020_config.fe = adap->fe[0]; + strlcpy(info.type, "ts2020", I2C_NAME_SIZE); info.addr = 0x60; - info.platform_data = &m88ts2022_config; - request_module("m88ts2022"); + info.platform_data = &ts2020_config; + request_module("ts2020"); client = i2c_new_device(i2c_adapter, &info); if (client == NULL || client->dev.driver == NULL) { dvb_frontend_detach(adap->fe[0]); @@ -439,9 +437,7 @@ static int dvbsky_s960c_attach(struct dvb_usb_adapter *adap) struct i2c_client *client_tuner, *client_ci; struct i2c_board_info info; struct sp2_config sp2_config; - struct m88ts2022_config m88ts2022_config = { - .clock = 27000000, - }; + struct ts2020_config ts2020_config = {}; memset(&info, 0, sizeof(struct i2c_board_info)); /* attach demod */ @@ -456,11 +452,11 @@ static int dvbsky_s960c_attach(struct dvb_usb_adapter *adap) } /* attach tuner */ - m88ts2022_config.fe = adap->fe[0]; - strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE); + ts2020_config.fe = adap->fe[0]; + strlcpy(info.type, "ts2020", I2C_NAME_SIZE); info.addr = 0x60; - info.platform_data = &m88ts2022_config; - request_module("m88ts2022"); + info.platform_data = &ts2020_config; + request_module("ts2020"); client_tuner = i2c_new_device(i2c_adapter, &info); if (client_tuner == NULL || client_tuner->dev.driver == NULL) { ret = -ENODEV; diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c index 87fc0fe29ebd..895441fe90f7 100644 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c @@ -866,6 +866,8 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) mn88472_config.i2c_wr_max = 22, strlcpy(info.type, "mn88472", I2C_NAME_SIZE); mn88472_config.xtal = 20500000; + mn88472_config.ts_mode = SERIAL_TS_MODE; + mn88472_config.ts_clock = VARIABLE_TS_CLOCK; info.addr = 0x18; info.platform_data = &mn88472_config; request_module(info.type); @@ -1609,7 +1611,7 @@ static int rtl2832u_get_rc_config(struct dvb_usb_device *d, rc->allowed_protos = RC_BIT_ALL; rc->driver_type = RC_DRIVER_IR_RAW; rc->query = rtl2832u_rc_query; - rc->interval = 400; + rc->interval = 200; return 0; } @@ -1724,6 +1726,8 @@ static const struct usb_device_id rtl28xxu_id_table[] = { &rtl28xxu_props, "DigitalNow Quad DVB-T Receiver", NULL) }, { DVB_USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_MINID, &rtl28xxu_props, "Leadtek Winfast DTV Dongle Mini D", NULL) }, + { DVB_USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV2000DS_PLUS, + &rtl28xxu_props, "Leadtek WinFast DTV2000DS Plus", RC_MAP_LEADTEK_Y04G0051) }, { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00d3, &rtl28xxu_props, "TerraTec Cinergy T Stick RC (Rev. 3)", NULL) }, { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x1102, @@ -1754,6 +1758,8 @@ static const struct usb_device_id rtl28xxu_id_table[] = { &rtl28xxu_props, "Sveon STV21", NULL) }, { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV27, &rtl28xxu_props, "Sveon STV27", NULL) }, + { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_TURBOX_DTT_2000, + &rtl28xxu_props, "TURBO-X Pure TV Tuner DTT-2000", NULL) }, /* RTL2832P devices: */ { DVB_USB_DEVICE(USB_VID_HANFTEK, 0x0131, |