summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-11-11 03:45:33 +0100
committerPaul Mundt <lethal@linux-sh.org>2011-11-11 08:45:33 +0100
commit972c3fb69cd1cd8d549b8a06ce42611eab405c20 (patch)
tree958d994516ba847b88f747524a127190d2b9784d /include
parentARM: mach-shmobile: move helper macro PORT_DATA_xx to sh_pfc.h (diff)
downloadlinux-972c3fb69cd1cd8d549b8a06ce42611eab405c20.tar.xz
linux-972c3fb69cd1cd8d549b8a06ce42611eab405c20.zip
ARM: mach-shmobile: move helper macro PORT_xx to sh_pfc.h
This patch moves PORT_xx helper macro to sh_pfc.h, and it expects CPU_ALL_PORT() macro for each CPU Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sh_pfc.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
index 5585f280dc1d..5f6322ac63e7 100644
--- a/include/linux/sh_pfc.h
+++ b/include/linux/sh_pfc.h
@@ -104,6 +104,29 @@ struct pinmux_info {
int register_pinmux(struct pinmux_info *pip);
int unregister_pinmux(struct pinmux_info *pip);
+/* helper macro for port */
+#define PORT_1(fn, pfx, sfx) fn(pfx, sfx)
+
+#define PORT_10(fn, pfx, sfx) \
+ PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \
+ PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \
+ PORT_1(fn, pfx##4, sfx), PORT_1(fn, pfx##5, sfx), \
+ PORT_1(fn, pfx##6, sfx), PORT_1(fn, pfx##7, sfx), \
+ PORT_1(fn, pfx##8, sfx), PORT_1(fn, pfx##9, sfx)
+
+#define PORT_90(fn, pfx, sfx) \
+ PORT_10(fn, pfx##1, sfx), PORT_10(fn, pfx##2, sfx), \
+ PORT_10(fn, pfx##3, sfx), PORT_10(fn, pfx##4, sfx), \
+ PORT_10(fn, pfx##5, sfx), PORT_10(fn, pfx##6, sfx), \
+ PORT_10(fn, pfx##7, sfx), PORT_10(fn, pfx##8, sfx), \
+ PORT_10(fn, pfx##9, sfx)
+
+#define _PORT_ALL(pfx, sfx) pfx##_##sfx
+#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
+#define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str)
+#define GPIO_PORT_ALL() CPU_ALL_PORT(_GPIO_PORT, , unused)
+#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
+
/* helper macro for pinmux_enum_t */
#define PORT_DATA_I(nr) \
PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)