Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
From: Sean Wang <sean.wang@kernel.org>
To: Sean Young <sean@mess.org>
Cc: linux-media@vger.kernel.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Sean Wang <sean.wang@mediatek.com>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@lists.infradead.org>,
	Ryder Lee <ryder.lee@mediatek.com>,
	Frank Wunderlich <frank-w@public-files.de>
Subject: Re: [PATCH 3/3] media: mtk-cir: lower de-glitch counter for rc-mm protocol
Date: Sun, 14 Jul 2019 00:00:50 -0700
Message-ID: <CAGp9Lzq+RcizFgP4LJMxaH3K6Jcbk8jit8bv+3M2fwqwwV4NvA@mail.gmail.com> (raw)
In-Reply-To: <20190712224700.11285-3-sean@mess.org>

On Fri, Jul 12, 2019 at 3:47 PM Sean Young <sean@mess.org> wrote:
>
> 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.

Thanks for grabbing the board and do the test voluntarily.

>
> Signed-off-by: Sean Young <sean@mess.org>

Acked-by: Sean Wang <sean.wang@kernel.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
>
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek

  reply index

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 ` [PATCH 3/3] media: mtk-cir: lower de-glitch counter for rc-mm protocol Sean Young
2019-07-14  7:00   ` Sean Wang [this message]
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 publically 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=CAGp9Lzq+RcizFgP4LJMxaH3K6Jcbk8jit8bv+3M2fwqwwV4NvA@mail.gmail.com \
    --to=sean.wang@kernel.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 \
    --cc=sean@mess.org \
    /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

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org linux-media@archiver.kernel.org
	public-inbox-index linux-media


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/ public-inbox