mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
gpio: xtensa: 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/20250709-gpiochip-set-rv-gpio-remaining-v1-15-b8950f69618d@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
735ddc67ab
commit
383a02f6d4
1 changed files with 4 additions and 2 deletions
|
@ -103,7 +103,7 @@ static int xtensa_expstate_get_value(struct gpio_chip *gc, unsigned offset)
|
|||
return !!(expstate & BIT(offset));
|
||||
}
|
||||
|
||||
static void xtensa_expstate_set_value(struct gpio_chip *gc, unsigned offset,
|
||||
static int xtensa_expstate_set_value(struct gpio_chip *gc, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
unsigned long flags, saved_cpenable;
|
||||
|
@ -114,6 +114,8 @@ static void xtensa_expstate_set_value(struct gpio_chip *gc, unsigned offset,
|
|||
__asm__ __volatile__("wrmsk_expstate %0, %1"
|
||||
:: "a" (val), "a" (mask));
|
||||
disable_cp(flags, saved_cpenable);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct gpio_chip impwire_chip = {
|
||||
|
@ -130,7 +132,7 @@ static struct gpio_chip expstate_chip = {
|
|||
.ngpio = 32,
|
||||
.get_direction = xtensa_expstate_get_direction,
|
||||
.get = xtensa_expstate_get_value,
|
||||
.set = xtensa_expstate_set_value,
|
||||
.set_rv = xtensa_expstate_set_value,
|
||||
};
|
||||
|
||||
static int xtensa_gpio_probe(struct platform_device *pdev)
|
||||
|
|
Loading…
Add table
Reference in a new issue