summaryrefslogtreecommitdiff
path: root/target/linux/ixp4xx/patches-3.18/030-gpio_line_config.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-02-09 14:24:00 +0000
committerJohn Crispin <john@openwrt.org>2015-02-09 14:24:00 +0000
commited84ceaa02386efa5eb46ac24abb644a1d176cfd (patch)
tree526114e349e1ac1ec87992db6e4b12d770b547cf /target/linux/ixp4xx/patches-3.18/030-gpio_line_config.patch
parentba2d7b9c2b08e8eb65b36e98f1a173548886be06 (diff)
downloadmtk-20170518-ed84ceaa02386efa5eb46ac24abb644a1d176cfd.zip
mtk-20170518-ed84ceaa02386efa5eb46ac24abb644a1d176cfd.tar.gz
mtk-20170518-ed84ceaa02386efa5eb46ac24abb644a1d176cfd.tar.bz2
ixp4xx: add v3.18 support
Signed-off-by: Your Name <blogic@openwrt.org> SVN-Revision: 44363
Diffstat (limited to 'target/linux/ixp4xx/patches-3.18/030-gpio_line_config.patch')
-rw-r--r--target/linux/ixp4xx/patches-3.18/030-gpio_line_config.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/target/linux/ixp4xx/patches-3.18/030-gpio_line_config.patch b/target/linux/ixp4xx/patches-3.18/030-gpio_line_config.patch
new file mode 100644
index 0000000..0477b38
--- /dev/null
+++ b/target/linux/ixp4xx/patches-3.18/030-gpio_line_config.patch
@@ -0,0 +1,65 @@
+--- a/arch/arm/mach-ixp4xx/common.c
++++ b/arch/arm/mach-ixp4xx/common.c
+@@ -84,22 +84,7 @@ void __init ixp4xx_map_io(void)
+ /*
+ * GPIO-functions
+ */
+-/*
+- * The following converted to the real HW bits the gpio_line_config
+- */
+-/* GPIO pin types */
+-#define IXP4XX_GPIO_OUT 0x1
+-#define IXP4XX_GPIO_IN 0x2
+-
+-/* GPIO signal types */
+-#define IXP4XX_GPIO_LOW 0
+-#define IXP4XX_GPIO_HIGH 1
+-
+-/* GPIO Clocks */
+-#define IXP4XX_GPIO_CLK_0 14
+-#define IXP4XX_GPIO_CLK_1 15
+-
+-static void gpio_line_config(u8 line, u32 direction)
++void gpio_line_config(u8 line, u32 direction)
+ {
+ if (direction == IXP4XX_GPIO_IN)
+ *IXP4XX_GPIO_GPOER |= (1 << line);
+@@ -107,12 +92,12 @@ static void gpio_line_config(u8 line, u3
+ *IXP4XX_GPIO_GPOER &= ~(1 << line);
+ }
+
+-static void gpio_line_get(u8 line, int *value)
++void gpio_line_get(u8 line, int *value)
+ {
+ *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1;
+ }
+
+-static void gpio_line_set(u8 line, int value)
++void gpio_line_set(u8 line, int value)
+ {
+ if (value == IXP4XX_GPIO_HIGH)
+ *IXP4XX_GPIO_GPOUTR |= (1 << line);
+--- a/arch/arm/mach-ixp4xx/include/mach/platform.h
++++ b/arch/arm/mach-ixp4xx/include/mach/platform.h
+@@ -131,5 +131,21 @@ struct pci_sys_data;
+ extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+ extern struct pci_ops ixp4xx_ops;
+
++/* GPIO pin types */
++#define IXP4XX_GPIO_OUT 0x1
++#define IXP4XX_GPIO_IN 0x2
++
++/* GPIO signal types */
++#define IXP4XX_GPIO_LOW 0
++#define IXP4XX_GPIO_HIGH 1
++
++/* GPIO Clocks */
++#define IXP4XX_GPIO_CLK_0 14
++#define IXP4XX_GPIO_CLK_1 15
++
++void gpio_line_config(u8 line, u32 direction);
++void gpio_line_get(u8 line, int *value);
++void gpio_line_set(u8 line, int value);
++
+ #endif // __ASSEMBLY__
+