aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2011-01-12 20:00:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:14 -0500
commit673860c107d3adc3fb0c85d7b4c86f551e75dc01 (patch)
treeb76637b526b9b3b8d1c842d38a10874fada05af5 /drivers
parent2a866f39146a5613d5c2db9031c13c218a4c7402 (diff)
gpio: sx150x: 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> Cc: Gregory Bean <gbean@codeaurora.org> Tested-by: Rohit Vaswani <rvaswani@codeaurora.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/sx150x.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/gpio/sx150x.c b/drivers/gpio/sx150x.c
index 823559ab0e24..e60be0015c9b 100644
--- a/drivers/gpio/sx150x.c
+++ b/drivers/gpio/sx150x.c
@@ -304,36 +304,36 @@ static int sx150x_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
304 return chip->irq_base + offset; 304 return chip->irq_base + offset;
305} 305}
306 306
307static void sx150x_irq_mask(unsigned int irq) 307static void sx150x_irq_mask(struct irq_data *d)
308{ 308{
309 struct irq_chip *ic = get_irq_chip(irq); 309 struct irq_chip *ic = irq_data_get_irq_chip(d);
310 struct sx150x_chip *chip; 310 struct sx150x_chip *chip;
311 unsigned n; 311 unsigned n;
312 312
313 chip = container_of(ic, struct sx150x_chip, irq_chip); 313 chip = container_of(ic, struct sx150x_chip, irq_chip);
314 n = irq - chip->irq_base; 314 n = d->irq - chip->irq_base;
315 315
316 sx150x_write_cfg(chip, n, 1, chip->dev_cfg->reg_irq_mask, 1); 316 sx150x_write_cfg(chip, n, 1, chip->dev_cfg->reg_irq_mask, 1);
317 sx150x_write_cfg(chip, n, 2, chip->dev_cfg->reg_sense, 0); 317 sx150x_write_cfg(chip, n, 2, chip->dev_cfg->reg_sense, 0);
318} 318}
319 319
320static void sx150x_irq_unmask(unsigned int irq) 320static void sx150x_irq_unmask(struct irq_data *d)
321{ 321{
322 struct irq_chip *ic = get_irq_chip(irq); 322 struct irq_chip *ic = irq_data_get_irq_chip(d);
323 struct sx150x_chip *chip; 323 struct sx150x_chip *chip;
324 unsigned n; 324 unsigned n;
325 325
326 chip = container_of(ic, struct sx150x_chip, irq_chip); 326 chip = container_of(ic, struct sx150x_chip, irq_chip);
327 n = irq - chip->irq_base; 327 n = d->irq - chip->irq_base;
328 328
329 sx150x_write_cfg(chip, n, 1, chip->dev_cfg->reg_irq_mask, 0); 329 sx150x_write_cfg(chip, n, 1, chip->dev_cfg->reg_irq_mask, 0);
330 sx150x_write_cfg(chip, n, 2, chip->dev_cfg->reg_sense, 330 sx150x_write_cfg(chip, n, 2, chip->dev_cfg->reg_sense,
331 chip->irq_sense >> (n * 2)); 331 chip->irq_sense >> (n * 2));
332} 332}
333 333
334static int sx150x_irq_set_type(unsigned int irq, unsigned int flow_type) 334static int sx150x_irq_set_type(struct irq_data *d, unsigned int flow_type)
335{ 335{
336 struct irq_chip *ic = get_irq_chip(irq); 336 struct irq_chip *ic = irq_data_get_irq_chip(d);
337 struct sx150x_chip *chip; 337 struct sx150x_chip *chip;
338 unsigned n, val = 0; 338 unsigned n, val = 0;
339 339
@@ -341,7 +341,7 @@ static int sx150x_irq_set_type(unsigned int irq, unsigned int flow_type)
341 return -EINVAL; 341 return -EINVAL;
342 342
343 chip = container_of(ic, struct sx150x_chip, irq_chip); 343 chip = container_of(ic, struct sx150x_chip, irq_chip);
344 n = irq - chip->irq_base; 344 n = d->irq - chip->irq_base;
345 345
346 if (flow_type & IRQ_TYPE_EDGE_RISING) 346 if (flow_type & IRQ_TYPE_EDGE_RISING)
347 val |= 0x1; 347 val |= 0x1;
@@ -386,9 +386,9 @@ static irqreturn_t sx150x_irq_thread_fn(int irq, void *dev_id)
386 return (nhandled > 0 ? IRQ_HANDLED : IRQ_NONE); 386 return (nhandled > 0 ? IRQ_HANDLED : IRQ_NONE);
387} 387}
388 388
389static void sx150x_irq_bus_lock(unsigned int irq) 389static void sx150x_irq_bus_lock(struct irq_data *d)
390{ 390{
391 struct irq_chip *ic = get_irq_chip(irq); 391 struct irq_chip *ic = irq_data_get_irq_chip(d);
392 struct sx150x_chip *chip; 392 struct sx150x_chip *chip;
393 393
394 chip = container_of(ic, struct sx150x_chip, irq_chip); 394 chip = container_of(ic, struct sx150x_chip, irq_chip);
@@ -396,9 +396,9 @@ static void sx150x_irq_bus_lock(unsigned int irq)
396 mutex_lock(&chip->lock); 396 mutex_lock(&chip->lock);
397} 397}
398 398
399static void sx150x_irq_bus_sync_unlock(unsigned int irq) 399static void sx150x_irq_bus_sync_unlock(struct irq_data *d)
400{ 400{
401 struct irq_chip *ic = get_irq_chip(irq); 401 struct irq_chip *ic = irq_data_get_irq_chip(d);
402 struct sx150x_chip *chip; 402 struct sx150x_chip *chip;
403 unsigned n; 403 unsigned n;
404 404
@@ -437,16 +437,16 @@ static void sx150x_init_chip(struct sx150x_chip *chip,
437 if (pdata->oscio_is_gpo) 437 if (pdata->oscio_is_gpo)
438 ++chip->gpio_chip.ngpio; 438 ++chip->gpio_chip.ngpio;
439 439
440 chip->irq_chip.name = client->name; 440 chip->irq_chip.name = client->name;
441 chip->irq_chip.mask = sx150x_irq_mask; 441 chip->irq_chip.irq_mask = sx150x_irq_mask;
442 chip->irq_chip.unmask = sx150x_irq_unmask; 442 chip->irq_chip.irq_unmask = sx150x_irq_unmask;
443 chip->irq_chip.set_type = sx150x_irq_set_type; 443 chip->irq_chip.irq_set_type = sx150x_irq_set_type;
444 chip->irq_chip.bus_lock = sx150x_irq_bus_lock; 444 chip->irq_chip.irq_bus_lock = sx150x_irq_bus_lock;
445 chip->irq_chip.bus_sync_unlock = sx150x_irq_bus_sync_unlock; 445 chip->irq_chip.irq_bus_sync_unlock = sx150x_irq_bus_sync_unlock;
446 chip->irq_summary = -1; 446 chip->irq_summary = -1;
447 chip->irq_base = -1; 447 chip->irq_base = -1;
448 chip->irq_sense = 0; 448 chip->irq_sense = 0;
449 chip->irq_set_type_pending = 0; 449 chip->irq_set_type_pending = 0;
450} 450}
451 451
452static int sx150x_init_io(struct sx150x_chip *chip, u8 base, u16 cfg) 452static int sx150x_init_io(struct sx150x_chip *chip, u8 base, u16 cfg)