提交 7795686d 编写于 作者: H Hans Verkuil 提交者: Linus Walleij

pinctrl-sunxi: sunxi_pinctrl_gpio_direction_in/output: use correct offset

The commit that sets the direction directly without calling
pinctrl_gpio_direction(), forgot to add chip->base to the offset when
calling sunxi_pmx_gpio_set_direction().

This caused failures for various Allwinner boards which have two
GPIO blocks.
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: N5kft <5kft@5kft.org>
Suggested-by: N5kft <5kft@5kft.org>
Reported-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
Fixes: 8df89a7c (pinctrl-sunxi: don't call pinctrl_gpio_direction())
Tested-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: NJernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: NJernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/0f536cd8-01db-5d16-2cec-ec6d19409a49@xs4all.nlSigned-off-by: NGuenter Roeck <linux@roeck-us.net>
[Picked from linux-next to pinctrl fixes]
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 7e57714c
...@@ -837,7 +837,8 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip, ...@@ -837,7 +837,8 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip,
{ {
struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, true); return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL,
chip->base + offset, true);
} }
static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
...@@ -890,7 +891,8 @@ static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip, ...@@ -890,7 +891,8 @@ static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
sunxi_pinctrl_gpio_set(chip, offset, value); sunxi_pinctrl_gpio_set(chip, offset, value);
return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, false); return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL,
chip->base + offset, false);
} }
static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc, static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册