aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ep93xx/core.c')
-rw-r--r--arch/arm/mach-ep93xx/core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 61da67f31ce..4781f323703 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -155,12 +155,14 @@ static unsigned char gpio_int_unmasked[3];
155static unsigned char gpio_int_enabled[3]; 155static unsigned char gpio_int_enabled[3];
156static unsigned char gpio_int_type1[3]; 156static unsigned char gpio_int_type1[3];
157static unsigned char gpio_int_type2[3]; 157static unsigned char gpio_int_type2[3];
158static unsigned char gpio_int_debouce[3];
158 159
159/* Port ordering is: A B F */ 160/* Port ordering is: A B F */
160static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; 161static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
161static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 }; 162static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
162static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; 163static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 };
163static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 }; 164static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 };
165static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 };
164 166
165void ep93xx_gpio_update_int_params(unsigned port) 167void ep93xx_gpio_update_int_params(unsigned port)
166{ 168{
@@ -183,6 +185,22 @@ void ep93xx_gpio_int_mask(unsigned line)
183 gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7)); 185 gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
184} 186}
185 187
188void ep93xx_gpio_int_debounce(unsigned int irq, int enable)
189{
190 int line = irq_to_gpio(irq);
191 int port = line >> 3;
192 int port_mask = 1 << (line & 7);
193
194 if (enable)
195 gpio_int_debouce[port] |= port_mask;
196 else
197 gpio_int_debouce[port] &= ~port_mask;
198
199 __raw_writeb(gpio_int_debouce[port],
200 EP93XX_GPIO_REG(int_debounce_register_offset[port]));
201}
202EXPORT_SYMBOL(ep93xx_gpio_int_debounce);
203
186/************************************************************************* 204/*************************************************************************
187 * EP93xx IRQ handling 205 * EP93xx IRQ handling
188 *************************************************************************/ 206 *************************************************************************/