summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-2.6.18/pio-deglitch.patch
blob: 3fe9231861a8bc0d37291322a225a1203afee787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
 arch/avr32/mach-at32ap/pio.c         |   12 ++++++++++++
 include/asm-avr32/arch-at32ap/gpio.h |    1 +
 2 files changed, 13 insertions(+)

Index: linux-2.6.18-avr32/arch/avr32/mach-at32ap/pio.c
===================================================================
--- linux-2.6.18-avr32.orig/arch/avr32/mach-at32ap/pio.c	2006-11-30 11:55:02.000000000 +0100
+++ linux-2.6.18-avr32/arch/avr32/mach-at32ap/pio.c	2006-11-30 11:57:52.000000000 +0100
@@ -122,6 +122,18 @@ fail:
 	dump_stack();
 }
 
+void at32_set_deglitch(unsigned int pin, int enable)
+{
+	struct pio_device *pio;
+	u32 mask = 1 << (pin & 0x1f);
+
+	pio = gpio_to_pio(pin);
+	if (enable)
+		pio_writel(pio, IFER, mask);
+	else
+		pio_writel(pio, IFDR, mask);
+}
+
 static unsigned int pio_id(struct pio_device *pio)
 {
 	return pio - pio_dev;
Index: linux-2.6.18-avr32/include/asm-avr32/arch-at32ap/gpio.h
===================================================================
--- linux-2.6.18-avr32.orig/include/asm-avr32/arch-at32ap/gpio.h	2006-11-30 11:54:56.000000000 +0100
+++ linux-2.6.18-avr32/include/asm-avr32/arch-at32ap/gpio.h	2006-11-30 11:55:56.000000000 +0100
@@ -16,6 +16,7 @@
 void at32_select_periph(unsigned int pin, unsigned int periph,
 			unsigned long flags);
 void at32_select_gpio(unsigned int pin, unsigned long flags);
+void at32_set_deglitch(unsigned int pin, int enable);
 
 /* Arch-neutral GPIO API */
 int __must_check gpio_request(unsigned int gpio, const char *label);