diff options
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c index c73b3f9c6..8baaef1c7 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c @@ -254,11 +254,19 @@ int dibusb_remote_init(struct usb_dibusb *dib) dib->rc_input_dev.keycodemax = KEY_MAX; dib->rc_input_dev.name = DRIVER_DESC " remote control"; - for (i=0; i<sizeof(nec_rc_keys)/sizeof(nec_rc_keys[0]); i++) - set_bit(haupp_rc_keys[i].key, dib->rc_input_dev.keybit); + switch (dib->dibdev->dev_cl->remote_type) { + case DIBUSB_RC_NEC_PROTOCOL: + for (i=0; i<sizeof(nec_rc_keys)/sizeof(nec_rc_keys[0]); i++) + set_bit(nec_rc_keys[i].key, dib->rc_input_dev.keybit); + break; + case DIBUSB_RC_HAUPPAUGE_PROTO: + for (i=0; i<sizeof(haupp_rc_keys)/sizeof(haupp_rc_keys[0]); i++) + set_bit(haupp_rc_keys[i].key, dib->rc_input_dev.keybit); + break; + default: + break; + } - for (i=0; i<sizeof(haupp_rc_keys)/sizeof(haupp_rc_keys[0]); i++) - set_bit(haupp_rc_keys[i].key, dib->rc_input_dev.keybit); input_register_device(&dib->rc_input_dev); |