Commit 2a866f39 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Linus Torvalds

gpio: stmpe-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 avatarRabin Vincent <rabin.vincent@stericsson.com>
Cc: Luotao Fu <l.fu@pengutronix.de>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b2221869
...@@ -122,10 +122,10 @@ static struct gpio_chip template_chip = { ...@@ -122,10 +122,10 @@ static struct gpio_chip template_chip = {
.can_sleep = 1, .can_sleep = 1,
}; };
static int stmpe_gpio_irq_set_type(unsigned int irq, unsigned int type) static int stmpe_gpio_irq_set_type(struct irq_data *d, unsigned int type)
{ {
struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
int offset = irq - stmpe_gpio->irq_base; int offset = d->irq - stmpe_gpio->irq_base;
int regoffset = offset / 8; int regoffset = offset / 8;
int mask = 1 << (offset % 8); int mask = 1 << (offset % 8);
...@@ -145,16 +145,16 @@ static int stmpe_gpio_irq_set_type(unsigned int irq, unsigned int type) ...@@ -145,16 +145,16 @@ static int stmpe_gpio_irq_set_type(unsigned int irq, unsigned int type)
return 0; return 0;
} }
static void stmpe_gpio_irq_lock(unsigned int irq) static void stmpe_gpio_irq_lock(struct irq_data *d)
{ {
struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
mutex_lock(&stmpe_gpio->irq_lock); mutex_lock(&stmpe_gpio->irq_lock);
} }
static void stmpe_gpio_irq_sync_unlock(unsigned int irq) static void stmpe_gpio_irq_sync_unlock(struct irq_data *d)
{ {
struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
struct stmpe *stmpe = stmpe_gpio->stmpe; struct stmpe *stmpe = stmpe_gpio->stmpe;
int num_banks = DIV_ROUND_UP(stmpe->num_gpios, 8); int num_banks = DIV_ROUND_UP(stmpe->num_gpios, 8);
static const u8 regmap[] = { static const u8 regmap[] = {
...@@ -180,20 +180,20 @@ static void stmpe_gpio_irq_sync_unlock(unsigned int irq) ...@@ -180,20 +180,20 @@ static void stmpe_gpio_irq_sync_unlock(unsigned int irq)
mutex_unlock(&stmpe_gpio->irq_lock); mutex_unlock(&stmpe_gpio->irq_lock);
} }
static void stmpe_gpio_irq_mask(unsigned int irq) static void stmpe_gpio_irq_mask(struct irq_data *d)
{ {
struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
int offset = irq - stmpe_gpio->irq_base; int offset = d->irq - stmpe_gpio->irq_base;
int regoffset = offset / 8; int regoffset = offset / 8;
int mask = 1 << (offset % 8); int mask = 1 << (offset % 8);
stmpe_gpio->regs[REG_IE][regoffset] &= ~mask; stmpe_gpio->regs[REG_IE][regoffset] &= ~mask;
} }
static void stmpe_gpio_irq_unmask(unsigned int irq) static void stmpe_gpio_irq_unmask(struct irq_data *d)
{ {
struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
int offset = irq - stmpe_gpio->irq_base; int offset = d->irq - stmpe_gpio->irq_base;
int regoffset = offset / 8; int regoffset = offset / 8;
int mask = 1 << (offset % 8); int mask = 1 << (offset % 8);
...@@ -202,11 +202,11 @@ static void stmpe_gpio_irq_unmask(unsigned int irq) ...@@ -202,11 +202,11 @@ static void stmpe_gpio_irq_unmask(unsigned int irq)
static struct irq_chip stmpe_gpio_irq_chip = { static struct irq_chip stmpe_gpio_irq_chip = {
.name = "stmpe-gpio", .name = "stmpe-gpio",
.bus_lock = stmpe_gpio_irq_lock, .irq_bus_lock = stmpe_gpio_irq_lock,
.bus_sync_unlock = stmpe_gpio_irq_sync_unlock, .irq_bus_sync_unlock = stmpe_gpio_irq_sync_unlock,
.mask = stmpe_gpio_irq_mask, .irq_mask = stmpe_gpio_irq_mask,
.unmask = stmpe_gpio_irq_unmask, .irq_unmask = stmpe_gpio_irq_unmask,
.set_type = stmpe_gpio_irq_set_type, .irq_set_type = stmpe_gpio_irq_set_type,
}; };
static irqreturn_t stmpe_gpio_irq(int irq, void *dev) static irqreturn_t stmpe_gpio_irq(int irq, void *dev)
......
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