Commit 12401eed authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Linus Torvalds

gpio: adp5588-gpio: irq_data conversion

Converts irq_chips and flow handlers over to the new struct irq_data based
irq_chip functions.
Signed-off-by: default avatarLennert Buytenhek <buytenh@secretlab.ca>
Acked-by: default avatar"Hennerich, Michael" <Michael.Hennerich@analog.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cf8e9086
...@@ -146,9 +146,10 @@ static int adp5588_gpio_to_irq(struct gpio_chip *chip, unsigned off) ...@@ -146,9 +146,10 @@ static int adp5588_gpio_to_irq(struct gpio_chip *chip, unsigned off)
return dev->irq_base + off; return dev->irq_base + off;
} }
static void adp5588_irq_bus_lock(unsigned int irq) static void adp5588_irq_bus_lock(struct irq_data *d)
{ {
struct adp5588_gpio *dev = get_irq_chip_data(irq); struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
mutex_lock(&dev->irq_lock); mutex_lock(&dev->irq_lock);
} }
...@@ -160,9 +161,9 @@ static void adp5588_irq_bus_lock(unsigned int irq) ...@@ -160,9 +161,9 @@ static void adp5588_irq_bus_lock(unsigned int irq)
* and unlocks the bus. * and unlocks the bus.
*/ */
static void adp5588_irq_bus_sync_unlock(unsigned int irq) static void adp5588_irq_bus_sync_unlock(struct irq_data *d)
{ {
struct adp5588_gpio *dev = get_irq_chip_data(irq); struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
int i; int i;
for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++) for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++)
...@@ -175,31 +176,31 @@ static void adp5588_irq_bus_sync_unlock(unsigned int irq) ...@@ -175,31 +176,31 @@ static void adp5588_irq_bus_sync_unlock(unsigned int irq)
mutex_unlock(&dev->irq_lock); mutex_unlock(&dev->irq_lock);
} }
static void adp5588_irq_mask(unsigned int irq) static void adp5588_irq_mask(struct irq_data *d)
{ {
struct adp5588_gpio *dev = get_irq_chip_data(irq); struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
unsigned gpio = irq - dev->irq_base; unsigned gpio = d->irq - dev->irq_base;
dev->irq_mask[ADP5588_BANK(gpio)] &= ~ADP5588_BIT(gpio); dev->irq_mask[ADP5588_BANK(gpio)] &= ~ADP5588_BIT(gpio);
} }
static void adp5588_irq_unmask(unsigned int irq) static void adp5588_irq_unmask(struct irq_data *d)
{ {
struct adp5588_gpio *dev = get_irq_chip_data(irq); struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
unsigned gpio = irq - dev->irq_base; unsigned gpio = d->irq - dev->irq_base;
dev->irq_mask[ADP5588_BANK(gpio)] |= ADP5588_BIT(gpio); dev->irq_mask[ADP5588_BANK(gpio)] |= ADP5588_BIT(gpio);
} }
static int adp5588_irq_set_type(unsigned int irq, unsigned int type) static int adp5588_irq_set_type(struct irq_data *d, unsigned int type)
{ {
struct adp5588_gpio *dev = get_irq_chip_data(irq); struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
uint16_t gpio = irq - dev->irq_base; uint16_t gpio = d->irq - dev->irq_base;
unsigned bank, bit; unsigned bank, bit;
if ((type & IRQ_TYPE_EDGE_BOTH)) { if ((type & IRQ_TYPE_EDGE_BOTH)) {
dev_err(&dev->client->dev, "irq %d: unsupported type %d\n", dev_err(&dev->client->dev, "irq %d: unsupported type %d\n",
irq, type); d->irq, type);
return -EINVAL; return -EINVAL;
} }
...@@ -222,11 +223,11 @@ static int adp5588_irq_set_type(unsigned int irq, unsigned int type) ...@@ -222,11 +223,11 @@ static int adp5588_irq_set_type(unsigned int irq, unsigned int type)
static struct irq_chip adp5588_irq_chip = { static struct irq_chip adp5588_irq_chip = {
.name = "adp5588", .name = "adp5588",
.mask = adp5588_irq_mask, .irq_mask = adp5588_irq_mask,
.unmask = adp5588_irq_unmask, .irq_unmask = adp5588_irq_unmask,
.bus_lock = adp5588_irq_bus_lock, .irq_bus_lock = adp5588_irq_bus_lock,
.bus_sync_unlock = adp5588_irq_bus_sync_unlock, .irq_bus_sync_unlock = adp5588_irq_bus_sync_unlock,
.set_type = adp5588_irq_set_type, .irq_set_type = adp5588_irq_set_type,
}; };
static int adp5588_gpio_read_intstat(struct i2c_client *client, u8 *buf) static int adp5588_gpio_read_intstat(struct i2c_client *client, u8 *buf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment