original_kernel/drivers/media/rc/keymaps/rc-xbox-dvd.c

64 lines
1.3 KiB
C
Raw Normal View History

// SPDX-License-Identifier: GPL-2.0+
// Keytable for Xbox DVD remote
// Copyright (c) 2018 by Benjamin Valentin <benpicco@googlemail.com>
#include <media/rc-map.h>
#include <linux/module.h>
/* based on lircd.conf.xbox */
static struct rc_map_table xbox_dvd[] = {
{0xa0b, KEY_OK},
{0xaa6, KEY_UP},
{0xaa7, KEY_DOWN},
{0xaa8, KEY_RIGHT},
{0xaa9, KEY_LEFT},
{0xac3, KEY_INFO},
{0xac6, KEY_NUMERIC_9},
{0xac7, KEY_NUMERIC_8},
{0xac8, KEY_NUMERIC_7},
{0xac9, KEY_NUMERIC_6},
{0xaca, KEY_NUMERIC_5},
{0xacb, KEY_NUMERIC_4},
{0xacc, KEY_NUMERIC_3},
{0xacd, KEY_NUMERIC_2},
{0xace, KEY_NUMERIC_1},
{0xacf, KEY_NUMERIC_0},
{0xad5, KEY_ANGLE},
{0xad8, KEY_BACK},
{0xadd, KEY_PREVIOUSSONG},
{0xadf, KEY_NEXTSONG},
{0xae0, KEY_STOP},
{0xae2, KEY_REWIND},
{0xae3, KEY_FASTFORWARD},
{0xae5, KEY_TITLE},
{0xae6, KEY_PAUSE},
{0xaea, KEY_PLAY},
{0xaf7, KEY_MENU},
};
static struct rc_map_list xbox_dvd_map = {
.map = {
.scan = xbox_dvd,
.size = ARRAY_SIZE(xbox_dvd),
media: rc: xbox_remote: add protocol and set timeout The timestamps in ir-keytable -t output showed that the Xbox DVD IR dongle decodes scancodes every 64ms. The last scancode of a longer button press is decodes 64ms after the last-but-one which indicates the decoder doesn't use a timeout but decodes on the last edge of the signal. 267.042629: lirc protocol(unknown): scancode = 0xace 267.042665: event type EV_MSC(0x04): scancode = 0xace 267.042665: event type EV_KEY(0x01) key_down: KEY_1(0x0002) 267.042665: event type EV_SYN(0x00). 267.106625: lirc protocol(unknown): scancode = 0xace 267.106643: event type EV_MSC(0x04): scancode = 0xace 267.106643: event type EV_SYN(0x00). 267.170623: lirc protocol(unknown): scancode = 0xace 267.170638: event type EV_MSC(0x04): scancode = 0xace 267.170638: event type EV_SYN(0x00). 267.234621: lirc protocol(unknown): scancode = 0xace 267.234636: event type EV_MSC(0x04): scancode = 0xace 267.234636: event type EV_SYN(0x00). 267.298623: lirc protocol(unknown): scancode = 0xace 267.298638: event type EV_MSC(0x04): scancode = 0xace 267.298638: event type EV_SYN(0x00). 267.543345: event type EV_KEY(0x01) key_down: KEY_1(0x0002) 267.543345: event type EV_SYN(0x00). 267.570015: event type EV_KEY(0x01) key_up: KEY_1(0x0002) 267.570015: event type EV_SYN(0x00). Add a protocol with the repeat value and set the timeout in the driver to 10ms (to have a bit of headroom for delays) so the Xbox DVD remote performs more responsive. Signed-off-by: Matthias Reichl <hias@horus.com> Acked-by: Benjamin Valentin <benpicco@googlemail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-24 17:43:51 +08:00
.rc_proto = RC_PROTO_XBOX_DVD,
.name = RC_MAP_XBOX_DVD,
}
};
static int __init init_rc_map(void)
{
return rc_map_register(&xbox_dvd_map);
}
static void __exit exit_rc_map(void)
{
rc_map_unregister(&xbox_dvd_map);
}
module_init(init_rc_map)
module_exit(exit_rc_map)
MODULE_LICENSE("GPL");