Commit 6bd914bc authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: em28xx: use common code for decoding nec scancodes

Tested on WinTV-HVR-930C.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 5c1c6953
...@@ -276,21 +276,8 @@ static int em2874_polling_getkey(struct em28xx_IR *ir, ...@@ -276,21 +276,8 @@ static int em2874_polling_getkey(struct em28xx_IR *ir,
break; break;
case RC_PROTO_BIT_NEC: case RC_PROTO_BIT_NEC:
poll_result->scancode = msg[1] << 8 | msg[2]; poll_result->scancode = ir_nec_bytes_to_scancode(msg[1], msg[2], msg[3], msg[4],
if ((msg[3] ^ msg[4]) != 0xff) { /* 32 bits NEC */ &poll_result->protocol);
poll_result->protocol = RC_PROTO_NEC32;
poll_result->scancode = RC_SCANCODE_NEC32((msg[1] << 24) |
(msg[2] << 16) |
(msg[3] << 8) |
(msg[4]));
} else if ((msg[1] ^ msg[2]) != 0xff) { /* 24 bits NEC */
poll_result->protocol = RC_PROTO_NECX;
poll_result->scancode = RC_SCANCODE_NECX(msg[1] << 8 |
msg[2], msg[3]);
} else { /* Normal NEC */
poll_result->protocol = RC_PROTO_NEC;
poll_result->scancode = RC_SCANCODE_NEC(msg[1], msg[3]);
}
break; break;
case RC_PROTO_BIT_RC6_0: case RC_PROTO_BIT_RC6_0:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment