mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
gpio: npcm-sgpio: 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/20250610-gpiochip-set-rv-gpio-v1-9-3a9a3c1472ff@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
aaec273c7b
commit
0e1a8930c9
1 changed files with 4 additions and 2 deletions
|
@ -226,7 +226,7 @@ static int npcm_sgpio_get_direction(struct gpio_chip *gc, unsigned int offset)
|
|||
return GPIO_LINE_DIRECTION_IN;
|
||||
}
|
||||
|
||||
static void npcm_sgpio_set(struct gpio_chip *gc, unsigned int offset, int val)
|
||||
static int npcm_sgpio_set(struct gpio_chip *gc, unsigned int offset, int val)
|
||||
{
|
||||
struct npcm_sgpio *gpio = gpiochip_get_data(gc);
|
||||
const struct npcm_sgpio_bank *bank = offset_to_bank(offset);
|
||||
|
@ -242,6 +242,8 @@ static void npcm_sgpio_set(struct gpio_chip *gc, unsigned int offset, int val)
|
|||
reg &= ~BIT(GPIO_BIT(offset));
|
||||
|
||||
iowrite8(reg, addr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int npcm_sgpio_get(struct gpio_chip *gc, unsigned int offset)
|
||||
|
@ -546,7 +548,7 @@ static int npcm_sgpio_probe(struct platform_device *pdev)
|
|||
gpio->chip.direction_output = npcm_sgpio_dir_out;
|
||||
gpio->chip.get_direction = npcm_sgpio_get_direction;
|
||||
gpio->chip.get = npcm_sgpio_get;
|
||||
gpio->chip.set = npcm_sgpio_set;
|
||||
gpio->chip.set_rv = npcm_sgpio_set;
|
||||
gpio->chip.label = dev_name(&pdev->dev);
|
||||
gpio->chip.base = -1;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue