diff options
author | Anssi Hannula <anssi.hannula@iki.fi> | 2011-08-06 17:18:12 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-22 09:54:40 -0400 |
commit | 999d6bc9b142a531fb10652c64de51e2ad672a1e (patch) | |
tree | d9e2f49851a9c09c0f3f874688e8d37983807cd0 /drivers/media/rc/ati_remote.c | |
parent | 175fcecf79b4698c7beea5810326dba66a56ea39 (diff) |
[media] ati_remote: add support for SnapStream Firefly remote
The protocol differs by having two toggle bits in the scancode. Since
one of the bits is otherwise unused, we can safely handle the bits
unconditionally.
[mchehab@redhat.com: Fix some bad whitespacing]
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 | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 94d241d37619..303f22ea04c0 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c | |||
@@ -107,6 +107,7 @@ | |||
107 | #define ATI_REMOTE_PRODUCT_ID 0x0004 | 107 | #define ATI_REMOTE_PRODUCT_ID 0x0004 |
108 | #define NVIDIA_REMOTE_PRODUCT_ID 0x0005 | 108 | #define NVIDIA_REMOTE_PRODUCT_ID 0x0005 |
109 | #define MEDION_REMOTE_PRODUCT_ID 0x0006 | 109 | #define MEDION_REMOTE_PRODUCT_ID 0x0006 |
110 | #define FIREFLY_REMOTE_PRODUCT_ID 0x0008 | ||
110 | 111 | ||
111 | #define DRIVER_VERSION "2.2.1" | 112 | #define DRIVER_VERSION "2.2.1" |
112 | #define DRIVER_AUTHOR "Torrey Hoffman <thoffman@arnor.net>" | 113 | #define DRIVER_AUTHOR "Torrey Hoffman <thoffman@arnor.net>" |
@@ -156,6 +157,7 @@ static struct usb_device_id ati_remote_table[] = { | |||
156 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, | 157 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, |
157 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, | 158 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, |
158 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_MEDION_X10 }, | 159 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_MEDION_X10 }, |
160 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_SNAPSTREAM_FIREFLY }, | ||
159 | {} /* Terminating entry */ | 161 | {} /* Terminating entry */ |
160 | }; | 162 | }; |
161 | 163 | ||
@@ -482,7 +484,15 @@ static void ati_remote_input_report(struct urb *urb) | |||
482 | 484 | ||
483 | scancode[0] = (((data[1] - ((remote_num + 1) << 4)) & 0xf0) | (data[1] & 0x0f)); | 485 | scancode[0] = (((data[1] - ((remote_num + 1) << 4)) & 0xf0) | (data[1] & 0x0f)); |
484 | 486 | ||
485 | scancode[1] = data[2]; | 487 | /* |
488 | * Some devices (e.g. SnapStream Firefly) use 8080 as toggle code, | ||
489 | * so we have to clear them. The first bit is a bit tricky as the | ||
490 | * "non-toggled" state depends on remote_num, so we xor it with the | ||
491 | * second bit which is only used for toggle. | ||
492 | */ | ||
493 | scancode[0] ^= (data[2] & 0x80); | ||
494 | |||
495 | scancode[1] = data[2] & ~0x80; | ||
486 | 496 | ||
487 | /* Look up event code index in mouse translation table. */ | 497 | /* Look up event code index in mouse translation table. */ |
488 | index = ati_remote_event_lookup(remote_num, scancode[0], scancode[1]); | 498 | index = ati_remote_event_lookup(remote_num, scancode[0], scancode[1]); |
@@ -546,7 +556,8 @@ static void ati_remote_input_report(struct urb *urb) | |||
546 | * it would cause ghost repeats which would be a | 556 | * it would cause ghost repeats which would be a |
547 | * regression for this driver. | 557 | * regression for this driver. |
548 | */ | 558 | */ |
549 | rc_keydown_notimeout(ati_remote->rdev, rc_code, 0); | 559 | rc_keydown_notimeout(ati_remote->rdev, rc_code, |
560 | data[2]); | ||
550 | rc_keyup(ati_remote->rdev); | 561 | rc_keyup(ati_remote->rdev); |
551 | return; | 562 | return; |
552 | } | 563 | } |