aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/common.c
diff options
context:
space:
mode:
authorMårten Wikström <marten.wikstrom@passito.se>2006-02-22 17:27:23 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-02-22 17:27:23 -0500
commit06e4479bd092eca4125e5507e7c22619a491dab3 (patch)
treecc73ceba3232070ce353f297dfdb3535145f5822 /arch/arm/mach-ixp4xx/common.c
parentdf666b9c510fd27fd3b1afd9ddfa1eaa62ce12b3 (diff)
[ARM] 3347/1: Bugfix for ixp4xx_set_irq_type()
Patch from Mårten Wikström This patch fixes a bug in ixp4xx_set_irq_type() which leads to GPIO being incorrectly set to both edge triggered for raising as well as falling edge interrupt types. See the previous discussion on patch 3312/1. Signed-off-by: Mårten Wikström <marten.wikstrom@passito.se> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp4xx/common.c')
-rw-r--r--arch/arm/mach-ixp4xx/common.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 4bdc9d4526cd..fbadf3021b9e 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -111,24 +111,30 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
111 if (line < 0) 111 if (line < 0)
112 return -EINVAL; 112 return -EINVAL;
113 113
114 if (type & IRQT_BOTHEDGE) { 114 switch (type){
115 case IRQT_BOTHEDGE:
115 int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL; 116 int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL;
116 irq_type = IXP4XX_IRQ_EDGE; 117 irq_type = IXP4XX_IRQ_EDGE;
117 } else if (type & IRQT_RISING) { 118 break;
119 case IRQT_RISING:
118 int_style = IXP4XX_GPIO_STYLE_RISING_EDGE; 120 int_style = IXP4XX_GPIO_STYLE_RISING_EDGE;
119 irq_type = IXP4XX_IRQ_EDGE; 121 irq_type = IXP4XX_IRQ_EDGE;
120 } else if (type & IRQT_FALLING) { 122 break;
123 case IRQT_FALLING:
121 int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE; 124 int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE;
122 irq_type = IXP4XX_IRQ_EDGE; 125 irq_type = IXP4XX_IRQ_EDGE;
123 } else if (type & IRQT_HIGH) { 126 break;
127 case IRQT_HIGH:
124 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH; 128 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
125 irq_type = IXP4XX_IRQ_LEVEL; 129 irq_type = IXP4XX_IRQ_LEVEL;
126 } else if (type & IRQT_LOW) { 130 break;
131 case IRQT_LOW:
127 int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW; 132 int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW;
128 irq_type = IXP4XX_IRQ_LEVEL; 133 irq_type = IXP4XX_IRQ_LEVEL;
129 } else 134 break;
135 default:
130 return -EINVAL; 136 return -EINVAL;
131 137 }
132 ixp4xx_config_irq(irq, irq_type); 138 ixp4xx_config_irq(irq, irq_type);
133 139
134 if (line >= 8) { /* pins 8-15 */ 140 if (line >= 8) { /* pins 8-15 */