Skip to content

Commit 5a7adc6

Browse files
jwrdegoedeBartosz Golaszewski
authored andcommitted
gpio: tps68470: Make tps68470_gpio_output() always set the initial value
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: 275b13a ("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>
1 parent 06c2afb commit 5a7adc6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpio/gpio-tps68470.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ static int tps68470_gpio_output(struct gpio_chip *gc, unsigned int offset,
9191
struct tps68470_gpio_data *tps68470_gpio = gpiochip_get_data(gc);
9292
struct regmap *regmap = tps68470_gpio->tps68470_regmap;
9393

94+
/* Set the initial value */
95+
tps68470_gpio_set(gc, offset, value);
96+
9497
/* rest are always outputs */
9598
if (offset >= TPS68470_N_REGULAR_GPIO)
9699
return 0;
97100

98-
/* Set the initial value */
99-
tps68470_gpio_set(gc, offset, value);
100-
101101
return regmap_update_bits(regmap, TPS68470_GPIO_CTL_REG_A(offset),
102102
TPS68470_GPIO_MODE_MASK,
103103
TPS68470_GPIO_MODE_OUT_CMOS);

0 commit comments

Comments
 (0)