summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/dvb-usb-v2/az6007.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2016-09-21 06:54:19 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-22 11:46:49 -0300
commit2ceeca0499d745213306ecd785af17adb2321b6a (patch)
tree7bd01f282f8fd67bdbd4a3828e1af6db34744a65 /drivers/media/usb/dvb-usb-v2/az6007.c
parent00bb820755ed8ee996f076f193d2eadbfba50a2e (diff)
downloadlinux-2ceeca0499d745213306ecd785af17adb2321b6a.tar.bz2
[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-v2/az6007.c')
-rw-r--r--drivers/media/usb/dvb-usb-v2/az6007.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c b/drivers/media/usb/dvb-usb-v2/az6007.c
index 935dbaa80ef0..50c07fe7dacb 100644
--- a/drivers/media/usb/dvb-usb-v2/az6007.c
+++ b/drivers/media/usb/dvb-usb-v2/az6007.c
@@ -208,6 +208,7 @@ static int az6007_rc_query(struct dvb_usb_device *d)
{
struct az6007_device_state *st = d_to_priv(d);
unsigned code;
+ enum rc_type proto;
az6007_read(d, AZ6007_READ_IR, 0, 0, st->data, 10);
@@ -215,19 +216,23 @@ static int az6007_rc_query(struct dvb_usb_device *d)
return 0;
if ((st->data[3] ^ st->data[4]) == 0xff) {
- if ((st->data[1] ^ st->data[2]) == 0xff)
+ if ((st->data[1] ^ st->data[2]) == 0xff) {
code = RC_SCANCODE_NEC(st->data[1], st->data[3]);
- else
+ proto = RC_TYPE_NEC;
+ } else {
code = RC_SCANCODE_NECX(st->data[1] << 8 | st->data[2],
st->data[3]);
+ proto = RC_TYPE_NECX;
+ }
} else {
code = RC_SCANCODE_NEC32(st->data[1] << 24 |
st->data[2] << 16 |
st->data[3] << 8 |
st->data[4]);
+ proto = RC_TYPE_NEC32;
}
- rc_keydown(d->rc_dev, RC_TYPE_NEC, code, st->data[5]);
+ rc_keydown(d->rc_dev, proto, code, st->data[5]);
return 0;
}
@@ -236,7 +241,7 @@ static int az6007_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc)
{
pr_debug("Getting az6007 Remote Control properties\n");
- rc->allowed_protos = RC_BIT_NEC;
+ rc->allowed_protos = RC_BIT_NEC | RC_BIT_NECX | RC_BIT_NEC32;
rc->query = az6007_rc_query;
rc->interval = 400;