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>
This commit is contained in:
Sean Young 2018-10-18 07:03:33 -04:00 committed by Mauro Carvalho Chehab
parent 02d32bdad3
commit cea1c41d6b
2 changed files with 31 additions and 30 deletions

View File

@ -7,35 +7,35 @@
/* based on lircd.conf.xbox */ /* based on lircd.conf.xbox */
static struct rc_map_table xbox_dvd[] = { static struct rc_map_table xbox_dvd[] = {
{0x0b, KEY_OK}, {0xa0b, KEY_OK},
{0xa6, KEY_UP}, {0xaa6, KEY_UP},
{0xa7, KEY_DOWN}, {0xaa7, KEY_DOWN},
{0xa8, KEY_RIGHT}, {0xaa8, KEY_RIGHT},
{0xa9, KEY_LEFT}, {0xaa9, KEY_LEFT},
{0xc3, KEY_INFO}, {0xac3, KEY_INFO},
{0xc6, KEY_9}, {0xac6, KEY_9},
{0xc7, KEY_8}, {0xac7, KEY_8},
{0xc8, KEY_7}, {0xac8, KEY_7},
{0xc9, KEY_6}, {0xac9, KEY_6},
{0xca, KEY_5}, {0xaca, KEY_5},
{0xcb, KEY_4}, {0xacb, KEY_4},
{0xcc, KEY_3}, {0xacc, KEY_3},
{0xcd, KEY_2}, {0xacd, KEY_2},
{0xce, KEY_1}, {0xace, KEY_1},
{0xcf, KEY_0}, {0xacf, KEY_0},
{0xd5, KEY_ANGLE}, {0xad5, KEY_ANGLE},
{0xd8, KEY_BACK}, {0xad8, KEY_BACK},
{0xdd, KEY_PREVIOUSSONG}, {0xadd, KEY_PREVIOUSSONG},
{0xdf, KEY_NEXTSONG}, {0xadf, KEY_NEXTSONG},
{0xe0, KEY_STOP}, {0xae0, KEY_STOP},
{0xe2, KEY_REWIND}, {0xae2, KEY_REWIND},
{0xe3, KEY_FASTFORWARD}, {0xae3, KEY_FASTFORWARD},
{0xe5, KEY_TITLE}, {0xae5, KEY_TITLE},
{0xe6, KEY_PAUSE}, {0xae6, KEY_PAUSE},
{0xea, KEY_PLAY}, {0xaea, KEY_PLAY},
{0xf7, KEY_MENU}, {0xaf7, KEY_MENU},
}; };
static struct rc_map_list xbox_dvd_map = { static struct rc_map_list xbox_dvd_map = {

View File

@ -55,7 +55,7 @@ struct xbox_remote {
struct usb_interface *interface; struct usb_interface *interface;
struct urb *irq_urb; struct urb *irq_urb;
unsigned char inbuf[DATA_BUFSIZE]; unsigned char inbuf[DATA_BUFSIZE] __aligned(sizeof(u16));
char rc_name[NAME_BUFSIZE]; char rc_name[NAME_BUFSIZE];
char rc_phys[NAME_BUFSIZE]; char rc_phys[NAME_BUFSIZE];
@ -95,7 +95,7 @@ static void xbox_remote_input_report(struct urb *urb)
* data[0] = 0x00 * data[0] = 0x00
* data[1] = length - always 0x06 * data[1] = length - always 0x06
* data[2] = the key code * 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[4] = last_press_ms (low)
* data[5] = last_press_ms (high) * data[5] = last_press_ms (high)
*/ */
@ -107,7 +107,8 @@ static void xbox_remote_input_report(struct urb *urb)
return; 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);
} }
/* /*