pinctrl: mediatek: Fix EINT pins input debounce time configuration
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Fri, 11 Nov 2022 09:41:06 +0000 (10:41 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 14 Nov 2022 13:20:41 +0000 (14:20 +0100)
commite1ff91f9d2303cd4e706cc908bfca21cd17b9927
treeaab9fcb0501757c38550fb478ba42aaa4db7f393
parent91d5c5060ee24fe8da88cd585bb43b843d2f0dce
pinctrl: mediatek: Fix EINT pins input debounce time configuration

The External Interrupt Controller (EINTC) on all of the supported
MediaTek SoCs does support input debouncing, but not all of them
index the debounce time values (DBNC_SETTING registers) the same way.

Before this change, in some cases, as an example, requesting a debounce
time of 16 milliseconds would mistakenly set the relative DBNC_SETTING
register to 0x2, resulting in a way shorter debounce time of 500uS.

To fix the aforementioned issue, define three different debounce_time
arrays, reflecting the correct register index for each value and for
each register index variant, and make sure that each SoC pinctrl
driver uses the right one.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221111094106.18486-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
22 files changed:
drivers/pinctrl/mediatek/mtk-eint.c
drivers/pinctrl/mediatek/mtk-eint.h
drivers/pinctrl/mediatek/pinctrl-mt2701.c
drivers/pinctrl/mediatek/pinctrl-mt2712.c
drivers/pinctrl/mediatek/pinctrl-mt6765.c
drivers/pinctrl/mediatek/pinctrl-mt6779.c
drivers/pinctrl/mediatek/pinctrl-mt6795.c
drivers/pinctrl/mediatek/pinctrl-mt7622.c
drivers/pinctrl/mediatek/pinctrl-mt7623.c
drivers/pinctrl/mediatek/pinctrl-mt7629.c
drivers/pinctrl/mediatek/pinctrl-mt7986.c
drivers/pinctrl/mediatek/pinctrl-mt8127.c
drivers/pinctrl/mediatek/pinctrl-mt8135.c
drivers/pinctrl/mediatek/pinctrl-mt8167.c
drivers/pinctrl/mediatek/pinctrl-mt8173.c
drivers/pinctrl/mediatek/pinctrl-mt8183.c
drivers/pinctrl/mediatek/pinctrl-mt8186.c
drivers/pinctrl/mediatek/pinctrl-mt8188.c
drivers/pinctrl/mediatek/pinctrl-mt8192.c
drivers/pinctrl/mediatek/pinctrl-mt8195.c
drivers/pinctrl/mediatek/pinctrl-mt8365.c
drivers/pinctrl/mediatek/pinctrl-mt8516.c