aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/irq.c
diff options
context:
space:
mode:
authoreric miao <eric.miao@marvell.com>2008-03-03 22:18:48 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 06:29:03 -0400
commitdfa1067996390dfd4b1ce449676500fab4980ce2 (patch)
tree3f6ff13e8df17fbc3b970fb9e4cb86c5afafd3ba /arch/arm/mach-pxa/irq.c
parenta7bf4dbabac2a1ccd56527a56c82af720e7a00d1 (diff)
[ARM] pxa: cleanup the coding style of pxa_gpio_set_type()
by 1. wrapping long lines and making comments tidy 2. using IRQ_TYPE_* instead of migration macros __IRQT_* 3. introduce a pr_debug() for the commented printk(KERN_DEBUG ...) stuff Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
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