diff options
author | Antti Palosaari <crope@iki.fi> | 2013-01-11 14:22:07 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-21 17:49:20 -0400 |
commit | b799b8102baa8e63139f0eadef00d75701328775 (patch) | |
tree | f48f41ef8aa554dab4f820168a64f92196a81589 | |
parent | e8c7aab50ddcb84f164422b5c8e0042a6fec6649 (diff) |
[media] af9035: [0ccd:0099] TerraTec Cinergy T Stick Dual RC (rev. 2)
That same USB ID is used both AF9015 and AF9035 driver.
iManufacturer is only thing we can select correct driver without a I/O.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/af9035.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 1a4aeefefb6a..ad66ac4b3913 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c | |||
@@ -1328,6 +1328,43 @@ err: | |||
1328 | #define af9035_get_rc_config NULL | 1328 | #define af9035_get_rc_config NULL |
1329 | #endif | 1329 | #endif |
1330 | 1330 | ||
1331 | static int af9035_probe(struct usb_interface *intf, | ||
1332 | const struct usb_device_id *id) | ||
1333 | { | ||
1334 | struct usb_device *udev = interface_to_usbdev(intf); | ||
1335 | char manufacturer[sizeof("Afatech")]; | ||
1336 | |||
1337 | memset(manufacturer, 0, sizeof(manufacturer)); | ||
1338 | usb_string(udev, udev->descriptor.iManufacturer, | ||
1339 | manufacturer, sizeof(manufacturer)); | ||
1340 | /* | ||
1341 | * There is two devices having same ID but different chipset. One uses | ||
1342 | * AF9015 and the other IT9135 chipset. Only difference seen on lsusb | ||
1343 | * is iManufacturer string. | ||
1344 | * | ||
1345 | * idVendor 0x0ccd TerraTec Electronic GmbH | ||
1346 | * idProduct 0x0099 | ||
1347 | * bcdDevice 2.00 | ||
1348 | * iManufacturer 1 Afatech | ||
1349 | * iProduct 2 DVB-T 2 | ||
1350 | * | ||
1351 | * idVendor 0x0ccd TerraTec Electronic GmbH | ||
1352 | * idProduct 0x0099 | ||
1353 | * bcdDevice 2.00 | ||
1354 | * iManufacturer 1 ITE Technologies, Inc. | ||
1355 | * iProduct 2 DVB-T TV Stick | ||
1356 | */ | ||
1357 | if ((le16_to_cpu(udev->descriptor.idVendor) == USB_VID_TERRATEC) && | ||
1358 | (le16_to_cpu(udev->descriptor.idProduct) == 0x0099)) { | ||
1359 | if (!strcmp("Afatech", manufacturer)) { | ||
1360 | dev_dbg(&udev->dev, "%s: rejecting device\n", __func__); | ||
1361 | return -ENODEV; | ||
1362 | } | ||
1363 | } | ||
1364 | |||
1365 | return dvb_usbv2_probe(intf, id); | ||
1366 | } | ||
1367 | |||
1331 | /* interface 0 is used by DVB-T receiver and | 1368 | /* interface 0 is used by DVB-T receiver and |
1332 | interface 1 is for remote controller (HID) */ | 1369 | interface 1 is for remote controller (HID) */ |
1333 | static const struct dvb_usb_device_properties af9035_props = { | 1370 | static const struct dvb_usb_device_properties af9035_props = { |
@@ -1386,6 +1423,9 @@ static const struct usb_device_id af9035_id_table[] = { | |||
1386 | &af9035_props, "Asus U3100Mini Plus", NULL) }, | 1423 | &af9035_props, "Asus U3100Mini Plus", NULL) }, |
1387 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00aa, | 1424 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00aa, |
1388 | &af9035_props, "TerraTec Cinergy T Stick (rev. 2)", NULL) }, | 1425 | &af9035_props, "TerraTec Cinergy T Stick (rev. 2)", NULL) }, |
1426 | /* XXX: that same ID [0ccd:0099] is used by af9015 driver too */ | ||
1427 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x0099, | ||
1428 | &af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) }, | ||
1389 | { } | 1429 | { } |
1390 | }; | 1430 | }; |
1391 | MODULE_DEVICE_TABLE(usb, af9035_id_table); | 1431 | MODULE_DEVICE_TABLE(usb, af9035_id_table); |
@@ -1393,7 +1433,7 @@ MODULE_DEVICE_TABLE(usb, af9035_id_table); | |||
1393 | static struct usb_driver af9035_usb_driver = { | 1433 | static struct usb_driver af9035_usb_driver = { |
1394 | .name = KBUILD_MODNAME, | 1434 | .name = KBUILD_MODNAME, |
1395 | .id_table = af9035_id_table, | 1435 | .id_table = af9035_id_table, |
1396 | .probe = dvb_usbv2_probe, | 1436 | .probe = af9035_probe, |
1397 | .disconnect = dvb_usbv2_disconnect, | 1437 | .disconnect = dvb_usbv2_disconnect, |
1398 | .suspend = dvb_usbv2_suspend, | 1438 | .suspend = dvb_usbv2_suspend, |
1399 | .resume = dvb_usbv2_resume, | 1439 | .resume = dvb_usbv2_resume, |