diff options
author | eric miao <eric.miao@marvell.com> | 2008-03-04 11:18:48 +0800 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 11:29:03 +0100 |
commit | dfa1067996390dfd4b1ce449676500fab4980ce2 (patch) | |
tree | 3f6ff13e8df17fbc3b970fb9e4cb86c5afafd3ba /arch/arm/mach-pxa/irq.c | |
parent | a7bf4dbabac2a1ccd56527a56c82af720e7a00d1 (diff) | |
download | op-kernel-dev-dfa1067996390dfd4b1ce449676500fab4980ce2.zip op-kernel-dev-dfa1067996390dfd4b1ce449676500fab4980ce2.tar.gz |
[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.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index ce150bf..4fd4560 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) gpio = IRQ_TO_GPIO(irq); idx = gpio >> 5; - if (type == IRQT_PROBE) { - /* Don't mess with enabled GPIOs using preconfigured edges or - GPIOs set to alternate function or to output during probe */ - if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx] | GPDR(gpio)) & - GPIO_bit(gpio)) + if (type == IRQ_TYPE_PROBE) { + /* Don't mess with enabled GPIOs using preconfigured edges or + * GPIOs set to alternate function or to output during probe + */ + if ((GPIO_IRQ_rising_edge[idx] | + GPIO_IRQ_falling_edge[idx] | + GPDR(gpio)) & GPIO_bit(gpio)) return 0; if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2))) return 0; - type = __IRQT_RISEDGE | __IRQT_FALEDGE; + type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; } - /* printk(KERN_DEBUG "IRQ%d (GPIO%d): ", irq, gpio); */ - pxa_gpio_mode(gpio | GPIO_IN); - if (type & __IRQT_RISEDGE) { - /* printk("rising "); */ - __set_bit (gpio, GPIO_IRQ_rising_edge); - } else { - __clear_bit (gpio, GPIO_IRQ_rising_edge); - } + if (type & IRQ_TYPE_EDGE_RISING) + __set_bit(gpio, GPIO_IRQ_rising_edge); + else + __clear_bit(gpio, GPIO_IRQ_rising_edge); - if (type & __IRQT_FALEDGE) { - /* printk("falling "); */ - __set_bit (gpio, GPIO_IRQ_falling_edge); - } else { - __clear_bit (gpio, GPIO_IRQ_falling_edge); - } - - /* printk("edges\n"); */ + if (type & IRQ_TYPE_EDGE_FALLING) + __set_bit(gpio, GPIO_IRQ_falling_edge); + else + __clear_bit(gpio, GPIO_IRQ_falling_edge); GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx]; GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx]; + + pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio, + ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""), + ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : "")); return 0; } |