summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2019-05-23 11:31:11 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-05-29 18:57:01 +0200
commit6bd914bc05f378071f9fa975ce91fbf9a4a5e224 (patch)
treef84e9a9042eb70ee93657d821526ba5b2025610f /drivers/media/usb
parentmedia: em28xx: give RC device proper name (diff)
downloadlinux-6bd914bc05f378071f9fa975ce91fbf9a4a5e224.tar.xz
linux-6bd914bc05f378071f9fa975ce91fbf9a4a5e224.zip
media: em28xx: use common code for decoding nec scancodes
Tested on WinTV-HVR-930C. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index e757a71d247f..6e43da5f6c5a 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -276,21 +276,8 @@ static int em2874_polling_getkey(struct em28xx_IR *ir,
break;
case RC_PROTO_BIT_NEC:
- poll_result->scancode = msg[1] << 8 | msg[2];
- if ((msg[3] ^ msg[4]) != 0xff) { /* 32 bits NEC */
- 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]);
- }
+ poll_result->scancode = ir_nec_bytes_to_scancode(msg[1], msg[2], msg[3], msg[4],
+ &poll_result->protocol);
break;
case RC_PROTO_BIT_RC6_0: