Commit 9f940d8e authored by Fabien Parent's avatar Fabien Parent Committed by Linus Walleij
Browse files

pinctrl: mediatek: don't hardcode mode encoding in common code



MT8365 encode the pins mode differently than other
MTK pinctrl drivers that use the PINCTRL_MTK common code.

Add 3 new fields in mtk_pinctrl_devdata in order to store how
pin modes are encoded into the register. At the
same time update all the pinctrl driver that depends on
CONFIG_PINCTRL_MTK.

Signed-off-by: default avatarFabien Parent <fparent@baylibre.com>
Link: https://lore.kernel.org/r/20210519162409.3755679-2-fparent@baylibre.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 8b4c397d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -523,6 +523,9 @@ static const struct mtk_pinctrl_devdata mt2701_pinctrl_data = {
	.port_shf = 4,
	.port_mask = 0x1f,
	.port_align = 4,
	.mode_mask = 0xf,
	.mode_per_reg = 5,
	.mode_shf = 4,
	.eint_hw = {
		.port_mask = 6,
		.ports     = 6,
+3 −0
Original line number Diff line number Diff line
@@ -576,6 +576,9 @@ static const struct mtk_pinctrl_devdata mt2712_pinctrl_data = {
	.port_shf = 4,
	.port_mask = 0xf,
	.port_align = 4,
	.mode_mask = 0xf,
	.mode_per_reg = 5,
	.mode_shf = 4,
	.eint_hw = {
		.port_mask = 0xf,
		.ports     = 8,
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ static const struct mtk_pinctrl_devdata mt6397_pinctrl_data = {
	.port_shf = 3,
	.port_mask = 0x3,
	.port_align = 2,
	.mode_mask = 0xf,
	.mode_per_reg = 5,
	.mode_shf = 4,
};

static int mt6397_pinctrl_probe(struct platform_device *pdev)
+3 −0
Original line number Diff line number Diff line
@@ -292,6 +292,9 @@ static const struct mtk_pinctrl_devdata mt8127_pinctrl_data = {
	.port_shf = 4,
	.port_mask = 0xf,
	.port_align = 4,
	.mode_mask = 0xf,
	.mode_per_reg = 5,
	.mode_shf = 4,
	.eint_hw = {
		.port_mask = 7,
		.ports     = 6,
+3 −0
Original line number Diff line number Diff line
@@ -305,6 +305,9 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = {
	.port_shf = 4,
	.port_mask = 0xf,
	.port_align = 4,
	.mode_mask = 0xf,
	.mode_per_reg = 5,
	.mode_shf = 4,
	.eint_hw = {
		.port_mask = 7,
		.ports     = 6,
Loading