summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-08-29 22:03:47 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-08-29 22:03:47 -0300
commit8bb736e60de8ac0d4fdff3d50a7d79098fac81a5 (patch)
tree290bf9332f6943c668017b32040bc593604fab41 /linux/drivers/media/dvb
parente6159c2982e6ea65d49c90e25b11bcc74aab554a (diff)
downloadmediapointer-dvb-s2-8bb736e60de8ac0d4fdff3d50a7d79098fac81a5.tar.gz
mediapointer-dvb-s2-8bb736e60de8ac0d4fdff3d50a7d79098fac81a5.tar.bz2
dvb-usb-remote: return KEY_RESERVED if there's free space for new keys
From: Mauro Carvalho Chehab <mchehab@redhat.com> The input subsystem checks if get_keycode works for a scan code. Due to that, we need to return a valid value when there's some space at the table that can be used by a scancode. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c13
1 files changed, 13 insertions, 0 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 e7af19614..df72c8637 100644
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
@@ -26,6 +26,19 @@ static int dvb_usb_getkeycode(struct input_dev *dev,
*keycode = keymap[i].event;
return 0;
}
+
+ /*
+ * If is there extra space, returns KEY_RESERVED,
+ * otherwise, input core won't let dvb_usb_setkeycode
+ * to work
+ */
+ for (i = 0; i < d->props.rc_key_map_size; i++)
+ if (keymap[i].event == KEY_RESERVED ||
+ keymap[i].event == KEY_UNKNOWN) {
+ *keycode = KEY_RESERVED;
+ return 0;
+ }
+
return -EINVAL;
}