summaryrefslogtreecommitdiff
path: root/drivers/media/usb/dvb-usb/dtt200u.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2016-09-21 09:54:19 (GMT)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-22 14:46:49 (GMT)
commit2ceeca0499d745213306ecd785af17adb2321b6a (patch)
tree7bd01f282f8fd67bdbd4a3828e1af6db34744a65 /drivers/media/usb/dvb-usb/dtt200u.c
parent00bb820755ed8ee996f076f193d2eadbfba50a2e (diff)
downloadlinux-2ceeca0499d745213306ecd785af17adb2321b6a.tar.xz
[media] rc: split nec protocol into its three variants
Currently we do not know what variant (bit length) of the nec protocol is used, other than from guessing from the length of the scancode. Now nec will be handled the same way as the sony protocol or the rc6 protocol; one variant per bit length. In the future we might want to expose the rc protocol type to userspace and we don't want to be introducing this world of pain into userspace too. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/dvb-usb/dtt200u.c')
-rw-r--r--drivers/media/usb/dvb-usb/dtt200u.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb/dtt200u.c b/drivers/media/usb/dvb-usb/dtt200u.c
index be633ec..d2a01b5 100644
--- a/drivers/media/usb/dvb-usb/dtt200u.c
+++ b/drivers/media/usb/dvb-usb/dtt200u.c
@@ -62,18 +62,21 @@ static int dtt200u_rc_query(struct dvb_usb_device *d)
dvb_usb_generic_rw(d,&cmd,1,key,5,0);
if (key[0] == 1) {
+ enum rc_type proto = RC_TYPE_NEC;
+
scancode = key[1];
if ((u8) ~key[1] != key[2]) {
/* Extended NEC */
scancode = scancode << 8;
scancode |= key[2];
+ proto = RC_TYPE_NECX;
}
scancode = scancode << 8;
scancode |= key[3];
/* Check command checksum is ok */
if ((u8) ~key[3] == key[4])
- rc_keydown(d->rc_dev, RC_TYPE_NEC, scancode, 0);
+ rc_keydown(d->rc_dev, proto, scancode, 0);
else
rc_keyup(d->rc_dev);
} else if (key[0] == 2) {