mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
gpio: twl6040: set line value in .direction_out()
It's ok for a GPIO controller to be output-only but the .direction_out() callback must also set the requested line value. Link: https://lore.kernel.org/r/20250707-gpiochip-set-rv-gpio-round4-v1-9-35668aaaf6d2@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
77ba4640cc
commit
79880eba2c
|
|
@ -37,13 +37,6 @@ static int twl6040gpo_get_direction(struct gpio_chip *chip, unsigned offset)
|
||||||
return GPIO_LINE_DIRECTION_OUT;
|
return GPIO_LINE_DIRECTION_OUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset,
|
|
||||||
int value)
|
|
||||||
{
|
|
||||||
/* This only drives GPOs, and can't change direction */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int twl6040gpo_set(struct gpio_chip *chip, unsigned int offset,
|
static int twl6040gpo_set(struct gpio_chip *chip, unsigned int offset,
|
||||||
int value)
|
int value)
|
||||||
{
|
{
|
||||||
|
|
@ -63,6 +56,13 @@ static int twl6040gpo_set(struct gpio_chip *chip, unsigned int offset,
|
||||||
return twl6040_reg_write(twl6040, TWL6040_REG_GPOCTL, gpoctl);
|
return twl6040_reg_write(twl6040, TWL6040_REG_GPOCTL, gpoctl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned int offset,
|
||||||
|
int value)
|
||||||
|
{
|
||||||
|
/* This only drives GPOs, and can't change direction */
|
||||||
|
return twl6040gpo_set(chip, offset, value);
|
||||||
|
}
|
||||||
|
|
||||||
static struct gpio_chip twl6040gpo_chip = {
|
static struct gpio_chip twl6040gpo_chip = {
|
||||||
.label = "twl6040",
|
.label = "twl6040",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user