mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
ARM: convert board-file GPIO chips to using new value setters
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. We're in the process of converting all GPIO drivers to using the new API. This series converts all ARM board-file level controllers. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmf2MAsACgkQEacuoBRx 13K64g//TaM6Kg78MV9vfhTmIMdqT6dp+/VxBd9xIWC+Ku88GnJx7FKga/jkZZGE iJM4UdCVqz74I377+DQpxsXoXnWqT5Hq5zPRC4Cvc2f2lVrBSJWHXfNhO5Ad0Kqc KVJEdrnjYvP0Wtfnc9ssnySQBrjF6JEWHahYf7UH20/SHBNUWvRH4Ti6+ODupw4H fhgsAgbLEARIgdEWUNa7vArtSQ8PK/1EDKigKIUPIg8vbEQWGW8NEKXBQidCNFWB LDYfmkjAWukQwPLqi/L6VkMnJ6sPCFlVLsXQ3mKtCGnnB224njGPNds3Ddm0REg1 MtvUFXOLgkYPatvZab9XrzCudmepQLrK7aH2UGHzs2KKLQHweTpsEVjz6RKa7JH5 blP/ebt5PUs5xDdyWB3X3DaBxSaezS7aeLxCX8lJ5CQxFwqlcxatpXHwTFpBkNwh HZ5Nt+PxnJBhRlkppt0UiPvLJD2B5YOn4FeWCbl4i9ZKj09VnMZQC2YTA9pw95Nh n/G72lpmC2ttuTZJT+p/bPdkWVW4s1hQ52gfxAWiAJKeRhfQ9AlcAADFhGvJWT8p jU40Fftx/btZoRDnwBPLZEWlUApIMjsjonQ93cwF91cVFgEnmEzjF5frCiMXbr9N DlLYLeWAts7vs23Z+PmbcPU6+45mjY8BqQNynVg7PIJP/J3m+9c= =lDGg -----END PGP SIGNATURE----- Merge tag 'arm-gpio-set-conversion-for-v6.16-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into soc/arm ARM: convert board-file GPIO chips to using new value setters struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. We're in the process of converting all GPIO drivers to using the new API. This series converts all ARM board-file level controllers. * tag 'arm-gpio-set-conversion-for-v6.16-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: ARM: s3c/gpio: use new line value setter callbacks ARM: scoop/gpio: use new line value setter callbacks ARM: sa1100/gpio: use new line value setter callbacks ARM: orion/gpio: use new line value setter callbacks
This commit is contained in:
commit
a6e160ead8
|
|
@ -563,7 +563,7 @@ static int sa1111_gpio_get(struct gpio_chip *gc, unsigned offset)
|
|||
return !!(readl_relaxed(reg + SA1111_GPIO_PXDRR) & mask);
|
||||
}
|
||||
|
||||
static void sa1111_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
||||
static int sa1111_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
|
||||
{
|
||||
struct sa1111 *sachip = gc_to_sa1111(gc);
|
||||
unsigned long flags;
|
||||
|
|
@ -574,6 +574,8 @@ static void sa1111_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
|||
sa1111_gpio_modify(reg + SA1111_GPIO_PXDWR, mask, value ? mask : 0);
|
||||
sa1111_gpio_modify(reg + SA1111_GPIO_PXSSR, mask, value ? mask : 0);
|
||||
spin_unlock_irqrestore(&sachip->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sa1111_gpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
|
||||
|
|
@ -613,7 +615,7 @@ static int sa1111_setup_gpios(struct sa1111 *sachip)
|
|||
sachip->gc.direction_input = sa1111_gpio_direction_input;
|
||||
sachip->gc.direction_output = sa1111_gpio_direction_output;
|
||||
sachip->gc.get = sa1111_gpio_get;
|
||||
sachip->gc.set = sa1111_gpio_set;
|
||||
sachip->gc.set_rv = sa1111_gpio_set;
|
||||
sachip->gc.set_multiple = sa1111_gpio_set_multiple;
|
||||
sachip->gc.to_irq = sa1111_gpio_to_irq;
|
||||
sachip->gc.base = -1;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ static void __scoop_gpio_set(struct scoop_dev *sdev,
|
|||
iowrite16(gpwr, sdev->base + SCOOP_GPWR);
|
||||
}
|
||||
|
||||
static void scoop_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
static int scoop_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct scoop_dev *sdev = gpiochip_get_data(chip);
|
||||
unsigned long flags;
|
||||
|
|
@ -73,6 +74,8 @@ static void scoop_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
|||
__scoop_gpio_set(sdev, offset, value);
|
||||
|
||||
spin_unlock_irqrestore(&sdev->scoop_lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int scoop_gpio_get(struct gpio_chip *chip, unsigned offset)
|
||||
|
|
@ -215,7 +218,7 @@ static int scoop_probe(struct platform_device *pdev)
|
|||
devptr->gpio.label = dev_name(&pdev->dev);
|
||||
devptr->gpio.base = inf->gpio_base;
|
||||
devptr->gpio.ngpio = 12; /* PA11 = 0, PA12 = 1, etc. up to PA22 = 11 */
|
||||
devptr->gpio.set = scoop_gpio_set;
|
||||
devptr->gpio.set_rv = scoop_gpio_set;
|
||||
devptr->gpio.get = scoop_gpio_get;
|
||||
devptr->gpio.direction_input = scoop_gpio_direction_input;
|
||||
devptr->gpio.direction_output = scoop_gpio_direction_output;
|
||||
|
|
|
|||
|
|
@ -430,8 +430,8 @@ static int samsung_gpiolib_4bit2_output(struct gpio_chip *chip,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void samsung_gpiolib_set(struct gpio_chip *chip,
|
||||
unsigned offset, int value)
|
||||
static int samsung_gpiolib_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct samsung_gpio_chip *ourchip = to_samsung_gpio(chip);
|
||||
void __iomem *base = ourchip->base;
|
||||
|
|
@ -447,6 +447,8 @@ static void samsung_gpiolib_set(struct gpio_chip *chip,
|
|||
__raw_writel(dat, base + 0x04);
|
||||
|
||||
samsung_gpio_unlock(ourchip, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int samsung_gpiolib_get(struct gpio_chip *chip, unsigned offset)
|
||||
|
|
@ -515,7 +517,7 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
|
|||
if (!gc->direction_output)
|
||||
gc->direction_output = samsung_gpiolib_2bit_output;
|
||||
if (!gc->set)
|
||||
gc->set = samsung_gpiolib_set;
|
||||
gc->set_rv = samsung_gpiolib_set;
|
||||
if (!gc->get)
|
||||
gc->get = samsung_gpiolib_get;
|
||||
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ orion_gpio_direction_output(struct gpio_chip *chip, unsigned pin, int value)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void orion_gpio_set(struct gpio_chip *chip, unsigned pin, int value)
|
||||
static int orion_gpio_set(struct gpio_chip *chip, unsigned int pin, int value)
|
||||
{
|
||||
struct orion_gpio_chip *ochip = gpiochip_get_data(chip);
|
||||
unsigned long flags;
|
||||
|
|
@ -219,6 +219,8 @@ static void orion_gpio_set(struct gpio_chip *chip, unsigned pin, int value)
|
|||
spin_lock_irqsave(&ochip->lock, flags);
|
||||
__set_level(ochip, pin, value);
|
||||
spin_unlock_irqrestore(&ochip->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int orion_gpio_to_irq(struct gpio_chip *chip, unsigned pin)
|
||||
|
|
@ -540,7 +542,7 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
|
|||
ochip->chip.direction_input = orion_gpio_direction_input;
|
||||
ochip->chip.get = orion_gpio_get;
|
||||
ochip->chip.direction_output = orion_gpio_direction_output;
|
||||
ochip->chip.set = orion_gpio_set;
|
||||
ochip->chip.set_rv = orion_gpio_set;
|
||||
ochip->chip.to_irq = orion_gpio_to_irq;
|
||||
ochip->chip.base = gpio_base;
|
||||
ochip->chip.ngpio = ngpio;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user