Skip to content

Commit

Permalink
media: mtk-cir: lower de-glitch counter for rc-mm protocol
Browse files Browse the repository at this point in the history
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>
Acked-by: Sean Wang <sean.wang@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Sean Young authored and Mauro Carvalho Chehab committed Jul 22, 2019
1 parent a81431e commit 5dd4b89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/media/rc/mtk-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -398,6 +403,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;
Expand Down

0 comments on commit 5dd4b89

Please sign in to comment.