summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/xbox_remote.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-10-18 07:03:33 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-11-22 13:28:24 -0500
commitcea1c41d6ba010559f9ccdcfc80ce185e7fab080 (patch)
tree564c6eba8b69c60feab31d978a5212143a0ccd23 /drivers/media/rc/xbox_remote.c
parent02d32bdad3123d7376244256936a6b3b6ee434e8 (diff)
downloadlinux-cea1c41d6ba010559f9ccdcfc80ce185e7fab080.tar.bz2
media: rc: XBox DVD Remote uses 12 bits scancodes
The xbox dvd remote sends 24 bits, the first 12 bits are repeated and inverted so only 12 bits are used. The upper 4 bits can be read at offset 3. Ensure we pass this to rc-core and update the keymap accordingly. Tested-by: Benjamin Valentin <benpicco@googlemail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/rc/xbox_remote.c')
-rw-r--r--drivers/media/rc/xbox_remote.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/rc/xbox_remote.c b/drivers/media/rc/xbox_remote.c
index 141ef9253018..f959cbb94744 100644
--- a/drivers/media/rc/xbox_remote.c
+++ b/drivers/media/rc/xbox_remote.c
@@ -55,7 +55,7 @@ struct xbox_remote {
struct usb_interface *interface;
struct urb *irq_urb;
- unsigned char inbuf[DATA_BUFSIZE];
+ unsigned char inbuf[DATA_BUFSIZE] __aligned(sizeof(u16));
char rc_name[NAME_BUFSIZE];
char rc_phys[NAME_BUFSIZE];
@@ -95,7 +95,7 @@ static void xbox_remote_input_report(struct urb *urb)
* data[0] = 0x00
* data[1] = length - always 0x06
* data[2] = the key code
- * data[3] = high part of key code? - always 0x0a
+ * data[3] = high part of key code
* data[4] = last_press_ms (low)
* data[5] = last_press_ms (high)
*/
@@ -107,7 +107,8 @@ static void xbox_remote_input_report(struct urb *urb)
return;
}
- rc_keydown(xbox_remote->rdev, RC_PROTO_UNKNOWN, data[2], 0);
+ rc_keydown(xbox_remote->rdev, RC_PROTO_UNKNOWN,
+ le16_to_cpup((__le16 *)(data + 2)), 0);
}
/*