aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx/gpio.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-03-24 07:45:56 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-03-29 08:47:56 -0400
commitd1735a2ebd8868ee9b5bb419860e633f0f839042 (patch)
tree01cae0310f2ca2434cbd4e811379fd7a6ab3f9f5 /arch/arm/mach-ep93xx/gpio.c
parenta0b0f5ac7816672534f3839672c38f027158b81f (diff)
arm: ep93xx: Use proper irq accessor functions
No need to write the flow type. Core code does already. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/arm/mach-ep93xx/gpio.c')
-rw-r--r--arch/arm/mach-ep93xx/gpio.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c
index 34e071d7976..6e7bbf72b36 100644
--- a/arch/arm/mach-ep93xx/gpio.c
+++ b/arch/arm/mach-ep93xx/gpio.c
@@ -117,7 +117,7 @@ static void ep93xx_gpio_irq_ack(struct irq_data *d)
117 int port = line >> 3; 117 int port = line >> 3;
118 int port_mask = 1 << (line & 7); 118 int port_mask = 1 << (line & 7);
119 119
120 if ((irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { 120 if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) {
121 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 121 gpio_int_type2[port] ^= port_mask; /* switch edge direction */
122 ep93xx_gpio_update_int_params(port); 122 ep93xx_gpio_update_int_params(port);
123 } 123 }
@@ -131,7 +131,7 @@ static void ep93xx_gpio_irq_mask_ack(struct irq_data *d)
131 int port = line >> 3; 131 int port = line >> 3;
132 int port_mask = 1 << (line & 7); 132 int port_mask = 1 << (line & 7);
133 133
134 if ((irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) 134 if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH)
135 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 135 gpio_int_type2[port] ^= port_mask; /* switch edge direction */
136 136
137 gpio_int_unmasked[port] &= ~port_mask; 137 gpio_int_unmasked[port] &= ~port_mask;
@@ -165,10 +165,10 @@ static void ep93xx_gpio_irq_unmask(struct irq_data *d)
165 */ 165 */
166static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type) 166static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type)
167{ 167{
168 struct irq_desc *desc = irq_desc + d->irq;
169 const int gpio = irq_to_gpio(d->irq); 168 const int gpio = irq_to_gpio(d->irq);
170 const int port = gpio >> 3; 169 const int port = gpio >> 3;
171 const int port_mask = 1 << (gpio & 7); 170 const int port_mask = 1 << (gpio & 7);
171 irq_flow_handler_t handler;
172 172
173 gpio_direction_input(gpio); 173 gpio_direction_input(gpio);
174 174
@@ -176,22 +176,22 @@ static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type)
176 case IRQ_TYPE_EDGE_RISING: 176 case IRQ_TYPE_EDGE_RISING:
177 gpio_int_type1[port] |= port_mask; 177 gpio_int_type1[port] |= port_mask;
178 gpio_int_type2[port] |= port_mask; 178 gpio_int_type2[port] |= port_mask;
179 desc->handle_irq = handle_edge_irq; 179 handler = handle_edge_irq;
180 break; 180 break;
181 case IRQ_TYPE_EDGE_FALLING: 181 case IRQ_TYPE_EDGE_FALLING:
182 gpio_int_type1[port] |= port_mask; 182 gpio_int_type1[port] |= port_mask;
183 gpio_int_type2[port] &= ~port_mask; 183 gpio_int_type2[port] &= ~port_mask;
184 desc->handle_irq = handle_edge_irq; 184 handler = handle_edge_irq;
185 break; 185 break;
186 case IRQ_TYPE_LEVEL_HIGH: 186 case IRQ_TYPE_LEVEL_HIGH:
187 gpio_int_type1[port] &= ~port_mask; 187 gpio_int_type1[port] &= ~port_mask;
188 gpio_int_type2[port] |= port_mask; 188 gpio_int_type2[port] |= port_mask;
189 desc->handle_irq = handle_level_irq; 189 handler = handle_level_irq;
190 break; 190 break;
191 case IRQ_TYPE_LEVEL_LOW: 191 case IRQ_TYPE_LEVEL_LOW:
192 gpio_int_type1[port] &= ~port_mask; 192 gpio_int_type1[port] &= ~port_mask;
193 gpio_int_type2[port] &= ~port_mask; 193 gpio_int_type2[port] &= ~port_mask;
194 desc->handle_irq = handle_level_irq; 194 handler = handle_level_irq;
195 break; 195 break;
196 case IRQ_TYPE_EDGE_BOTH: 196 case IRQ_TYPE_EDGE_BOTH:
197 gpio_int_type1[port] |= port_mask; 197 gpio_int_type1[port] |= port_mask;
@@ -200,17 +200,16 @@ static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type)
200 gpio_int_type2[port] &= ~port_mask; /* falling */ 200 gpio_int_type2[port] &= ~port_mask; /* falling */
201 else 201 else
202 gpio_int_type2[port] |= port_mask; /* rising */ 202 gpio_int_type2[port] |= port_mask; /* rising */
203 desc->handle_irq = handle_edge_irq; 203 handler = handle_edge_irq;
204 break; 204 break;
205 default: 205 default:
206 pr_err("failed to set irq type %d for gpio %d\n", type, gpio); 206 pr_err("failed to set irq type %d for gpio %d\n", type, gpio);
207 return -EINVAL; 207 return -EINVAL;
208 } 208 }
209 209
210 gpio_int_enabled[port] |= port_mask; 210 __irq_set_handler_locked(d->irq, handler);
211 211
212 desc->status &= ~IRQ_TYPE_SENSE_MASK; 212 gpio_int_enabled[port] |= port_mask;
213 desc->status |= type & IRQ_TYPE_SENSE_MASK;
214 213
215 ep93xx_gpio_update_int_params(port); 214 ep93xx_gpio_update_int_params(port);
216 215