Skip to content

Commit 5dd4b89

Browse files
seanyoungmchehab
authored andcommitted
media: mtk-cir: lower de-glitch counter for rc-mm protocol
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 <[email protected]> Acked-by: Sean Wang <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent a81431e commit 5dd4b89

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/media/rc/mtk-cir.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
/* Fields containing pulse width data */
3636
#define MTK_WIDTH_MASK (GENMASK(7, 0))
3737

38+
/* IR threshold */
39+
#define MTK_IRTHD 0x14
40+
#define MTK_DG_CNT_MASK (GENMASK(12, 8))
41+
#define MTK_DG_CNT(x) ((x) << 8)
42+
3843
/* Bit to enable interrupt */
3944
#define MTK_IRINT_EN BIT(0)
4045

@@ -398,6 +403,9 @@ static int mtk_ir_probe(struct platform_device *pdev)
398403
mtk_w32_mask(ir, val, ir->data->fields[MTK_HW_PERIOD].mask,
399404
ir->data->fields[MTK_HW_PERIOD].reg);
400405

406+
/* Set de-glitch counter */
407+
mtk_w32_mask(ir, MTK_DG_CNT(1), MTK_DG_CNT_MASK, MTK_IRTHD);
408+
401409
/* Enable IR and PWM */
402410
val = mtk_r32(ir, MTK_CONFIG_HIGH_REG);
403411
val |= MTK_OK_COUNT(ir->data->ok_count) | MTK_PWM_EN | MTK_IR_EN;

0 commit comments

Comments
 (0)