aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r--arch/arm/plat-omap/gpio.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 55059a24ad41..76f721d85137 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -140,7 +140,7 @@ static struct gpio_bank gpio_bank_1610[5] = {
140}; 140};
141#endif 141#endif
142 142
143#ifdef CONFIG_ARCH_OMAP1510 143#ifdef CONFIG_ARCH_OMAP15XX
144static struct gpio_bank gpio_bank_1510[2] = { 144static struct gpio_bank gpio_bank_1510[2] = {
145 { OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, 145 { OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
146 { OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 } 146 { OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 }
@@ -173,7 +173,7 @@ static int gpio_bank_count;
173 173
174static inline struct gpio_bank *get_gpio_bank(int gpio) 174static inline struct gpio_bank *get_gpio_bank(int gpio)
175{ 175{
176#ifdef CONFIG_ARCH_OMAP1510 176#ifdef CONFIG_ARCH_OMAP15XX
177 if (cpu_is_omap1510()) { 177 if (cpu_is_omap1510()) {
178 if (OMAP_GPIO_IS_MPUIO(gpio)) 178 if (OMAP_GPIO_IS_MPUIO(gpio))
179 return &gpio_bank[0]; 179 return &gpio_bank[0];
@@ -222,7 +222,7 @@ static inline int gpio_valid(int gpio)
222 return -1; 222 return -1;
223 return 0; 223 return 0;
224 } 224 }
225#ifdef CONFIG_ARCH_OMAP1510 225#ifdef CONFIG_ARCH_OMAP15XX
226 if (cpu_is_omap1510() && gpio < 16) 226 if (cpu_is_omap1510() && gpio < 16)
227 return 0; 227 return 0;
228#endif 228#endif
@@ -654,7 +654,7 @@ int omap_request_gpio(int gpio)
654 /* Set trigger to none. You need to enable the trigger after request_irq */ 654 /* Set trigger to none. You need to enable the trigger after request_irq */
655 _set_gpio_triggering(bank, get_gpio_index(gpio), IRQT_NOEDGE); 655 _set_gpio_triggering(bank, get_gpio_index(gpio), IRQT_NOEDGE);
656 656
657#ifdef CONFIG_ARCH_OMAP1510 657#ifdef CONFIG_ARCH_OMAP15XX
658 if (bank->method == METHOD_GPIO_1510) { 658 if (bank->method == METHOD_GPIO_1510) {
659 void __iomem *reg; 659 void __iomem *reg;
660 660
@@ -739,7 +739,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
739 bank = (struct gpio_bank *) desc->data; 739 bank = (struct gpio_bank *) desc->data;
740 if (bank->method == METHOD_MPUIO) 740 if (bank->method == METHOD_MPUIO)
741 isr_reg = bank->base + OMAP_MPUIO_GPIO_INT; 741 isr_reg = bank->base + OMAP_MPUIO_GPIO_INT;
742#ifdef CONFIG_ARCH_OMAP1510 742#ifdef CONFIG_ARCH_OMAP15XX
743 if (bank->method == METHOD_GPIO_1510) 743 if (bank->method == METHOD_GPIO_1510)
744 isr_reg = bank->base + OMAP1510_GPIO_INT_STATUS; 744 isr_reg = bank->base + OMAP1510_GPIO_INT_STATUS;
745#endif 745#endif
@@ -774,7 +774,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
774 d = irq_desc + gpio_irq; 774 d = irq_desc + gpio_irq;
775 desc_handle_irq(gpio_irq, d, regs); 775 desc_handle_irq(gpio_irq, d, regs);
776 } 776 }
777 } 777 }
778} 778}
779 779
780static void gpio_ack_irq(unsigned int irq) 780static void gpio_ack_irq(unsigned int irq)
@@ -837,8 +837,9 @@ static struct irqchip mpuio_irq_chip = {
837 .unmask = mpuio_unmask_irq 837 .unmask = mpuio_unmask_irq
838}; 838};
839 839
840static int initialized = 0; 840static int initialized;
841static struct clk * gpio_ck = NULL; 841static struct clk * gpio_ick;
842static struct clk * gpio_fck;
842 843
843static int __init _omap_gpio_init(void) 844static int __init _omap_gpio_init(void)
844{ 845{
@@ -848,14 +849,26 @@ static int __init _omap_gpio_init(void)
848 initialized = 1; 849 initialized = 1;
849 850
850 if (cpu_is_omap1510()) { 851 if (cpu_is_omap1510()) {
851 gpio_ck = clk_get(NULL, "arm_gpio_ck"); 852 gpio_ick = clk_get(NULL, "arm_gpio_ck");
852 if (IS_ERR(gpio_ck)) 853 if (IS_ERR(gpio_ick))
853 printk("Could not get arm_gpio_ck\n"); 854 printk("Could not get arm_gpio_ck\n");
854 else 855 else
855 clk_use(gpio_ck); 856 clk_use(gpio_ick);
857 }
858 if (cpu_is_omap24xx()) {
859 gpio_ick = clk_get(NULL, "gpios_ick");
860 if (IS_ERR(gpio_ick))
861 printk("Could not get gpios_ick\n");
862 else
863 clk_use(gpio_ick);
864 gpio_fck = clk_get(NULL, "gpios_fck");
865 if (IS_ERR(gpio_ick))
866 printk("Could not get gpios_fck\n");
867 else
868 clk_use(gpio_fck);
856 } 869 }
857 870
858#ifdef CONFIG_ARCH_OMAP1510 871#ifdef CONFIG_ARCH_OMAP15XX
859 if (cpu_is_omap1510()) { 872 if (cpu_is_omap1510()) {
860 printk(KERN_INFO "OMAP1510 GPIO hardware\n"); 873 printk(KERN_INFO "OMAP1510 GPIO hardware\n");
861 gpio_bank_count = 2; 874 gpio_bank_count = 2;
@@ -901,7 +914,7 @@ static int __init _omap_gpio_init(void)
901 if (bank->method == METHOD_MPUIO) { 914 if (bank->method == METHOD_MPUIO) {
902 omap_writew(0xFFFF, OMAP_MPUIO_BASE + OMAP_MPUIO_GPIO_MASKIT); 915 omap_writew(0xFFFF, OMAP_MPUIO_BASE + OMAP_MPUIO_GPIO_MASKIT);
903 } 916 }
904#ifdef CONFIG_ARCH_OMAP1510 917#ifdef CONFIG_ARCH_OMAP15XX
905 if (bank->method == METHOD_GPIO_1510) { 918 if (bank->method == METHOD_GPIO_1510) {
906 __raw_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK); 919 __raw_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
907 __raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS); 920 __raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
@@ -1038,6 +1051,7 @@ static struct sys_device omap_gpio_device = {
1038 1051
1039/* 1052/*
1040 * This may get called early from board specific init 1053 * This may get called early from board specific init
1054 * for boards that have interrupts routed via FPGA.
1041 */ 1055 */
1042int omap_gpio_init(void) 1056int omap_gpio_init(void)
1043{ 1057{