* [PATCH resend v2] gpio: tps68470: Make tps68470_gpio_output() always set the initial value
@ 2023-07-10 12:34 Hans de Goede
2023-07-19 11:22 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2023-07-10 12:34 UTC (permalink / raw)
To: Andy Shevchenko, Bartosz Golaszewski, Linus Walleij
Cc: Hans de Goede, linux-gpio, Andy Shevchenko, Daniel Scally,
Sakari Ailus
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>
---
Changes in v2:
- Add Fixes tag
- Add Andy's Reviewed-by
---
drivers/gpio/gpio-tps68470.c | 6 +++---
1 file 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);
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH resend v2] gpio: tps68470: Make tps68470_gpio_output() always set the initial value
2023-07-10 12:34 [PATCH resend v2] gpio: tps68470: Make tps68470_gpio_output() always set the initial value Hans de Goede
@ 2023-07-19 11:22 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2023-07-19 11:22 UTC (permalink / raw)
To: Hans de Goede
Cc: Andy Shevchenko, Linus Walleij, linux-gpio, Andy Shevchenko,
Daniel Scally, Sakari Ailus
On Mon, Jul 10, 2023 at 2:34 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> 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>
> ---
> Changes in v2:
> - Add Fixes tag
> - Add Andy's Reviewed-by
> ---
> drivers/gpio/gpio-tps68470.c | 6 +++---
> 1 file 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);
> --
> 2.41.0
>
Applied, thanks!
Bart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-19 11:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-10 12:34 [PATCH resend v2] gpio: tps68470: Make tps68470_gpio_output() always set the initial value Hans de Goede
2023-07-19 11:22 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).