aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/atheros
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-09-12 06:53:53 +0000
committerJohn Crispin <blogic@openwrt.org>2014-09-12 06:53:53 +0000
commite24f0390670b0249b995ff315f6bdadca83ebe70 (patch)
tree0d4fe15e85a990cd14932e691497cac5f16c715c /target/linux/atheros
parent2dfb3a4f2a41a936f1f2b58e63388c48fc890355 (diff)
downloadupstream-e24f0390670b0249b995ff315f6bdadca83ebe70.tar.gz
upstream-e24f0390670b0249b995ff315f6bdadca83ebe70.tar.bz2
upstream-e24f0390670b0249b995ff315f6bdadca83ebe70.zip
atheros: convert gpio.h to stub
Implement to_irq() handler for AR2315 GPIO chip and convert custom gpio.h header to stub. Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42509 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/atheros')
-rw-r--r--target/linux/atheros/patches-3.14/100-board.patch36
-rw-r--r--target/linux/atheros/patches-3.14/105-ar2315_pci.patch2
2 files changed, 13 insertions, 25 deletions
diff --git a/target/linux/atheros/patches-3.14/100-board.patch b/target/linux/atheros/patches-3.14/100-board.patch
index 7097cfddd3..1467fb817a 100644
--- a/target/linux/atheros/patches-3.14/100-board.patch
+++ b/target/linux/atheros/patches-3.14/100-board.patch
@@ -603,36 +603,22 @@
+#endif /* __ASM_MACH_AR231X_DMA_COHERENCE_H */
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar231x/gpio.h
-@@ -0,0 +1,30 @@
+@@ -0,0 +1,16 @@
+#ifndef __ASM_MACH_AR231X_GPIO_H
+#define __ASM_MACH_AR231X_GPIO_H
+
-+#include <ar231x.h>
++#include <asm-generic/gpio.h>
+
+#define gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
+#define gpio_cansleep __gpio_cansleep
++#define gpio_to_irq __gpio_to_irq
+
-+/*
-+ * Wrappers for the generic GPIO layer
-+ */
-+
-+/* not sure if these are used? */
-+
-+/* Returns IRQ to attach for gpio. Unchecked function */
-+static inline int gpio_to_irq(unsigned gpio)
-+{
-+ return AR231X_GPIO_IRQ(gpio);
-+}
-+
-+/* Returns gpio for IRQ attached. Unchecked function */
+static inline int irq_to_gpio(unsigned irq)
+{
-+ return irq - AR231X_GPIO_IRQ(0);
++ return -EINVAL;
+}
+
-+#include <asm-generic/gpio.h> /* cansleep wrappers */
-+
+#endif /* __ASM_MACH_AR231X_GPIO_H */
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar231x/reset.h
@@ -2096,7 +2082,7 @@
+
--- /dev/null
+++ b/arch/mips/ar231x/ar2315.c
-@@ -0,0 +1,562 @@
+@@ -0,0 +1,568 @@
+/*
+ * 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
@@ -2349,12 +2335,18 @@
+ return 0;
+}
+
++static int ar2315_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
++{
++ return AR231X_GPIO_IRQ_BASE + gpio;
++}
++
+static struct gpio_chip ar2315_gpio_chip = {
+ .label = "ar2315-gpio",
+ .direction_input = ar2315_gpio_direction_input,
+ .direction_output = ar2315_gpio_direction_output,
+ .set = ar2315_gpio_set_value,
+ .get = ar2315_gpio_get_value,
++ .to_irq = ar2315_gpio_to_irq,
+ .base = 0,
+ .ngpio = AR2315_NUM_GPIO, /* 22 */
+};
@@ -2741,7 +2733,7 @@
+#endif
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar231x/ar231x.h
-@@ -0,0 +1,43 @@
+@@ -0,0 +1,39 @@
+#ifndef __ASM_MACH_AR231X_H
+#define __ASM_MACH_AR231X_H
+
@@ -2755,10 +2747,6 @@
+#define AR231X_IRQ_NONE (MIPS_CPU_IRQ_BASE+0)
+#define AR231X_IRQ_CPU_CLOCK (MIPS_CPU_IRQ_BASE+7) /* C0_CAUSE: 0x8000 */
+
-+/* GPIO Interrupts, share ARXXXX_MISC_IRQ_GPIO */
-+#define AR231X_GPIO_IRQ_NONE (AR231X_GPIO_IRQ_BASE+0)
-+#define AR231X_GPIO_IRQ(n) (AR231X_GPIO_IRQ_BASE+n)
-+
+static inline u32
+ar231x_read_reg(u32 reg)
+{
diff --git a/target/linux/atheros/patches-3.14/105-ar2315_pci.patch b/target/linux/atheros/patches-3.14/105-ar2315_pci.patch
index 7cbe629a08..5aeb9f42fd 100644
--- a/target/linux/atheros/patches-3.14/105-ar2315_pci.patch
+++ b/target/linux/atheros/patches-3.14/105-ar2315_pci.patch
@@ -382,7 +382,7 @@
else if (pending & CAUSEF_IP2)
do_IRQ(AR2315_IRQ_MISC_INTRS);
else if (pending & CAUSEF_IP7)
-@@ -560,3 +564,18 @@ ar2315_plat_setup(void)
+@@ -566,3 +570,18 @@ ar2315_plat_setup(void)
ar231x_serial_setup(AR2315_UART0, AR2315_MISC_IRQ_UART0,
ar2315_apb_frequency());
}