From: Sean Young <sean@mess.org>
To: linux-media@vger.kernel.org
Cc: Frank Wunderlich <frank-w@public-files.de>,
Sean Wang <sean.wang@mediatek.com>,
linux-mediatek@lists.infradead.org,
Matthias Brugger <matthias.bgg@gmail.com>,
Ryder Lee <ryder.lee@mediatek.com>
Subject: [PATCH 3/3] media: mtk-cir: lower de-glitch counter for rc-mm protocol
Date: Fri, 12 Jul 2019 23:47:00 +0100 [thread overview]
Message-ID: <20190712224700.11285-3-sean@mess.org> (raw)
In-Reply-To: <20190712224700.11285-1-sean@mess.org>
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 <sean@mess.org>
---
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;
--
2.21.0
next prev parent reply other threads:[~2019-07-12 22:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 22:46 [PATCH 1/3] media: mtk-cir: only allow protocols that have software decoders Sean Young
2019-07-12 22:46 ` [PATCH 2/3] media: rc: remove unused #define RC_PROTO_BIT_ALL Sean Young
2019-07-12 22:47 ` Sean Young [this message]
2019-07-14 7:00 ` [PATCH 3/3] media: mtk-cir: lower de-glitch counter for rc-mm protocol Sean Wang
2019-07-14 6:58 ` [PATCH 1/3] media: mtk-cir: only allow protocols that have software decoders Sean Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190712224700.11285-3-sean@mess.org \
--to=sean@mess.org \
--cc=frank-w@public-files.de \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox