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;