aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2011-01-12 20:00:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:13 -0500
commit2a866f39146a5613d5c2db9031c13c218a4c7402 (patch)
treeb3c17e6a3b1f9a6d4945904ab883f6c1838ec962
parentb2221869dbd84994f07c91be73103d9f9cb7309f (diff)
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: Lennert Buytenhek <buytenh@secretlab.ca> Acked-by: Rabin Vincent <rabin.vincent@stericsson.com> Cc: Luotao Fu <l.fu@pengutronix.de> Cc: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/gpio/stmpe-gpio.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/gpio/stmpe-gpio.c b/drivers/gpio/stmpe-gpio.c
index 7c9e6a052c45..eb2901f8ab5e 100644
--- a/drivers/gpio/stmpe-gpio.c
+++ b/drivers/gpio/stmpe-gpio.c
@@ -122,10 +122,10 @@ static struct gpio_chip template_chip = {
122 .can_sleep = 1, 122 .can_sleep = 1,
123}; 123};
124 124
125static int stmpe_gpio_irq_set_type(unsigned int irq, unsigned int type) 125static int stmpe_gpio_irq_set_type(struct irq_data *d, unsigned int type)
126{ 126{
127 struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); 127 struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
128 int offset = irq - stmpe_gpio->irq_base; 128 int offset = d->irq - stmpe_gpio->irq_base;
129 int regoffset = offset / 8; 129 int regoffset = offset / 8;
130 int mask = 1 << (offset % 8); 130 int mask = 1 << (offset % 8);
131 131
@@ -145,16 +145,16 @@ static int stmpe_gpio_irq_set_type(unsigned int irq, unsigned int type)
145 return 0; 145 return 0;
146} 146}
147 147
148static void stmpe_gpio_irq_lock(unsigned int irq) 148static void stmpe_gpio_irq_lock(struct irq_data *d)
149{ 149{
150 struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); 150 struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
151 151
152 mutex_lock(&stmpe_gpio->irq_lock); 152 mutex_lock(&stmpe_gpio->irq_lock);
153} 153}
154 154
155static void stmpe_gpio_irq_sync_unlock(unsigned int irq) 155static void stmpe_gpio_irq_sync_unlock(struct irq_data *d)
156{ 156{
157 struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); 157 struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
158 struct stmpe *stmpe = stmpe_gpio->stmpe; 158 struct stmpe *stmpe = stmpe_gpio->stmpe;
159 int num_banks = DIV_ROUND_UP(stmpe->num_gpios, 8); 159 int num_banks = DIV_ROUND_UP(stmpe->num_gpios, 8);
160 static const u8 regmap[] = { 160 static const u8 regmap[] = {
@@ -180,20 +180,20 @@ static void stmpe_gpio_irq_sync_unlock(unsigned int irq)
180 mutex_unlock(&stmpe_gpio->irq_lock); 180 mutex_unlock(&stmpe_gpio->irq_lock);
181} 181}
182 182
183static void stmpe_gpio_irq_mask(unsigned int irq) 183static void stmpe_gpio_irq_mask(struct irq_data *d)
184{ 184{
185 struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); 185 struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
186 int offset = irq - stmpe_gpio->irq_base; 186 int offset = d->irq - stmpe_gpio->irq_base;
187 int regoffset = offset / 8; 187 int regoffset = offset / 8;
188 int mask = 1 << (offset % 8); 188 int mask = 1 << (offset % 8);
189 189
190 stmpe_gpio->regs[REG_IE][regoffset] &= ~mask; 190 stmpe_gpio->regs[REG_IE][regoffset] &= ~mask;
191} 191}
192 192
193static void stmpe_gpio_irq_unmask(unsigned int irq) 193static void stmpe_gpio_irq_unmask(struct irq_data *d)
194{ 194{
195 struct stmpe_gpio *stmpe_gpio = get_irq_chip_data(irq); 195 struct stmpe_gpio *stmpe_gpio = irq_data_get_irq_chip_data(d);
196 int offset = irq - stmpe_gpio->irq_base; 196 int offset = d->irq - stmpe_gpio->irq_base;
197 int regoffset = offset / 8; 197 int regoffset = offset / 8;
198 int mask = 1 << (offset % 8); 198 int mask = 1 << (offset % 8);
199 199
@@ -202,11 +202,11 @@ static void stmpe_gpio_irq_unmask(unsigned int irq)
202 202
203static struct irq_chip stmpe_gpio_irq_chip = { 203static struct irq_chip stmpe_gpio_irq_chip = {
204 .name = "stmpe-gpio", 204 .name = "stmpe-gpio",
205 .bus_lock = stmpe_gpio_irq_lock, 205 .irq_bus_lock = stmpe_gpio_irq_lock,
206 .bus_sync_unlock = stmpe_gpio_irq_sync_unlock, 206 .irq_bus_sync_unlock = stmpe_gpio_irq_sync_unlock,
207 .mask = stmpe_gpio_irq_mask, 207 .irq_mask = stmpe_gpio_irq_mask,
208 .unmask = stmpe_gpio_irq_unmask, 208 .irq_unmask = stmpe_gpio_irq_unmask,
209 .set_type = stmpe_gpio_irq_set_type, 209 .irq_set_type = stmpe_gpio_irq_set_type,
210}; 210};
211 211
212static irqreturn_t stmpe_gpio_irq(int irq, void *dev) 212static irqreturn_t stmpe_gpio_irq(int irq, void *dev)