Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa8cf57c authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Linus Walleij
Browse files

pinctrl: sunxi: Honor GPIO output initial vaules



Some GPIO users, such as fixed-regulator, request GPIO output with
initial value of 1. This was ignored by sunxi driver.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent fe0ec0ee
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -469,12 +469,6 @@ static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
	return val;
	return val;
}
}


static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
					unsigned offset, int value)
{
	return pinctrl_gpio_direction_output(chip->base + offset);
}

static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
				unsigned offset, int value)
				unsigned offset, int value)
{
{
@@ -498,6 +492,13 @@ static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
	spin_unlock_irqrestore(&pctl->lock, flags);
	spin_unlock_irqrestore(&pctl->lock, flags);
}
}


static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
					unsigned offset, int value)
{
	sunxi_pinctrl_gpio_set(chip, offset, value);
	return pinctrl_gpio_direction_output(chip->base + offset);
}

static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
				const struct of_phandle_args *gpiospec,
				const struct of_phandle_args *gpiospec,
				u32 *flags)
				u32 *flags)