]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: shmobile: move custom gpio functions to sh-gpio.h
authorRob Herring <rob.herring@calxeda.com>
Tue, 28 Aug 2012 17:54:42 +0000 (12:54 -0500)
committerRob Herring <rob.herring@calxeda.com>
Fri, 14 Sep 2012 14:21:58 +0000 (09:21 -0500)
Move custom shmobile gpio code to a sh-gpio.h to remove the dependency
on mach/gpio.h. shmobile always uses gpiolib, so we can remove
__GPIOLIB_COMPLEX define from mach/gpio.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
13 files changed:
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-g4evm.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/include/mach/gpio.h
arch/arm/mach-shmobile/pfc-r8a7740.c
arch/arm/mach-shmobile/pfc-r8a7779.c
arch/arm/mach-shmobile/pfc-sh7367.c
arch/arm/mach-shmobile/pfc-sh7372.c
arch/arm/mach-shmobile/pfc-sh7377.c
arch/arm/mach-shmobile/pfc-sh73a0.c
arch/arm/mach-shmobile/sh-gpio.h [new file with mode: 0644]
drivers/sh/pfc/gpio.c

index f172ca85905cdf68d114d046ea987e43b0570af9..c7f164e2066121d33e229ae42472be985e964b8e 100644 (file)
@@ -66,6 +66,8 @@
 #include <asm/mach/arch.h>
 #include <asm/setup.h>
 
+#include "sh-gpio.h"
+
 /*
  * Address     Interface               BusWidth        note
  * ------------------------------------------------------------------
index cf10f92856dcbb905712024b1d6a00e55c77cf51..15ffb4cac42438536a686b4b52b07b7e01ef5597 100644 (file)
@@ -54,6 +54,8 @@
 #include <sound/sh_fsi.h>
 #include <sound/simple_card.h>
 
+#include "sh-gpio.h"
+
 /*
  * CON1                Camera Module
  * CON2                Extension Bus
index fa5dfc5c8ed6ecd91966e178db9d010e499111c7..eeee12e4da62ec63ba879f07ededbd1dc5d70165 100644 (file)
@@ -42,6 +42,8 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+#include "sh-gpio.h"
+
 /*
  * SDHI
  *
index 7ea2b31e31991355cb9304dfcafcc4ab6db6f628..76544044bf6a72a8816e37ea7d6266e57ad380c3 100644 (file)
@@ -64,6 +64,8 @@
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
+#include "sh-gpio.h"
+
 /*
  * Address     Interface               BusWidth        note
  * ------------------------------------------------------------------
index 844507d937cbc2937f6489046bd0b9898d2d1f74..40a8c178f10d9e85a2873c83247c3f2fe553f408 100644 (file)
@@ -1,62 +1 @@
-/*
- * Generic GPIO API and pinmux table support
- *
- * Copyright (c) 2008  Magnus Damm
- *
- * 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
- * for more details.
- */
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
-
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/sh_pfc.h>
-#include <linux/io.h>
-
-#ifdef CONFIG_GPIOLIB
-
-static inline int irq_to_gpio(unsigned int irq)
-{
-       return -ENOSYS;
-}
-
-#else
-
-#define __ARM_GPIOLIB_COMPLEX
-
-#endif /* CONFIG_GPIOLIB */
-
-/*
- * FIXME !!
- *
- * current gpio frame work doesn't have
- * the method to control only pull up/down/free.
- * this function should be replaced by correct gpio function
- */
-static inline void __init gpio_direction_none(u32 addr)
-{
-       __raw_writeb(0x00, addr);
-}
-
-static inline void __init gpio_request_pullup(u32 addr)
-{
-       u8 data = __raw_readb(addr);
-
-       data &= 0x0F;
-       data |= 0xC0;
-       __raw_writeb(data, addr);
-}
-
-static inline void __init gpio_request_pulldown(u32 addr)
-{
-       u8 data = __raw_readb(addr);
-
-       data &= 0x0F;
-       data |= 0xA0;
-
-       __raw_writeb(data, addr);
-}
-
-#endif /* __ASM_ARCH_GPIO_H */
+/* empty */
index ce9e7fa5cc8a6f4c2c2cba6efa31014fa6303b9f..134d1b9a88210d5c724ea4d895cf23d634a6c368 100644 (file)
@@ -20,7 +20,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/r8a7740.h>
 #include <mach/irqs.h>
 
index d14c9b048077b855d45740efae7c82dc28d8b261..cbc26ba2a0a23d6ce818a4d19a4e4b2b3ca9da43 100644 (file)
@@ -19,7 +19,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <linux/ioport.h>
 #include <mach/r8a7779.h>
 
index e6e524654e676e270d702de51005ffcabc0557e2..c0c137f39052f757fcc696d9e3d5da43d2456dc3 100644 (file)
@@ -18,7 +18,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/sh7367.h>
 
 #define CPU_ALL_PORT(fn, pfx, sfx)                             \
index 336093f9210ac7cfab8eb4f48c4b4061da8fef91..7a1525fd6adaccd84c0d384ba8d586a2fbe606fa 100644 (file)
@@ -22,7 +22,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/irqs.h>
 #include <mach/sh7372.h>
 
index 2f10511946ad1a8a60287f02ef6b7c6fa58bc211..f3117f67fa258db1a7b20f40bb8429cd0a0286ac 100644 (file)
@@ -19,7 +19,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/sh7377.h>
 
 #define CPU_ALL_PORT(fn, pfx, sfx)                             \
index 4a547b803268f9a37a218253bb41f0d456e1908a..b442f9d8c716d40f6ae2774ec7ee04fc0303c2da 100644 (file)
@@ -20,7 +20,7 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/gpio.h>
+#include <linux/sh_pfc.h>
 #include <mach/sh73a0.h>
 #include <mach/irqs.h>
 
diff --git a/arch/arm/mach-shmobile/sh-gpio.h b/arch/arm/mach-shmobile/sh-gpio.h
new file mode 100644 (file)
index 0000000..7ba1877
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Generic GPIO API and pinmux table support
+ *
+ * Copyright (c) 2008  Magnus Damm
+ *
+ * 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
+ * for more details.
+ */
+#ifndef __ASM_ARCH_GPIO_H
+#define __ASM_ARCH_GPIO_H
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+
+/*
+ * FIXME !!
+ *
+ * current gpio frame work doesn't have
+ * the method to control only pull up/down/free.
+ * this function should be replaced by correct gpio function
+ */
+static inline void __init gpio_direction_none(u32 addr)
+{
+       __raw_writeb(0x00, addr);
+}
+
+static inline void __init gpio_request_pullup(u32 addr)
+{
+       u8 data = __raw_readb(addr);
+
+       data &= 0x0F;
+       data |= 0xC0;
+       __raw_writeb(data, addr);
+}
+
+static inline void __init gpio_request_pulldown(u32 addr)
+{
+       u8 data = __raw_readb(addr);
+
+       data &= 0x0F;
+       data |= 0xA0;
+
+       __raw_writeb(data, addr);
+}
+
+#endif /* __ASM_ARCH_GPIO_H */
index 62bca98474a9f11f50f3bec4ea041488dcc633b7..038fa071382ac0e3c89be50977bb25b6160f58d5 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pinctrl/consumer.h>
+#include <linux/sh_pfc.h>
 
 struct sh_pfc_chip {
        struct sh_pfc           *pfc;