summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-tps68470.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-07-10 15:34:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-03 11:23:48 +0300
commitb2d8ac988f3cd1d363a758c7e934b601e31f576d (patch)
treeb735ea8a6a5524be58f3ebeb6a367f30d1eccdc8 /drivers/gpio/gpio-tps68470.c
parent04f7d4917471f77d87568145b646d12f51342e8d (diff)
downloadlinux-b2d8ac988f3cd1d363a758c7e934b601e31f576d.tar.xz
gpio: tps68470: Make tps68470_gpio_output() always set the initial value
[ Upstream commit 5a7adc6c1069ce31ef4f606ae9c05592c80a6ab5 ] Make tps68470_gpio_output() call tps68470_gpio_set() for output-only pins too, so that the initial value passed to gpiod_direction_output() is honored for these pins too. Fixes: 275b13a65547 ("gpio: Add support for TPS68470 GPIOs") Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Tested-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpio/gpio-tps68470.c')
-rw-r--r--drivers/gpio/gpio-tps68470.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-tps68470.c b/drivers/gpio/gpio-tps68470.c
index aaddcabe9b35..532deaddfd4e 100644
--- a/drivers/gpio/gpio-tps68470.c
+++ b/drivers/gpio/gpio-tps68470.c
@@ -91,13 +91,13 @@ static int tps68470_gpio_output(struct gpio_chip *gc, unsigned int offset,
struct tps68470_gpio_data *tps68470_gpio = gpiochip_get_data(gc);
struct regmap *regmap = tps68470_gpio->tps68470_regmap;
+ /* Set the initial value */
+ tps68470_gpio_set(gc, offset, value);
+
/* rest are always outputs */
if (offset >= TPS68470_N_REGULAR_GPIO)
return 0;
- /* Set the initial value */
- tps68470_gpio_set(gc, offset, value);
-
return regmap_update_bits(regmap, TPS68470_GPIO_CTL_REG_A(offset),
TPS68470_GPIO_MODE_MASK,
TPS68470_GPIO_MODE_OUT_CMOS);