mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
gpio: rtd: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-11-74abf689fbd8@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
6731ad96e8
commit
d68ddf651d
|
|
@ -275,7 +275,7 @@ static int rtd_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
|
|||
}
|
||||
}
|
||||
|
||||
static void rtd_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
static int rtd_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
{
|
||||
struct rtd_gpio *data = gpiochip_get_data(chip);
|
||||
u32 mask = BIT(offset % 32);
|
||||
|
|
@ -292,6 +292,8 @@ static void rtd_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
|||
else
|
||||
val &= ~mask;
|
||||
writel_relaxed(val, data->base + dato_reg_offset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtd_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
||||
|
|
@ -563,7 +565,7 @@ static int rtd_gpio_probe(struct platform_device *pdev)
|
|||
data->gpio_chip.get_direction = rtd_gpio_get_direction;
|
||||
data->gpio_chip.direction_input = rtd_gpio_direction_input;
|
||||
data->gpio_chip.direction_output = rtd_gpio_direction_output;
|
||||
data->gpio_chip.set = rtd_gpio_set;
|
||||
data->gpio_chip.set_rv = rtd_gpio_set;
|
||||
data->gpio_chip.get = rtd_gpio_get;
|
||||
data->gpio_chip.set_config = rtd_gpio_set_config;
|
||||
data->gpio_chip.parent = dev;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user