diff options
author | Anssi Hannula <anssi.hannula@iki.fi> | 2012-05-14 16:52:37 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-20 18:40:06 +0400 |
commit | 5085c99eeb8e47bcfc2cce6ba0ae03db057057ba (patch) | |
tree | aa2e59ec362636d2886d43c6b0093bd5dd0b8446 /drivers/media/rc/ati_remote.c | |
parent | 9554d57ebbc78db6d66057bfc12552247a7567da (diff) | |
download | linux-5085c99eeb8e47bcfc2cce6ba0ae03db057057ba.tar.xz |
[media] ati_remote: add keymap for Medion X10 OR2x remotes
Add another Medion X10 remote keymap. This is for the Medion OR2x
remotes with the Windows MCE button.
The receiver shipped with this remote has the same USB ID as the other
Medion receivers, but the name is different and is therefore used to
detect this variant.
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/ati_remote.c')
-rw-r--r-- | drivers/media/rc/ati_remote.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 26fa043d3de7..7be377fc1be8 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -161,10 +161,32 @@ static const char *get_medion_keymap(struct usb_interface *interface) { struct usb_device *udev = interface_to_usbdev(interface); - /* The receiver shipped with the "Digitainer" variant helpfully has - * a single additional bit set in its descriptor. */ - if (udev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_WAKEUP) - return RC_MAP_MEDION_X10_DIGITAINER; + /* + * There are many different Medion remotes shipped with a receiver + * with the same usb id, but the receivers have subtle differences + * in the USB descriptors allowing us to detect them. + */ + + if (udev->manufacturer && udev->product) { + if (udev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_WAKEUP) { + + if (!strcmp(udev->manufacturer, "X10 Wireless Technology Inc") + && !strcmp(udev->product, "USB Receiver")) + return RC_MAP_MEDION_X10_DIGITAINER; + + if (!strcmp(udev->manufacturer, "X10 WTI") + && !strcmp(udev->product, "RF receiver")) + return RC_MAP_MEDION_X10_OR2X; + } else { + + if (!strcmp(udev->manufacturer, "X10 Wireless Technology Inc") + && !strcmp(udev->product, "USB Receiver")) + return RC_MAP_MEDION_X10; + } + } + + dev_info(&interface->dev, + "Unknown Medion X10 receiver, using default ati_remote Medion keymap\n"); return RC_MAP_MEDION_X10; } |