mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
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 <[email protected]> Acked-by: Benjamin Valentin <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
fdf5de6339
commit
172876928f
6 changed files with 13 additions and 4 deletions
|
|
@ -42,7 +42,7 @@ static struct rc_map_list xbox_dvd_map = {
|
|||
.map = {
|
||||
.scan = xbox_dvd,
|
||||
.size = ARRAY_SIZE(xbox_dvd),
|
||||
.rc_proto = RC_PROTO_UNKNOWN,
|
||||
.rc_proto = RC_PROTO_XBOX_DVD,
|
||||
.name = RC_MAP_XBOX_DVD,
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ static const struct {
|
|||
.scancode_bits = 0x00ffffff, .repeat_period = 114 },
|
||||
[RC_PROTO_RCMM32] = { .name = "rc-mm-32",
|
||||
.scancode_bits = 0xffffffff, .repeat_period = 114 },
|
||||
[RC_PROTO_XBOX_DVD] = { .name = "xbox-dvd", .repeat_period = 64 },
|
||||
};
|
||||
|
||||
/* Used to keep track of known keymaps */
|
||||
|
|
@ -1027,6 +1028,7 @@ static const struct {
|
|||
{ RC_PROTO_BIT_RCMM12 |
|
||||
RC_PROTO_BIT_RCMM24 |
|
||||
RC_PROTO_BIT_RCMM32, "rc-mm", "ir-rcmm-decoder" },
|
||||
{ RC_PROTO_BIT_XBOX_DVD, "xbox-dvd", NULL },
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ static void xbox_remote_input_report(struct urb *urb)
|
|||
return;
|
||||
}
|
||||
|
||||
rc_keydown(xbox_remote->rdev, RC_PROTO_UNKNOWN,
|
||||
rc_keydown(xbox_remote->rdev, RC_PROTO_XBOX_DVD,
|
||||
le16_to_cpup((__le16 *)(data + 2)), 0);
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ static void xbox_remote_rc_init(struct xbox_remote *xbox_remote)
|
|||
struct rc_dev *rdev = xbox_remote->rdev;
|
||||
|
||||
rdev->priv = xbox_remote;
|
||||
rdev->allowed_protocols = RC_PROTO_BIT_UNKNOWN;
|
||||
rdev->allowed_protocols = RC_PROTO_BIT_XBOX_DVD;
|
||||
rdev->driver_name = "xbox_remote";
|
||||
|
||||
rdev->open = xbox_remote_rc_open;
|
||||
|
|
@ -157,6 +157,8 @@ static void xbox_remote_rc_init(struct xbox_remote *xbox_remote)
|
|||
rdev->device_name = xbox_remote->rc_name;
|
||||
rdev->input_phys = xbox_remote->rc_phys;
|
||||
|
||||
rdev->timeout = MS_TO_NS(10);
|
||||
|
||||
usb_to_input_id(xbox_remote->udev, &rdev->input_id);
|
||||
rdev->dev.parent = &xbox_remote->interface->dev;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue