Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Hans de Goede and committed by
Bartosz Golaszewski
5a7adc6c 06c2afb8

+3 -3
+3 -3
drivers/gpio/gpio-tps68470.c
··· 91 91 struct tps68470_gpio_data *tps68470_gpio = gpiochip_get_data(gc); 92 92 struct regmap *regmap = tps68470_gpio->tps68470_regmap; 93 93 94 + /* Set the initial value */ 95 + tps68470_gpio_set(gc, offset, value); 96 + 94 97 /* rest are always outputs */ 95 98 if (offset >= TPS68470_N_REGULAR_GPIO) 96 99 return 0; 97 - 98 - /* Set the initial value */ 99 - tps68470_gpio_set(gc, offset, value); 100 100 101 101 return regmap_update_bits(regmap, TPS68470_GPIO_CTL_REG_A(offset), 102 102 TPS68470_GPIO_MODE_MASK,