aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c64xx/irq-eint.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-s3c64xx/irq-eint.c')
-rw-r--r--arch/arm/plat-s3c64xx/irq-eint.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c
index f81b7b818ba0..ebdf183a0911 100644
--- a/arch/arm/plat-s3c64xx/irq-eint.c
+++ b/arch/arm/plat-s3c64xx/irq-eint.c
@@ -65,7 +65,7 @@ static void s3c_irq_eint_maskack(unsigned int irq)
65static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) 65static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
66{ 66{
67 int offs = eint_offset(irq); 67 int offs = eint_offset(irq);
68 int pin; 68 int pin, pin_val;
69 int shift; 69 int shift;
70 u32 ctrl, mask; 70 u32 ctrl, mask;
71 u32 newvalue = 0; 71 u32 newvalue = 0;
@@ -109,7 +109,10 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
109 return -1; 109 return -1;
110 } 110 }
111 111
112 shift = (offs / 2) * 4; 112 if (offs <= 15)
113 shift = (offs / 2) * 4;
114 else
115 shift = ((offs - 16) / 2) * 4;
113 mask = 0x7 << shift; 116 mask = 0x7 << shift;
114 117
115 ctrl = __raw_readl(reg); 118 ctrl = __raw_readl(reg);
@@ -119,12 +122,18 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
119 122
120 /* set the GPIO pin appropriately */ 123 /* set the GPIO pin appropriately */
121 124
122 if (offs < 23) 125 if (offs < 16) {
123 pin = S3C64XX_GPN(offs); 126 pin = S3C64XX_GPN(offs);
124 else 127 pin_val = S3C_GPIO_SFN(2);
128 } else if (offs < 23) {
129 pin = S3C64XX_GPL(offs + 8 - 16);
130 pin_val = S3C_GPIO_SFN(3);
131 } else {
125 pin = S3C64XX_GPM(offs - 23); 132 pin = S3C64XX_GPM(offs - 23);
133 pin_val = S3C_GPIO_SFN(3);
134 }
126 135
127 s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(2)); 136 s3c_gpio_cfgpin(pin, pin_val);
128 137
129 return 0; 138 return 0;
130} 139}