diff mbox series

[3/5] pinctrl: ingenic: Fix inverted direction for < JZ4770

Message ID 20180627114904.10890-4-paul@crapouillou.net
State New
Headers show
Series pinctrl_gpio_get_direction & ingenic fixes | expand

Commit Message

Paul Cercueil June 27, 2018, 11:49 a.m. UTC
The .gpio_set_direction() callback was setting inverted direction
for SoCs older than the JZ4770, this restores the correct behaviour.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/pinctrl/pinctrl-ingenic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij July 9, 2018, 11:58 a.m. UTC | #1
On Wed, Jun 27, 2018 at 1:49 PM Paul Cercueil <paul@crapouillou.net> wrote:

> The .gpio_set_direction() callback was setting inverted direction
> for SoCs older than the JZ4770, this restores the correct behaviour.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

As you pointed out that this was an important fix I picked it
out and applied for fixes (v4.18) before looking at the rest of
the patches.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
index a1d7156d0a43..6a1b6058b991 100644
--- a/drivers/pinctrl/pinctrl-ingenic.c
+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -536,7 +536,7 @@  static int ingenic_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
 		ingenic_config_pin(jzpc, pin, JZ4770_GPIO_PAT1, input);
 	} else {
 		ingenic_config_pin(jzpc, pin, JZ4740_GPIO_SELECT, false);
-		ingenic_config_pin(jzpc, pin, JZ4740_GPIO_DIR, input);
+		ingenic_config_pin(jzpc, pin, JZ4740_GPIO_DIR, !input);
 		ingenic_config_pin(jzpc, pin, JZ4740_GPIO_FUNC, false);
 	}