From patchwork Fri Jul 12 22:46:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 11042723 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 7A87A14DB for ; Fri, 12 Jul 2019 22:47:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6854726E4F for ; Fri, 12 Jul 2019 22:47:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C24728553; Fri, 12 Jul 2019 22:47:17 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0B98926E4F for ; Fri, 12 Jul 2019 22:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=MfqCAsbx3+znqcgLpZLwudUIcjAnnhx+HDUcR3+2u4k=; b=h3P 99/tA5x3l5Kw9sGwrd9sOY0rEgtt8iZpEJJ4QEDVhPBlkkns6Bor07giQIt5d/IWd1L4emG5ueWMt jlauc9eh7zFyyEa519Sk2huuULgG5YWL9rWJs7NGo70+HTGgSf/zqu1pcerdYhs6m7nbVrt+XIskJ DOrFoZAIH+7Ny1Y6BUpErzhuKpqoOOzt+T1SiIWGZsG13U3Aw5kyBvTBg+0efVJC0+N9ZOnvgf3KP BZeDAEobLK8Yd+qFpb9Pa5aE5bwYdZrE2Ig44Lttyz7+mkzZxlyvZ3nndh2ivSzmVJp8eUsK9+tIF lIDllErFGBOzpcggHdBXBL8L2N6j+0w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hm4Jv-0002I0-Dy; Fri, 12 Jul 2019 22:47:15 +0000 Received: from gofer.mess.org ([2a02:8011:d000:212::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hm4Jr-0002H8-Bq for linux-mediatek@lists.infradead.org; Fri, 12 Jul 2019 22:47:13 +0000 Received: by gofer.mess.org (Postfix, from userid 1000) id ABB956047B; Fri, 12 Jul 2019 23:47:00 +0100 (BST) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH 1/3] media: mtk-cir: only allow protocols that have software decoders Date: Fri, 12 Jul 2019 23:46:58 +0100 Message-Id: <20190712224700.11285-1-sean@mess.org> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190712_154711_547982_7A12A015 X-CRM114-Status: UNSURE ( 8.61 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthias Brugger , Sean Wang , linux-mediatek@lists.infradead.org, Ryder Lee , Frank Wunderlich MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP RC_PROTO_BIT_ALL includes protocols like unknown and other that do not have IR decoders by definition. If these protocols are set in the allowed_protocols, they will show in the protocols sysfs file but cannot be enabled. Signed-off-by: Sean Young Acked-by: Sean Wang --- drivers/media/rc/mtk-cir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c index 46101efe017b..9dc467ebae24 100644 --- a/drivers/media/rc/mtk-cir.c +++ b/drivers/media/rc/mtk-cir.c @@ -342,7 +342,7 @@ static int mtk_ir_probe(struct platform_device *pdev) ir->rc->map_name = map_name ?: RC_MAP_EMPTY; ir->rc->dev.parent = dev; ir->rc->driver_name = MTK_IR_DEV; - ir->rc->allowed_protocols = RC_PROTO_BIT_ALL; + ir->rc->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; ir->rc->rx_resolution = MTK_IR_SAMPLE; ir->rc->timeout = MTK_MAX_SAMPLES * (MTK_IR_SAMPLE + 1); From patchwork Fri Jul 12 22:46:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 11042727 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 3B34413A4 for ; Fri, 12 Jul 2019 22:52:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 257D42857B for ; Fri, 12 Jul 2019 22:52:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A2AC28581; Fri, 12 Jul 2019 22:52:40 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UPPERCASE_50_75 autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 172002857B for ; Fri, 12 Jul 2019 22:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=o5LSIv8ICtZw96h8Z6MbOlz7PEX9eGlVRYR4wee/0jA=; b=buDa0bOwP+4syELnoHiuoeBgYY Zgmb4OvQou+dOB7Qw+y7AxY8TfP0mNQO/psd1+hTNEMgYD7Lxjhd8et0yuRPuxfXfxsOOsur+r5zD cbYvyHS7xsxCfvJ1PG/Kv8rdgfYx0z0xdsZ6sBQdyPxMSo41Jz4SQuQN/NwBhpR/17cZGbMP9Hnx1 y59pG4ydziRx6wiBPHnnsDp6COMF22yEPajLtNWvX1vzCjsv70TIIeKColF0EwJ1SQcxxXrLK2wnk otpiYXLBu0+4gPFVV/c4wdrkgLQdYVELjLyOavLAU6b6PyDLMsY26mRPSI8cLmPJEgpM9Apini83v a3WT3v9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hm4P8-0003uo-DI; Fri, 12 Jul 2019 22:52:38 +0000 Received: from gofer.mess.org ([88.97.38.141]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hm4P5-0003uN-Kt for linux-mediatek@lists.infradead.org; Fri, 12 Jul 2019 22:52:36 +0000 Received: by gofer.mess.org (Postfix, from userid 1000) id CB0E4600B4; Fri, 12 Jul 2019 23:47:00 +0100 (BST) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH 2/3] media: rc: remove unused #define RC_PROTO_BIT_ALL Date: Fri, 12 Jul 2019 23:46:59 +0100 Message-Id: <20190712224700.11285-2-sean@mess.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190712224700.11285-1-sean@mess.org> References: <20190712224700.11285-1-sean@mess.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190712_155235_828162_40585AC7 X-CRM114-Status: UNSURE ( 6.20 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthias Brugger , Sean Wang , linux-mediatek@lists.infradead.org, Ryder Lee , Frank Wunderlich MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This lists all the protocols that the kernel knows about, however there are no users. Signed-off-by: Sean Young --- include/media/rc-map.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/include/media/rc-map.h b/include/media/rc-map.h index bebd3c4c6338..3a7f8728f6ec 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -38,22 +38,6 @@ #define RC_PROTO_BIT_RCMM32 BIT_ULL(RC_PROTO_RCMM32) #define RC_PROTO_BIT_XBOX_DVD BIT_ULL(RC_PROTO_XBOX_DVD) -#define RC_PROTO_BIT_ALL \ - (RC_PROTO_BIT_UNKNOWN | RC_PROTO_BIT_OTHER | \ - RC_PROTO_BIT_RC5 | RC_PROTO_BIT_RC5X_20 | \ - RC_PROTO_BIT_RC5_SZ | RC_PROTO_BIT_JVC | \ - RC_PROTO_BIT_SONY12 | RC_PROTO_BIT_SONY15 | \ - RC_PROTO_BIT_SONY20 | RC_PROTO_BIT_NEC | \ - RC_PROTO_BIT_NECX | RC_PROTO_BIT_NEC32 | \ - RC_PROTO_BIT_SANYO | \ - RC_PROTO_BIT_MCIR2_KBD | RC_PROTO_BIT_MCIR2_MSE | \ - RC_PROTO_BIT_RC6_0 | RC_PROTO_BIT_RC6_6A_20 | \ - RC_PROTO_BIT_RC6_6A_24 | RC_PROTO_BIT_RC6_6A_32 | \ - RC_PROTO_BIT_RC6_MCE | RC_PROTO_BIT_SHARP | \ - RC_PROTO_BIT_XMP | RC_PROTO_BIT_CEC | \ - RC_PROTO_BIT_IMON | RC_PROTO_BIT_RCMM12 | \ - RC_PROTO_BIT_RCMM24 | RC_PROTO_BIT_RCMM32 | \ - RC_PROTO_BIT_XBOX_DVD) /* All rc protocols for which we have decoders */ #define RC_PROTO_BIT_ALL_IR_DECODER \ (RC_PROTO_BIT_RC5 | RC_PROTO_BIT_RC5X_20 | \ From patchwork Fri Jul 12 22:47:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 11042725 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 0920514F6 for ; Fri, 12 Jul 2019 22:47:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBBAA26E4F for ; Fri, 12 Jul 2019 22:47:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF72B28553; Fri, 12 Jul 2019 22:47:17 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9890626E4F for ; Fri, 12 Jul 2019 22:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DLFXHMbs7rqOXJ5ctqFxjJMg5S4V+Lgggctvd39D95s=; b=uaETlOPUP2aGSt/S0HbWN19I3e 0FupjUDx/DXNwVYdPJsn59+rXzX97R46H9z0DBVz0ca5wKIQTeofbBsItOWBV15DKm7v8CIQaZ1/g xdkCQPsBEoU2a0T4io9qN7YD6FysuQ+vK2yx5siIFnBprPchl3tu1z9Xwc/tY83sYg/2n116Qc/+5 rLbEJbTKh59feyKHYjubcEHTovRaIzwLc2Vbk4XvvC/9h+6HwnL2Elyym3mn2Ulp4VqStHBxzgrR0 /y5iTpwr/dSDdmUyzxAMxklp/IYKtQS+IIQwRzx/9f0HEg9WhmZesVxqOQ5Ozjin+X1dFHpd3FEkc WsOBA13A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hm4Jx-0002Ig-1e; Fri, 12 Jul 2019 22:47:17 +0000 Received: from gofer.mess.org ([2a02:8011:d000:212::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hm4Jr-0002H7-C9 for linux-mediatek@lists.infradead.org; Fri, 12 Jul 2019 22:47:13 +0000 Received: by gofer.mess.org (Postfix, from userid 1000) id 1A91060665; Fri, 12 Jul 2019 23:47:01 +0100 (BST) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH 3/3] media: mtk-cir: lower de-glitch counter for rc-mm protocol Date: Fri, 12 Jul 2019 23:47:00 +0100 Message-Id: <20190712224700.11285-3-sean@mess.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190712224700.11285-1-sean@mess.org> References: <20190712224700.11285-1-sean@mess.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190712_154711_547982_34FAE5AF X-CRM114-Status: UNSURE ( 6.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthias Brugger , Sean Wang , linux-mediatek@lists.infradead.org, Ryder Lee , Frank Wunderlich MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The rc-mm protocol can't be decoded by the mtk-cir since the de-glitch filter removes pulses/spaces shorter than 294 microseconds. Tested on a BananaPi R2. Signed-off-by: Sean Young Acked-by: Sean Wang --- drivers/media/rc/mtk-cir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c index 9dc467ebae24..8027181de985 100644 --- a/drivers/media/rc/mtk-cir.c +++ b/drivers/media/rc/mtk-cir.c @@ -35,6 +35,11 @@ /* Fields containing pulse width data */ #define MTK_WIDTH_MASK (GENMASK(7, 0)) +/* IR threshold */ +#define MTK_IRTHD 0x14 +#define MTK_DG_CNT_MASK (GENMASK(12, 8)) +#define MTK_DG_CNT(x) ((x) << 8) + /* Bit to enable interrupt */ #define MTK_IRINT_EN BIT(0) @@ -400,6 +405,9 @@ static int mtk_ir_probe(struct platform_device *pdev) mtk_w32_mask(ir, val, ir->data->fields[MTK_HW_PERIOD].mask, ir->data->fields[MTK_HW_PERIOD].reg); + /* Set de-glitch counter */ + mtk_w32_mask(ir, MTK_DG_CNT(1), MTK_DG_CNT_MASK, MTK_IRTHD); + /* Enable IR and PWM */ val = mtk_r32(ir, MTK_CONFIG_HIGH_REG); val |= MTK_OK_COUNT(ir->data->ok_count) | MTK_PWM_EN | MTK_IR_EN;