From patchwork Tue Aug 28 13:49:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Reichl X-Patchwork-Id: 10578547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BFCE13B8 for ; Tue, 28 Aug 2018 13:49:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D63C2A316 for ; Tue, 28 Aug 2018 13:49:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21D022A31C; Tue, 28 Aug 2018 13:49:46 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 852612A316 for ; Tue, 28 Aug 2018 13:49:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbeH1Rl3 (ORCPT ); Tue, 28 Aug 2018 13:41:29 -0400 Received: from mail.horus.com ([78.46.148.228]:35035 "EHLO mail.horus.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727519AbeH1Rl3 (ORCPT ); Tue, 28 Aug 2018 13:41:29 -0400 Received: from [192.168.1.20] (62-46-134-118.adsl.highway.telekom.at [62.46.134.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "E-Mail Matthias Reichl", Issuer "HiassofT CA 2014" (verified OK)) by mail.horus.com (Postfix) with ESMTPSA id BCDB264092; Tue, 28 Aug 2018 15:49:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=horus.com; s=20180324; t=1535464182; bh=jiALck5QUX2THOWEFI0Pse98VUF6gSkbbUTwP2AKMRc=; h=Date:From:To:Cc:Subject:From; b=RknIGWBUU2M2fRQmVLf0ANQZTeU8w3WZaKXkY6DaVMqF31Q5AuWRhLIXiAyjdbNwn y9O7ZhUusKTWqqmp8kRRdehYq5ZMU/gyaFsogfyufwpehPT7Mdv7LontFhXE2FntKp 6d9pg0l1kI1t3yT6B4DraXmav/AtjbIdh8Xqya9g= Received: by camel2.lan (Postfix, from userid 1000) id 4041C1C7349; Tue, 28 Aug 2018 15:49:42 +0200 (CEST) Date: Tue, 28 Aug 2018 15:49:42 +0200 From: Matthias Reichl To: Sean Young Cc: linux-media@vger.kernel.org Subject: [PATCH] media: rc: ir-rc6-decoder: enable toggle bit for Kathrein RCU-676 remote Message-ID: <20180828134942.3ckdxl7lofjabd3o@camel2.lan> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) 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 The Kathrein RCU-676 remote uses the 32-bit rc6 protocol and toggles bit 15 (0x8000) on repeated button presses, like MCE remotes. Add it's customer code 0x80460000 to the 32-bit rc6 toggle handling code to get proper scancodes and toggle reports. Signed-off-by: Matthias Reichl --- Here's the link to the bugreport and discussion: https://forum.libreelec.tv/thread/13086-get-kathrein-rcu-676-remote-to-work-with-le9/ drivers/media/rc/ir-rc6-decoder.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c index 68487ce9f79b..d96aed1343e4 100644 --- a/drivers/media/rc/ir-rc6-decoder.c +++ b/drivers/media/rc/ir-rc6-decoder.c @@ -40,6 +40,7 @@ #define RC6_6A_MCE_TOGGLE_MASK 0x8000 /* for the body bits */ #define RC6_6A_LCC_MASK 0xffff0000 /* RC6-6A-32 long customer code mask */ #define RC6_6A_MCE_CC 0x800f0000 /* MCE customer code */ +#define RC6_6A_KATHREIN_CC 0x80460000 /* Kathrein RCU-676 customer code */ #ifndef CHAR_BIT #define CHAR_BIT 8 /* Normally in */ #endif @@ -242,13 +243,17 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) toggle = 0; break; case 32: - if ((scancode & RC6_6A_LCC_MASK) == RC6_6A_MCE_CC) { + switch (scancode & RC6_6A_LCC_MASK) { + case RC6_6A_MCE_CC: + case RC6_6A_KATHREIN_CC: protocol = RC_PROTO_RC6_MCE; toggle = !!(scancode & RC6_6A_MCE_TOGGLE_MASK); scancode &= ~RC6_6A_MCE_TOGGLE_MASK; - } else { + break; + default: protocol = RC_PROTO_RC6_6A_32; toggle = 0; + break; } break; default: