2 * linux/arch/arm/plat-omap/gpio.c
4 * Support functions for OMAP GPIO
6 * Copyright (C) 2003 Nokia Corporation
7 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/config.h>
15 #include <linux/init.h>
16 #include <linux/module.h>
17 #include <linux/sched.h>
18 #include <linux/interrupt.h>
19 #include <linux/ptrace.h>
21 #include <asm/hardware.h>
23 #include <asm/arch/irqs.h>
24 #include <asm/arch/gpio.h>
25 #include <asm/mach/irq.h>
30 * OMAP1510 GPIO registers
32 #define OMAP1510_GPIO_BASE 0xfffce000
33 #define OMAP1510_GPIO_DATA_INPUT 0x00
34 #define OMAP1510_GPIO_DATA_OUTPUT 0x04
35 #define OMAP1510_GPIO_DIR_CONTROL 0x08
36 #define OMAP1510_GPIO_INT_CONTROL 0x0c
37 #define OMAP1510_GPIO_INT_MASK 0x10
38 #define OMAP1510_GPIO_INT_STATUS 0x14
39 #define OMAP1510_GPIO_PIN_CONTROL 0x18
41 #define OMAP1510_IH_GPIO_BASE 64
44 * OMAP1610 specific GPIO registers
46 #define OMAP1610_GPIO1_BASE 0xfffbe400
47 #define OMAP1610_GPIO2_BASE 0xfffbec00
48 #define OMAP1610_GPIO3_BASE 0xfffbb400
49 #define OMAP1610_GPIO4_BASE 0xfffbbc00
50 #define OMAP1610_GPIO_REVISION 0x0000
51 #define OMAP1610_GPIO_SYSCONFIG 0x0010
52 #define OMAP1610_GPIO_SYSSTATUS 0x0014
53 #define OMAP1610_GPIO_IRQSTATUS1 0x0018
54 #define OMAP1610_GPIO_IRQENABLE1 0x001c
55 #define OMAP1610_GPIO_DATAIN 0x002c
56 #define OMAP1610_GPIO_DATAOUT 0x0030
57 #define OMAP1610_GPIO_DIRECTION 0x0034
58 #define OMAP1610_GPIO_EDGE_CTRL1 0x0038
59 #define OMAP1610_GPIO_EDGE_CTRL2 0x003c
60 #define OMAP1610_GPIO_CLEAR_IRQENABLE1 0x009c
61 #define OMAP1610_GPIO_CLEAR_DATAOUT 0x00b0
62 #define OMAP1610_GPIO_SET_IRQENABLE1 0x00dc
63 #define OMAP1610_GPIO_SET_DATAOUT 0x00f0
66 * OMAP730 specific GPIO registers
68 #define OMAP730_GPIO1_BASE 0xfffbc000
69 #define OMAP730_GPIO2_BASE 0xfffbc800
70 #define OMAP730_GPIO3_BASE 0xfffbd000
71 #define OMAP730_GPIO4_BASE 0xfffbd800
72 #define OMAP730_GPIO5_BASE 0xfffbe000
73 #define OMAP730_GPIO6_BASE 0xfffbe800
74 #define OMAP730_GPIO_DATA_INPUT 0x00
75 #define OMAP730_GPIO_DATA_OUTPUT 0x04
76 #define OMAP730_GPIO_DIR_CONTROL 0x08
77 #define OMAP730_GPIO_INT_CONTROL 0x0c
78 #define OMAP730_GPIO_INT_MASK 0x10
79 #define OMAP730_GPIO_INT_STATUS 0x14
81 #define OMAP_MPUIO_MASK (~OMAP_MAX_GPIO_LINES & 0xff)
86 u16 virtual_irq_start;
92 #define METHOD_MPUIO 0
93 #define METHOD_GPIO_1510 1
94 #define METHOD_GPIO_1610 2
95 #define METHOD_GPIO_730 3
97 #if defined(CONFIG_ARCH_OMAP16XX)
98 static struct gpio_bank gpio_bank_1610[5] = {
99 { OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO},
100 { OMAP1610_GPIO1_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1610 },
101 { OMAP1610_GPIO2_BASE, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16, METHOD_GPIO_1610 },
102 { OMAP1610_GPIO3_BASE, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32, METHOD_GPIO_1610 },
103 { OMAP1610_GPIO4_BASE, INT_1610_GPIO_BANK4, IH_GPIO_BASE + 48, METHOD_GPIO_1610 },
107 #ifdef CONFIG_ARCH_OMAP1510
108 static struct gpio_bank gpio_bank_1510[2] = {
109 { OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
110 { OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 }
114 #ifdef CONFIG_ARCH_OMAP730
115 static struct gpio_bank gpio_bank_730[7] = {
116 { OMAP_MPUIO_BASE, INT_730_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
117 { OMAP730_GPIO1_BASE, INT_730_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_730 },
118 { OMAP730_GPIO2_BASE, INT_730_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_730 },
119 { OMAP730_GPIO3_BASE, INT_730_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_730 },
120 { OMAP730_GPIO4_BASE, INT_730_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_730 },
121 { OMAP730_GPIO5_BASE, INT_730_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_730 },
122 { OMAP730_GPIO6_BASE, INT_730_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_730 },
126 static struct gpio_bank *gpio_bank;
127 static int gpio_bank_count;
129 static inline struct gpio_bank *get_gpio_bank(int gpio)
131 #ifdef CONFIG_ARCH_OMAP1510
132 if (cpu_is_omap1510()) {
133 if (OMAP_GPIO_IS_MPUIO(gpio))
134 return &gpio_bank[0];
135 return &gpio_bank[1];
138 #if defined(CONFIG_ARCH_OMAP16XX)
139 if (cpu_is_omap16xx()) {
140 if (OMAP_GPIO_IS_MPUIO(gpio))
141 return &gpio_bank[0];
142 return &gpio_bank[1 + (gpio >> 4)];
145 #ifdef CONFIG_ARCH_OMAP730
146 if (cpu_is_omap730()) {
147 if (OMAP_GPIO_IS_MPUIO(gpio))
148 return &gpio_bank[0];
149 return &gpio_bank[1 + (gpio >> 5)];
154 static inline int get_gpio_index(int gpio)
156 if (cpu_is_omap730())
162 static inline int gpio_valid(int gpio)
166 if (OMAP_GPIO_IS_MPUIO(gpio)) {
167 if ((gpio & OMAP_MPUIO_MASK) > 16)
171 #ifdef CONFIG_ARCH_OMAP1510
172 if (cpu_is_omap1510() && gpio < 16)
175 #if defined(CONFIG_ARCH_OMAP16XX)
176 if ((cpu_is_omap16xx()) && gpio < 64)
179 #ifdef CONFIG_ARCH_OMAP730
180 if (cpu_is_omap730() && gpio < 192)
186 static int check_gpio(int gpio)
188 if (unlikely(gpio_valid(gpio)) < 0) {
189 printk(KERN_ERR "omap-gpio: invalid GPIO %d\n", gpio);
196 static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
198 u32 reg = bank->base;
201 switch (bank->method) {
203 reg += OMAP_MPUIO_IO_CNTL;
205 case METHOD_GPIO_1510:
206 reg += OMAP1510_GPIO_DIR_CONTROL;
208 case METHOD_GPIO_1610:
209 reg += OMAP1610_GPIO_DIRECTION;
211 case METHOD_GPIO_730:
212 reg += OMAP730_GPIO_DIR_CONTROL;
215 l = __raw_readl(reg);
220 __raw_writel(l, reg);
223 void omap_set_gpio_direction(int gpio, int is_input)
225 struct gpio_bank *bank;
227 if (check_gpio(gpio) < 0)
229 bank = get_gpio_bank(gpio);
230 spin_lock(&bank->lock);
231 _set_gpio_direction(bank, get_gpio_index(gpio), is_input);
232 spin_unlock(&bank->lock);
235 static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
237 u32 reg = bank->base;
240 switch (bank->method) {
242 reg += OMAP_MPUIO_OUTPUT;
243 l = __raw_readl(reg);
249 case METHOD_GPIO_1510:
250 reg += OMAP1510_GPIO_DATA_OUTPUT;
251 l = __raw_readl(reg);
257 case METHOD_GPIO_1610:
259 reg += OMAP1610_GPIO_SET_DATAOUT;
261 reg += OMAP1610_GPIO_CLEAR_DATAOUT;
264 case METHOD_GPIO_730:
265 reg += OMAP730_GPIO_DATA_OUTPUT;
266 l = __raw_readl(reg);
276 __raw_writel(l, reg);
279 void omap_set_gpio_dataout(int gpio, int enable)
281 struct gpio_bank *bank;
283 if (check_gpio(gpio) < 0)
285 bank = get_gpio_bank(gpio);
286 spin_lock(&bank->lock);
287 _set_gpio_dataout(bank, get_gpio_index(gpio), enable);
288 spin_unlock(&bank->lock);
291 int omap_get_gpio_datain(int gpio)
293 struct gpio_bank *bank;
296 if (check_gpio(gpio) < 0)
298 bank = get_gpio_bank(gpio);
300 switch (bank->method) {
302 reg += OMAP_MPUIO_INPUT_LATCH;
304 case METHOD_GPIO_1510:
305 reg += OMAP1510_GPIO_DATA_INPUT;
307 case METHOD_GPIO_1610:
308 reg += OMAP1610_GPIO_DATAIN;
310 case METHOD_GPIO_730:
311 reg += OMAP730_GPIO_DATA_INPUT;
317 return (__raw_readl(reg) & (1 << get_gpio_index(gpio))) != 0;
320 static void _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
322 u32 reg = bank->base;
325 switch (bank->method) {
327 reg += OMAP_MPUIO_GPIO_INT_EDGE;
328 l = __raw_readl(reg);
329 if (edge == OMAP_GPIO_RISING_EDGE)
333 __raw_writel(l, reg);
335 case METHOD_GPIO_1510:
336 reg += OMAP1510_GPIO_INT_CONTROL;
337 l = __raw_readl(reg);
338 if (edge == OMAP_GPIO_RISING_EDGE)
342 __raw_writel(l, reg);
344 case METHOD_GPIO_1610:
347 reg += OMAP1610_GPIO_EDGE_CTRL2;
349 reg += OMAP1610_GPIO_EDGE_CTRL1;
351 l = __raw_readl(reg);
352 l &= ~(3 << (gpio << 1));
353 l |= edge << (gpio << 1);
354 __raw_writel(l, reg);
356 case METHOD_GPIO_730:
357 reg += OMAP730_GPIO_INT_CONTROL;
358 l = __raw_readl(reg);
359 if (edge == OMAP_GPIO_RISING_EDGE)
363 __raw_writel(l, reg);
371 void omap_set_gpio_edge_ctrl(int gpio, int edge)
373 struct gpio_bank *bank;
375 if (check_gpio(gpio) < 0)
377 bank = get_gpio_bank(gpio);
378 spin_lock(&bank->lock);
379 _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), edge);
380 spin_unlock(&bank->lock);
384 static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
386 u32 reg = bank->base, l;
388 switch (bank->method) {
390 l = __raw_readl(reg + OMAP_MPUIO_GPIO_INT_EDGE);
391 return (l & (1 << gpio)) ?
392 OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
393 case METHOD_GPIO_1510:
394 l = __raw_readl(reg + OMAP1510_GPIO_INT_CONTROL);
395 return (l & (1 << gpio)) ?
396 OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
397 case METHOD_GPIO_1610:
399 reg += OMAP1610_GPIO_EDGE_CTRL2;
401 reg += OMAP1610_GPIO_EDGE_CTRL1;
402 return (__raw_readl(reg) >> ((gpio & 0x07) << 1)) & 0x03;
403 case METHOD_GPIO_730:
404 l = __raw_readl(reg + OMAP730_GPIO_INT_CONTROL);
405 return (l & (1 << gpio)) ?
406 OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
413 static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
415 u32 reg = bank->base;
417 switch (bank->method) {
419 /* MPUIO irqstatus is reset by reading the status register,
420 * so do nothing here */
422 case METHOD_GPIO_1510:
423 reg += OMAP1510_GPIO_INT_STATUS;
425 case METHOD_GPIO_1610:
426 reg += OMAP1610_GPIO_IRQSTATUS1;
428 case METHOD_GPIO_730:
429 reg += OMAP730_GPIO_INT_STATUS;
435 __raw_writel(gpio_mask, reg);
438 static inline void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio)
440 _clear_gpio_irqbank(bank, 1 << get_gpio_index(gpio));
443 static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enable)
445 u32 reg = bank->base;
448 switch (bank->method) {
450 reg += OMAP_MPUIO_GPIO_MASKIT;
451 l = __raw_readl(reg);
457 case METHOD_GPIO_1510:
458 reg += OMAP1510_GPIO_INT_MASK;
459 l = __raw_readl(reg);
465 case METHOD_GPIO_1610:
467 reg += OMAP1610_GPIO_SET_IRQENABLE1;
469 reg += OMAP1610_GPIO_CLEAR_IRQENABLE1;
472 case METHOD_GPIO_730:
473 reg += OMAP730_GPIO_INT_MASK;
474 l = __raw_readl(reg);
484 __raw_writel(l, reg);
487 static inline void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
489 _enable_gpio_irqbank(bank, 1 << get_gpio_index(gpio), enable);
492 int omap_request_gpio(int gpio)
494 struct gpio_bank *bank;
496 if (check_gpio(gpio) < 0)
499 bank = get_gpio_bank(gpio);
500 spin_lock(&bank->lock);
501 if (unlikely(bank->reserved_map & (1 << get_gpio_index(gpio)))) {
502 printk(KERN_ERR "omap-gpio: GPIO %d is already reserved!\n", gpio);
504 spin_unlock(&bank->lock);
507 bank->reserved_map |= (1 << get_gpio_index(gpio));
508 #ifdef CONFIG_ARCH_OMAP1510
509 if (bank->method == METHOD_GPIO_1510) {
512 /* Claim the pin for the ARM */
513 reg = bank->base + OMAP1510_GPIO_PIN_CONTROL;
514 __raw_writel(__raw_readl(reg) | (1 << get_gpio_index(gpio)), reg);
517 spin_unlock(&bank->lock);
522 void omap_free_gpio(int gpio)
524 struct gpio_bank *bank;
526 if (check_gpio(gpio) < 0)
528 bank = get_gpio_bank(gpio);
529 spin_lock(&bank->lock);
530 if (unlikely(!(bank->reserved_map & (1 << get_gpio_index(gpio))))) {
531 printk(KERN_ERR "omap-gpio: GPIO %d wasn't reserved!\n", gpio);
533 spin_unlock(&bank->lock);
536 bank->reserved_map &= ~(1 << get_gpio_index(gpio));
537 _set_gpio_direction(bank, get_gpio_index(gpio), 1);
538 _set_gpio_irqenable(bank, gpio, 0);
539 _clear_gpio_irqstatus(bank, gpio);
540 spin_unlock(&bank->lock);
544 * We need to unmask the GPIO bank interrupt as soon as possible to
545 * avoid missing GPIO interrupts for other lines in the bank.
546 * Then we need to mask-read-clear-unmask the triggered GPIO lines
547 * in the bank to avoid missing nested interrupts for a GPIO line.
548 * If we wait to unmask individual GPIO lines in the bank after the
549 * line's interrupt handler has been run, we may miss some nested
552 static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
553 struct pt_regs *regs)
557 unsigned int gpio_irq;
558 struct gpio_bank *bank;
560 desc->chip->ack(irq);
562 bank = (struct gpio_bank *) desc->data;
563 if (bank->method == METHOD_MPUIO)
564 isr_reg = bank->base + OMAP_MPUIO_GPIO_INT;
565 #ifdef CONFIG_ARCH_OMAP1510
566 if (bank->method == METHOD_GPIO_1510)
567 isr_reg = bank->base + OMAP1510_GPIO_INT_STATUS;
569 #if defined(CONFIG_ARCH_OMAP16XX)
570 if (bank->method == METHOD_GPIO_1610)
571 isr_reg = bank->base + OMAP1610_GPIO_IRQSTATUS1;
573 #ifdef CONFIG_ARCH_OMAP730
574 if (bank->method == METHOD_GPIO_730)
575 isr_reg = bank->base + OMAP730_GPIO_INT_STATUS;
578 isr = __raw_readl(isr_reg);
579 _enable_gpio_irqbank(bank, isr, 0);
580 _clear_gpio_irqbank(bank, isr);
581 _enable_gpio_irqbank(bank, isr, 1);
582 desc->chip->unmask(irq);
587 gpio_irq = bank->virtual_irq_start;
588 for (; isr != 0; isr >>= 1, gpio_irq++) {
592 d = irq_desc + gpio_irq;
593 d->handle(gpio_irq, d, regs);
597 static void gpio_ack_irq(unsigned int irq)
599 unsigned int gpio = irq - IH_GPIO_BASE;
600 struct gpio_bank *bank = get_gpio_bank(gpio);
602 _clear_gpio_irqstatus(bank, gpio);
605 static void gpio_mask_irq(unsigned int irq)
607 unsigned int gpio = irq - IH_GPIO_BASE;
608 struct gpio_bank *bank = get_gpio_bank(gpio);
610 _set_gpio_irqenable(bank, gpio, 0);
613 static void gpio_unmask_irq(unsigned int irq)
615 unsigned int gpio = irq - IH_GPIO_BASE;
616 struct gpio_bank *bank = get_gpio_bank(gpio);
618 if (_get_gpio_edge_ctrl(bank, get_gpio_index(gpio)) == OMAP_GPIO_NO_EDGE) {
619 printk(KERN_ERR "OMAP GPIO %d: trying to enable GPIO IRQ while no edge is set\n",
621 _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), OMAP_GPIO_RISING_EDGE);
623 _set_gpio_irqenable(bank, gpio, 1);
626 static void mpuio_ack_irq(unsigned int irq)
628 /* The ISR is reset automatically, so do nothing here. */
631 static void mpuio_mask_irq(unsigned int irq)
633 unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE);
634 struct gpio_bank *bank = get_gpio_bank(gpio);
636 _set_gpio_irqenable(bank, gpio, 0);
639 static void mpuio_unmask_irq(unsigned int irq)
641 unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE);
642 struct gpio_bank *bank = get_gpio_bank(gpio);
644 _set_gpio_irqenable(bank, gpio, 1);
647 static struct irqchip gpio_irq_chip = {
649 .mask = gpio_mask_irq,
650 .unmask = gpio_unmask_irq,
653 static struct irqchip mpuio_irq_chip = {
654 .ack = mpuio_ack_irq,
655 .mask = mpuio_mask_irq,
656 .unmask = mpuio_unmask_irq
659 static int initialized = 0;
661 static int __init _omap_gpio_init(void)
664 struct gpio_bank *bank;
668 #ifdef CONFIG_ARCH_OMAP1510
669 if (cpu_is_omap1510()) {
670 printk(KERN_INFO "OMAP1510 GPIO hardware\n");
672 gpio_bank = gpio_bank_1510;
675 #if defined(CONFIG_ARCH_OMAP16XX)
676 if (cpu_is_omap16xx()) {
680 gpio_bank = gpio_bank_1610;
681 rev = omap_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION);
682 printk(KERN_INFO "OMAP GPIO hardware version %d.%d\n",
683 (rev >> 4) & 0x0f, rev & 0x0f);
686 #ifdef CONFIG_ARCH_OMAP730
687 if (cpu_is_omap730()) {
688 printk(KERN_INFO "OMAP730 GPIO hardware\n");
690 gpio_bank = gpio_bank_730;
693 for (i = 0; i < gpio_bank_count; i++) {
694 int j, gpio_count = 16;
696 bank = &gpio_bank[i];
697 bank->reserved_map = 0;
698 bank->base = IO_ADDRESS(bank->base);
699 spin_lock_init(&bank->lock);
700 if (bank->method == METHOD_MPUIO) {
701 omap_writew(0xFFFF, OMAP_MPUIO_BASE + OMAP_MPUIO_GPIO_MASKIT);
703 #ifdef CONFIG_ARCH_OMAP1510
704 if (bank->method == METHOD_GPIO_1510) {
705 __raw_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
706 __raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
709 #if defined(CONFIG_ARCH_OMAP16XX)
710 if (bank->method == METHOD_GPIO_1610) {
711 __raw_writew(0x0000, bank->base + OMAP1610_GPIO_IRQENABLE1);
712 __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
715 #ifdef CONFIG_ARCH_OMAP730
716 if (bank->method == METHOD_GPIO_730) {
717 __raw_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK);
718 __raw_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS);
720 gpio_count = 32; /* 730 has 32-bit GPIOs */
723 for (j = bank->virtual_irq_start;
724 j < bank->virtual_irq_start + gpio_count; j++) {
725 if (bank->method == METHOD_MPUIO)
726 set_irq_chip(j, &mpuio_irq_chip);
728 set_irq_chip(j, &gpio_irq_chip);
729 set_irq_handler(j, do_simple_IRQ);
730 set_irq_flags(j, IRQF_VALID);
732 set_irq_chained_handler(bank->irq, gpio_irq_handler);
733 set_irq_data(bank->irq, bank);
736 /* Enable system clock for GPIO module.
737 * The CAM_CLK_CTRL *is* really the right place. */
738 if (cpu_is_omap1610() || cpu_is_omap1710())
739 omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, ULPD_CAM_CLK_CTRL);
745 * This may get called early from board specific init
747 int omap_gpio_init(void)
750 return _omap_gpio_init();
755 EXPORT_SYMBOL(omap_request_gpio);
756 EXPORT_SYMBOL(omap_free_gpio);
757 EXPORT_SYMBOL(omap_set_gpio_direction);
758 EXPORT_SYMBOL(omap_set_gpio_dataout);
759 EXPORT_SYMBOL(omap_get_gpio_datain);
760 EXPORT_SYMBOL(omap_set_gpio_edge_ctrl);
762 arch_initcall(omap_gpio_init);