summaryrefslogtreecommitdiff
path: root/drivers/media/rc/img-ir/img-ir-nec.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/rc/img-ir/img-ir-nec.c
parent00bb820755ed8ee996f076f193d2eadbfba50a2e (diff)
[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/rc/img-ir/img-ir-nec.c')
-rw-r--r--drivers/media/rc/img-ir/img-ir-nec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/rc/img-ir/img-ir-nec.c b/drivers/media/rc/img-ir/img-ir-nec.c
index 27a7ea8f1260..09314933ea08 100644
--- a/drivers/media/rc/img-ir/img-ir-nec.c
+++ b/drivers/media/rc/img-ir/img-ir-nec.c
@@ -34,19 +34,21 @@ static int img_ir_nec_scancode(int len, u64 raw, u64 enabled_protocols,
bitrev8(addr_inv) << 16 |
bitrev8(data) << 8 |
bitrev8(data_inv);
+ request->protocol = RC_TYPE_NEC32;
} else if ((addr_inv ^ addr) != 0xff) {
/* Extended NEC */
/* scan encoding: AAaaDD */
request->scancode = addr << 16 |
addr_inv << 8 |
data;
+ request->protocol = RC_TYPE_NECX;
} else {
/* Normal NEC */
/* scan encoding: AADD */
request->scancode = addr << 8 |
data;
+ request->protocol = RC_TYPE_NEC;
}
- request->protocol = RC_TYPE_NEC;
return IMG_IR_SCANCODE;
}
@@ -109,7 +111,7 @@ static int img_ir_nec_filter(const struct rc_scancode_filter *in,
* http://wiki.altium.com/display/ADOH/NEC+Infrared+Transmission+Protocol
*/
struct img_ir_decoder img_ir_nec = {
- .type = RC_BIT_NEC,
+ .type = RC_BIT_NEC | RC_BIT_NECX | RC_BIT_NEC32,
.control = {
.decoden = 1,
.code_type = IMG_IR_CODETYPE_PULSEDIST,