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 e1db0352e..b3c65224f 100644
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
@@ -82,7 +82,8 @@ schedule:
int dvb_usb_remote_init(struct dvb_usb_device *d)
{
- if (d->props.query_rc == NULL)
+ int i;
+ if (d->props.rc_key_map == NULL)
return 0;
/* Initialise the remote-control structures.*/
@@ -94,7 +95,8 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
d->rc_input_dev.name = "Remote control inside an USB DVB receiver";
/* set the bits for the keys */
- d->props.init_rc(d);
+ for (i = 0; i < sizeof(d->props.rc_key_map)/sizeof(struct dvb_usb_rc_key); i++)
+ set_bit(d->props.rc_key_map[i].event, d->rc_input_dev.keybit);
/* Start the remote-control polling. */
if (d->props.rc_interval < 40)
@@ -130,11 +132,11 @@ 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,
+ u8 keybuf[5], u32 *event, int *state)
{
int i;
+ struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
*event = 0;
*state = REMOTE_NO_KEY_PRESSED;
switch (keybuf[0]) {
@@ -147,7 +149,7 @@ int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, struct
break;
}
/* See if we can match the raw key code. */
- for (i = 0; i < key_count; i++)
+ for (i = 0; i < sizeof(keymap)/sizeof(struct dvb_usb_rc_key); i++)
if (keymap[i].custom == keybuf[1] &&
keymap[i].data == keybuf[3]) {
*event = keymap[i].event;