aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/irq.c')
-rw-r--r--arch/arm/mach-pxa/irq.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index ce150bf00bdd..4fd4560dd3ad 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -121,39 +121,37 @@ static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
121 gpio = IRQ_TO_GPIO(irq); 121 gpio = IRQ_TO_GPIO(irq);
122 idx = gpio >> 5; 122 idx = gpio >> 5;
123 123
124 if (type == IRQT_PROBE) { 124 if (type == IRQ_TYPE_PROBE) {
125 /* Don't mess with enabled GPIOs using preconfigured edges or 125 /* Don't mess with enabled GPIOs using preconfigured edges or
126 GPIOs set to alternate function or to output during probe */ 126 * GPIOs set to alternate function or to output during probe
127 if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx] | GPDR(gpio)) & 127 */
128 GPIO_bit(gpio)) 128 if ((GPIO_IRQ_rising_edge[idx] |
129 GPIO_IRQ_falling_edge[idx] |
130 GPDR(gpio)) & GPIO_bit(gpio))
129 return 0; 131 return 0;
130 if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2))) 132 if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2)))
131 return 0; 133 return 0;
132 type = __IRQT_RISEDGE | __IRQT_FALEDGE; 134 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
133 } 135 }
134 136
135 /* printk(KERN_DEBUG "IRQ%d (GPIO%d): ", irq, gpio); */
136
137 pxa_gpio_mode(gpio | GPIO_IN); 137 pxa_gpio_mode(gpio | GPIO_IN);
138 138
139 if (type & __IRQT_RISEDGE) { 139 if (type & IRQ_TYPE_EDGE_RISING)
140 /* printk("rising "); */ 140 __set_bit(gpio, GPIO_IRQ_rising_edge);
141 __set_bit (gpio, GPIO_IRQ_rising_edge); 141 else
142 } else { 142 __clear_bit(gpio, GPIO_IRQ_rising_edge);
143 __clear_bit (gpio, GPIO_IRQ_rising_edge);
144 }
145 143
146 if (type & __IRQT_FALEDGE) { 144 if (type & IRQ_TYPE_EDGE_FALLING)
147 /* printk("falling "); */ 145 __set_bit(gpio, GPIO_IRQ_falling_edge);
148 __set_bit (gpio, GPIO_IRQ_falling_edge); 146 else
149 } else { 147 __clear_bit(gpio, GPIO_IRQ_falling_edge);
150 __clear_bit (gpio, GPIO_IRQ_falling_edge);
151 }
152
153 /* printk("edges\n"); */
154 148
155 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx]; 149 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
156 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx]; 150 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
151
152 pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio,
153 ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""),
154 ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : ""));
157 return 0; 155 return 0;
158} 156}
159 157