~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/arm/plat-mxc/gpio.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
176
176
{
177
177
        u32 irq_stat;
178
 
        struct mxc_gpio_port *port = get_irq_data(irq);
 
178
        struct mxc_gpio_port *port = irq_get_handler_data(irq);
179
179
 
180
180
        irq_stat = __raw_readl(port->base + GPIO_ISR) &
181
181
                        __raw_readl(port->base + GPIO_IMR);
188
188
{
189
189
        int i;
190
190
        u32 irq_msk, irq_stat;
191
 
        struct mxc_gpio_port *port = get_irq_data(irq);
 
191
        struct mxc_gpio_port *port = irq_get_handler_data(irq);
192
192
 
193
193
        /* walk through all interrupt status registers */
194
194
        for (i = 0; i < gpio_table_size; i++) {
295
295
        return 0;
296
296
}
297
297
 
 
298
/*
 
299
 * This lock class tells lockdep that GPIO irqs are in a different
 
300
 * category than their parents, so it won't report false recursion.
 
301
 */
 
302
static struct lock_class_key gpio_lock_class;
 
303
 
298
304
int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
299
305
{
300
306
        int i, j;
311
317
                __raw_writel(~0, port[i].base + GPIO_ISR);
312
318
                for (j = port[i].virtual_irq_start;
313
319
                        j < port[i].virtual_irq_start + 32; j++) {
314
 
                        set_irq_chip(j, &gpio_irq_chip);
315
 
                        set_irq_handler(j, handle_level_irq);
 
320
                        irq_set_lockdep_class(j, &gpio_lock_class);
 
321
                        irq_set_chip_and_handler(j, &gpio_irq_chip,
 
322
                                                 handle_level_irq);
316
323
                        set_irq_flags(j, IRQF_VALID);
317
324
                }
318
325
 
331
338
 
332
339
                if (cpu_is_mx1() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) {
333
340
                        /* setup one handler for each entry */
334
 
                        set_irq_chained_handler(port[i].irq, mx3_gpio_irq_handler);
335
 
                        set_irq_data(port[i].irq, &port[i]);
 
341
                        irq_set_chained_handler(port[i].irq,
 
342
                                                mx3_gpio_irq_handler);
 
343
                        irq_set_handler_data(port[i].irq, &port[i]);
336
344
                        if (port[i].irq_high) {
337
345
                                /* setup handler for GPIO 16 to 31 */
338
 
                                set_irq_chained_handler(port[i].irq_high,
339
 
                                                mx3_gpio_irq_handler);
340
 
                                set_irq_data(port[i].irq_high, &port[i]);
 
346
                                irq_set_chained_handler(port[i].irq_high,
 
347
                                                        mx3_gpio_irq_handler);
 
348
                                irq_set_handler_data(port[i].irq_high,
 
349
                                                     &port[i]);
341
350
                        }
342
351
                }
343
352
        }
344
353
 
345
354
        if (cpu_is_mx2()) {
346
355
                /* setup one handler for all GPIO interrupts */
347
 
                set_irq_chained_handler(port[0].irq, mx2_gpio_irq_handler);
348
 
                set_irq_data(port[0].irq, port);
 
356
                irq_set_chained_handler(port[0].irq, mx2_gpio_irq_handler);
 
357
                irq_set_handler_data(port[0].irq, port);
349
358
        }
350
359
 
351
360
        return 0;