summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c')
-rw-r--r--linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
index 7908b4de6..e1db0352e 100644
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
@@ -130,7 +130,9 @@ int dvb_usb_remote_exit(struct dvb_usb_device *d)
#define DVB_USB_RC_NEC_EMPTY 0x00
#define DVB_USB_RC_NEC_KEY_PRESSED 0x01
#define DVB_USB_RC_NEC_KEY_REPEATED 0x02
-int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, struct dvb_usb_nec_rc_key keymap[],int key_count, u8 keybuf[5], u32 *event, int *state)
+int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, struct
+ dvb_usb_nec_rc_key keymap[],int key_count, u8 keybuf[5], u32 *event,
+ int *state)
{
int i;
*event = 0;
@@ -139,16 +141,16 @@ int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, struct dvb_usb_nec_rc_
case DVB_USB_RC_NEC_EMPTY:
break;
case DVB_USB_RC_NEC_KEY_PRESSED:
- if ((0xff - keybuf[3]) != keybuf[4]) {
+ if ((u8) ~keybuf[1] != keybuf[2] ||
+ (u8) ~keybuf[3] != keybuf[4]) {
deb_err("remote control checksum failed.\n");
break;
}
/* See if we can match the raw key code. */
for (i = 0; i < key_count; i++)
- if (keymap[i].c0 == keybuf[1] &&
- keymap[i].c1 == keybuf[2] &&
- keymap[i].c2 == keybuf[3]) {
- *event = keymap[i].key;
+ if (keymap[i].custom == keybuf[1] &&
+ keymap[i].data == keybuf[3]) {
+ *event = keymap[i].event;
*state = REMOTE_KEY_PRESSED;
break;
}