summaryrefslogtreecommitdiff
path: root/target/linux/atheros/patches-2.6.30/100-board.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-10-11 19:50:16 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-10-11 19:50:16 +0000
commit9ae6129829a683f36dee5e7651714700e47f26bc (patch)
tree6557619d3df61be7902c59904fbc3bdf1c997e0a /target/linux/atheros/patches-2.6.30/100-board.patch
parentd06c15c265e9d3b91763005a827c9bb722f9b425 (diff)
downloadmtk-20170518-9ae6129829a683f36dee5e7651714700e47f26bc.zip
mtk-20170518-9ae6129829a683f36dee5e7651714700e47f26bc.tar.gz
mtk-20170518-9ae6129829a683f36dee5e7651714700e47f26bc.tar.bz2
atheros: leave the gpio interrupts alone when user space changes the gpio input settings, fixes #4493
SVN-Revision: 18036
Diffstat (limited to 'target/linux/atheros/patches-2.6.30/100-board.patch')
-rw-r--r--target/linux/atheros/patches-2.6.30/100-board.patch23
1 files changed, 19 insertions, 4 deletions
diff --git a/target/linux/atheros/patches-2.6.30/100-board.patch b/target/linux/atheros/patches-2.6.30/100-board.patch
index 4367ce4..5f51293 100644
--- a/target/linux/atheros/patches-2.6.30/100-board.patch
+++ b/target/linux/atheros/patches-2.6.30/100-board.patch
@@ -2105,7 +2105,7 @@
+
--- /dev/null
+++ b/arch/mips/ar231x/ar2315.c
-@@ -0,0 +1,643 @@
+@@ -0,0 +1,658 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
@@ -2163,6 +2163,10 @@
+ if (!pend)
+ ar231x_write_reg(AR2315_ISR, AR2315_ISR_GPIO);
+
++ /* Enable interrupt with edge detection */
++ if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(bit)) != AR2315_GPIO_CR_I(bit))
++ return;
++
+ if (bit >= 0)
+ do_IRQ(AR531X_GPIO_IRQ_BASE + bit);
+}
@@ -2220,14 +2224,24 @@
+{
+ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE;
+
-+ /* reconfigure GPIO line as input */
-+ ar231x_mask_reg(AR2315_GPIO_CR, AR2315_GPIO_CR_M(gpio), AR2315_GPIO_CR_I(gpio));
-+
+ /* Enable interrupt with edge detection */
++ if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(gpio)) != AR2315_GPIO_CR_I(gpio))
++ return;
++
+ gpiointmask |= (1 << gpio);
+ ar2315_set_gpiointmask(gpio, 3);
+}
+
++static unsigned int ar2315_gpio_intr_startup(unsigned int irq)
++{
++ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE;
++
++ /* reconfigure GPIO line as input */
++ ar231x_mask_reg(AR2315_GPIO_CR, AR2315_GPIO_CR_M(gpio), AR2315_GPIO_CR_I(gpio));
++ ar2315_gpio_intr_enable(irq);
++ return 0;
++}
++
+static void ar2315_gpio_intr_disable(unsigned int irq)
+{
+ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE;
@@ -2246,6 +2260,7 @@
+
+static struct irq_chip ar2315_gpio_intr_controller = {
+ .typename = "AR2315-GPIO",
++ .startup = ar2315_gpio_intr_startup,
+ .ack = ar2315_gpio_intr_disable,
+ .mask_ack = ar2315_gpio_intr_disable,
+ .mask = ar2315_gpio_intr_disable,