From patchwork Fri Dec 2 17:16:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 9458905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0B6A860515 for ; Fri, 2 Dec 2016 17:17:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBE292858E for ; Fri, 2 Dec 2016 17:17:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E10F528591; Fri, 2 Dec 2016 17:17:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B35B2858E for ; Fri, 2 Dec 2016 17:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752038AbcLBRRL (ORCPT ); Fri, 2 Dec 2016 12:17:11 -0500 Received: from gofer.mess.org ([80.229.237.210]:54311 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbcLBRRJ (ORCPT ); Fri, 2 Dec 2016 12:17:09 -0500 Received: by gofer.mess.org (Postfix, from userid 1000) id 0EE16605F1; Fri, 2 Dec 2016 17:16:15 +0000 (GMT) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH 4/8] [media] em28xx: IR protocol not reported correctly Date: Fri, 2 Dec 2016 17:16:10 +0000 Message-Id: <1480698974-9093-4-git-send-email-sean@mess.org> X-Mailer: git-send-email 2.1.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Report the correct NEC variant. Signed-off-by: Sean Young --- drivers/media/usb/em28xx/em28xx-input.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c index a1904e2..a9a7f16 100644 --- a/drivers/media/usb/em28xx/em28xx-input.c +++ b/drivers/media/usb/em28xx/em28xx-input.c @@ -259,18 +259,21 @@ static int em2874_polling_getkey(struct em28xx_IR *ir, break; case RC_BIT_NEC: - poll_result->protocol = RC_TYPE_RC5; poll_result->scancode = msg[1] << 8 | msg[2]; - if ((msg[3] ^ msg[4]) != 0xff) /* 32 bits NEC */ + if ((msg[3] ^ msg[4]) != 0xff) { /* 32 bits NEC */ + poll_result->protocol = RC_TYPE_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 */ + } else if ((msg[1] ^ msg[2]) != 0xff) { /* 24 bits NEC */ + poll_result->protocol = RC_TYPE_NECX; poll_result->scancode = RC_SCANCODE_NECX(msg[1] << 8 | msg[2], msg[3]); - else /* Normal NEC */ + } else { /* Normal NEC */ + poll_result->protocol = RC_TYPE_NEC; poll_result->scancode = RC_SCANCODE_NEC(msg[1], msg[3]); + } break; case RC_BIT_RC6_0: @@ -775,7 +778,7 @@ static int em28xx_ir_init(struct em28xx *dev) case CHIP_ID_EM28178: ir->get_key = em2874_polling_getkey; rc->allowed_protocols = RC_BIT_RC5 | RC_BIT_NEC | - RC_BIT_RC6_0; + RC_BIT_NECX | RC_BIT_NEC32 | RC_BIT_RC6_0; break; default: err = -ENODEV;