sh-pfc: Move sh_pfc.h from include/linux/ to driver directory
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sat, 15 Dec 2012 22:51:55 +0000 (23:51 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Fri, 25 Jan 2013 00:24:31 +0000 (09:24 +0900)
The header file isn't used by arch code anymore. Make it private to the
driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
22 files changed:
drivers/pinctrl/sh-pfc/core.c
drivers/pinctrl/sh-pfc/core.h
drivers/pinctrl/sh-pfc/gpio.c
drivers/pinctrl/sh-pfc/pfc-r8a7740.c
drivers/pinctrl/sh-pfc/pfc-r8a7779.c
drivers/pinctrl/sh-pfc/pfc-sh7203.c
drivers/pinctrl/sh-pfc/pfc-sh7264.c
drivers/pinctrl/sh-pfc/pfc-sh7269.c
drivers/pinctrl/sh-pfc/pfc-sh7372.c
drivers/pinctrl/sh-pfc/pfc-sh73a0.c
drivers/pinctrl/sh-pfc/pfc-sh7720.c
drivers/pinctrl/sh-pfc/pfc-sh7722.c
drivers/pinctrl/sh-pfc/pfc-sh7723.c
drivers/pinctrl/sh-pfc/pfc-sh7724.c
drivers/pinctrl/sh-pfc/pfc-sh7734.c
drivers/pinctrl/sh-pfc/pfc-sh7757.c
drivers/pinctrl/sh-pfc/pfc-sh7785.c
drivers/pinctrl/sh-pfc/pfc-sh7786.c
drivers/pinctrl/sh-pfc/pfc-shx3.c
drivers/pinctrl/sh-pfc/pinctrl.c
drivers/pinctrl/sh-pfc/sh_pfc.h [new file with mode: 0644]
include/linux/sh_pfc.h [deleted file]

index 33181f4b0731cc123646439fadcde8f6aaa6a2d0..d323c24fffafdcd3f329c48c78b74e43d771c4d7 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/module.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_device.h>
-#include <linux/sh_pfc.h>
 #include <linux/slab.h>
 
 #include "core.h"
index 804082678a5c17fa0d5ef67ea6d1dc953c85cdf2..ba7c33c33599920d404801ad86e01989a042e24a 100644 (file)
 #define __SH_PFC_CORE_H__
 
 #include <linux/compiler.h>
-#include <linux/sh_pfc.h>
 #include <linux/types.h>
 
+#include "sh_pfc.h"
+
 struct sh_pfc_window {
        phys_addr_t phys;
        void __iomem *virt;
index 3cbdfea1dec0642cc6a36a111e4d4d12a0f31d66..a535075c8b69f0aee1380ebc4fca94810dae5a69 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pinctrl/consumer.h>
-#include <linux/sh_pfc.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 
index 0ab4cb6dc09b47f3367484e257c77c35c0beb996..214788c4a606180755e8e6f02c97afb4059fa163 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <mach/r8a7740.h>
 #include <mach/irqs.h>
 
+#include "sh_pfc.h"
+
 #define CPU_ALL_PORT(fn, pfx, sfx)                                     \
        PORT_10(fn, pfx, sfx),          PORT_90(fn, pfx, sfx),          \
        PORT_10(fn, pfx##10, sfx),      PORT_90(fn, pfx##1, sfx),       \
index 81471722682fe3b5d90bad9131c93ee8a07168fa..13feaa0c0eb703e49960d2f62e35264ea8e91cbd 100644 (file)
  */
 
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <mach/r8a7779.h>
 
+#include "sh_pfc.h"
+
 #define CPU_32_PORT(fn, pfx, sfx)                              \
        PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx),        \
        PORT_10(fn, pfx##2, sfx), PORT_1(fn, pfx##30, sfx),     \
index 62bd17329d29ab7ed68cfeca9a61fd4f52da2423..01b425dfd162c7c8167487ac4b4e0a9ae926b635 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/gpio.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7203.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index 03d3f9c5137307045d9f3935374e6ce942b8159c..2ba5639dcf349c59d1a7f8b42d2a266a65fb8f49 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/gpio.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7264.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index dab04d45644f814e0c152868aae928267a81e8ba..b1b5d6d4ad76b29fc9836aa83cefc40b3e01f654 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/gpio.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7269.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index a52fabe90f38584753100e215fcb94972fc11e05..d44e7f02069b2779e082c52d55a7db6661e1cad6 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <mach/irqs.h>
 #include <mach/sh7372.h>
 
+#include "sh_pfc.h"
+
 #define CPU_ALL_PORT(fn, pfx, sfx) \
        PORT_10(fn, pfx, sfx),          PORT_90(fn, pfx, sfx), \
        PORT_10(fn, pfx##10, sfx),      PORT_10(fn, pfx##11, sfx), \
index 8a0eee95e025a335fa1c3cbecfd5d16c220a71f0..709008e941244dc022cb5804157cede7ac9ef0b7 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <mach/sh73a0.h>
 #include <mach/irqs.h>
 
+#include "sh_pfc.h"
+
 #define CPU_ALL_PORT(fn, pfx, sfx)                             \
        PORT_10(fn, pfx,    sfx), PORT_10(fn, pfx##1, sfx),     \
        PORT_10(fn, pfx##2, sfx), PORT_10(fn, pfx##3, sfx),     \
index 20d05776d1242ff6194b913b720f557f6c22ef38..10872ed688a6662a729760bb994377b6e3c936ea 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/gpio.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7720.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index f58f0094845436167863ddeb83bf406c76a15c85..2de0929315e6c257538183e5d640d11f9a0830b3 100644 (file)
@@ -1,9 +1,10 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/gpio.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7722.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index fa3d36bba19244e8669fbffdfaf3ffe09ec976e6..609673d3d70ef976a6f1f5ffc2d57d1464831b06 100644 (file)
 
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7723.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index 7ad72c20209dc0bb3e97e58853285ba40d4e123f..233fbf750b394b1bffd1aaffc86fc90d3396464b 100644 (file)
 
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7724.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index cbb5f4c5f4b04998a8efc72d64703cbbb7e8fff8..23d76d262c3204a431892bc8f575f930036b8cd9 100644 (file)
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7734.h>
 
+#include "sh_pfc.h"
+
 #define CPU_32_PORT(fn, pfx, sfx)                              \
        PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx),        \
        PORT_10(fn, pfx##2, sfx), PORT_1(fn, pfx##30, sfx),     \
index 6f707a0dffee913765e0764883ceffb736ff8257..5ed74cd0ba99395ddbf7f5185aa9791b4faa45c1 100644 (file)
 
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7757.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index 23f2c316412cadb69795f485ebe6c5a9e149ac51..3b1825d925bb7a7b961f78a2886fdee08502ee44 100644 (file)
 
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7785.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index e1453cf7ed22fe46afed2d705901f40663e41680..1e18b58f9e5fba7659e129e8cdfe95eaf4e08bf8 100644 (file)
 
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <cpu/sh7786.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index bd54042a106639c376393333b39f0080d8316a49..ccf6918b03c607c28726938a1a41499fff2d318a 100644 (file)
@@ -9,9 +9,10 @@
  */
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sh_pfc.h>
 #include <cpu/shx3.h>
 
+#include "sh_pfc.h"
+
 enum {
        PINMUX_RESERVED = 0,
 
index fdfe7bea150253ac3fe3d005ebe70bf3d9926144..11e0e1374d656464afd7360b5b6bdfb2e3fa3b1a 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinmux.h>
-#include <linux/sh_pfc.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
new file mode 100644 (file)
index 0000000..13049c4
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * SuperH Pin Function Controller 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 __SH_PFC_H
+#define __SH_PFC_H
+
+#include <linux/stringify.h>
+#include <asm-generic/gpio.h>
+
+typedef unsigned short pinmux_enum_t;
+typedef unsigned short pinmux_flag_t;
+
+enum {
+       PINMUX_TYPE_NONE,
+
+       PINMUX_TYPE_FUNCTION,
+       PINMUX_TYPE_GPIO,
+       PINMUX_TYPE_OUTPUT,
+       PINMUX_TYPE_INPUT,
+       PINMUX_TYPE_INPUT_PULLUP,
+       PINMUX_TYPE_INPUT_PULLDOWN,
+
+       PINMUX_FLAG_TYPE,       /* must be last */
+};
+
+#define PINMUX_FLAG_DBIT_SHIFT      5
+#define PINMUX_FLAG_DBIT            (0x1f << PINMUX_FLAG_DBIT_SHIFT)
+#define PINMUX_FLAG_DREG_SHIFT      10
+#define PINMUX_FLAG_DREG            (0x3f << PINMUX_FLAG_DREG_SHIFT)
+
+struct pinmux_gpio {
+       pinmux_enum_t enum_id;
+       pinmux_flag_t flags;
+       const char *name;
+};
+
+#define PINMUX_GPIO(gpio, data_or_mark) \
+       [gpio] = { .name = __stringify(gpio), .enum_id = data_or_mark, .flags = PINMUX_TYPE_NONE }
+
+#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0
+
+struct pinmux_cfg_reg {
+       unsigned long reg, reg_width, field_width;
+       unsigned long *cnt;
+       pinmux_enum_t *enum_ids;
+       unsigned long *var_field_width;
+};
+
+#define PINMUX_CFG_REG(name, r, r_width, f_width) \
+       .reg = r, .reg_width = r_width, .field_width = f_width,         \
+       .cnt = (unsigned long [r_width / f_width]) {}, \
+       .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)])
+
+#define PINMUX_CFG_REG_VAR(name, r, r_width, var_fw0, var_fwn...) \
+       .reg = r, .reg_width = r_width, \
+       .cnt = (unsigned long [r_width]) {}, \
+       .var_field_width = (unsigned long [r_width]) { var_fw0, var_fwn, 0 }, \
+       .enum_ids = (pinmux_enum_t [])
+
+struct pinmux_data_reg {
+       unsigned long reg, reg_width, reg_shadow;
+       pinmux_enum_t *enum_ids;
+       void __iomem *mapped_reg;
+};
+
+#define PINMUX_DATA_REG(name, r, r_width) \
+       .reg = r, .reg_width = r_width, \
+       .enum_ids = (pinmux_enum_t [r_width]) \
+
+struct pinmux_irq {
+       int irq;
+       pinmux_enum_t *enum_ids;
+};
+
+#define PINMUX_IRQ(irq_nr, ids...)                        \
+       { .irq = irq_nr, .enum_ids = (pinmux_enum_t []) { ids, 0 } }    \
+
+struct pinmux_range {
+       pinmux_enum_t begin;
+       pinmux_enum_t end;
+       pinmux_enum_t force;
+};
+
+struct sh_pfc_soc_info {
+       char *name;
+       pinmux_enum_t reserved_id;
+       struct pinmux_range data;
+       struct pinmux_range input;
+       struct pinmux_range input_pd;
+       struct pinmux_range input_pu;
+       struct pinmux_range output;
+       struct pinmux_range mark;
+       struct pinmux_range function;
+
+       unsigned first_gpio, last_gpio;
+
+       struct pinmux_gpio *gpios;
+       struct pinmux_cfg_reg *cfg_regs;
+       struct pinmux_data_reg *data_regs;
+
+       pinmux_enum_t *gpio_data;
+       unsigned int gpio_data_size;
+
+       struct pinmux_irq *gpio_irq;
+       unsigned int gpio_irq_size;
+
+       unsigned long unlock_reg;
+};
+
+enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };
+
+/* 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)
+
+#define PORT_DATA_I_PD(nr)     \
+       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,    \
+                   PORT##nr##_IN, PORT##nr##_IN_PD)
+
+#define PORT_DATA_I_PU(nr)     \
+       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,    \
+                   PORT##nr##_IN, PORT##nr##_IN_PU)
+
+#define PORT_DATA_I_PU_PD(nr)  \
+       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,                    \
+                   PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
+
+#define PORT_DATA_O(nr)                \
+       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
+
+#define PORT_DATA_IO(nr)       \
+       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,    \
+                   PORT##nr##_IN)
+
+#define PORT_DATA_IO_PD(nr)    \
+       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,    \
+                   PORT##nr##_IN, PORT##nr##_IN_PD)
+
+#define PORT_DATA_IO_PU(nr)    \
+       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,    \
+                   PORT##nr##_IN, PORT##nr##_IN_PU)
+
+#define PORT_DATA_IO_PU_PD(nr) \
+       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,    \
+                   PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
+
+/* helper macro for top 4 bits in PORTnCR */
+#define _PCRH(in, in_pd, in_pu, out)   \
+       0, (out), (in), 0,              \
+       0, 0, 0, 0,                     \
+       0, 0, (in_pd), 0,               \
+       0, 0, (in_pu), 0
+
+#define PORTCR(nr, reg)                                                        \
+       {                                                               \
+               PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {             \
+                       _PCRH(PORT##nr##_IN, PORT##nr##_IN_PD,          \
+                             PORT##nr##_IN_PU, PORT##nr##_OUT),        \
+                               PORT##nr##_FN0, PORT##nr##_FN1,         \
+                               PORT##nr##_FN2, PORT##nr##_FN3,         \
+                               PORT##nr##_FN4, PORT##nr##_FN5,         \
+                               PORT##nr##_FN6, PORT##nr##_FN7 }        \
+       }
+
+#endif /* __SH_PFC_H */
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
deleted file mode 100644 (file)
index 13049c4..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * SuperH Pin Function Controller 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 __SH_PFC_H
-#define __SH_PFC_H
-
-#include <linux/stringify.h>
-#include <asm-generic/gpio.h>
-
-typedef unsigned short pinmux_enum_t;
-typedef unsigned short pinmux_flag_t;
-
-enum {
-       PINMUX_TYPE_NONE,
-
-       PINMUX_TYPE_FUNCTION,
-       PINMUX_TYPE_GPIO,
-       PINMUX_TYPE_OUTPUT,
-       PINMUX_TYPE_INPUT,
-       PINMUX_TYPE_INPUT_PULLUP,
-       PINMUX_TYPE_INPUT_PULLDOWN,
-
-       PINMUX_FLAG_TYPE,       /* must be last */
-};
-
-#define PINMUX_FLAG_DBIT_SHIFT      5
-#define PINMUX_FLAG_DBIT            (0x1f << PINMUX_FLAG_DBIT_SHIFT)
-#define PINMUX_FLAG_DREG_SHIFT      10
-#define PINMUX_FLAG_DREG            (0x3f << PINMUX_FLAG_DREG_SHIFT)
-
-struct pinmux_gpio {
-       pinmux_enum_t enum_id;
-       pinmux_flag_t flags;
-       const char *name;
-};
-
-#define PINMUX_GPIO(gpio, data_or_mark) \
-       [gpio] = { .name = __stringify(gpio), .enum_id = data_or_mark, .flags = PINMUX_TYPE_NONE }
-
-#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0
-
-struct pinmux_cfg_reg {
-       unsigned long reg, reg_width, field_width;
-       unsigned long *cnt;
-       pinmux_enum_t *enum_ids;
-       unsigned long *var_field_width;
-};
-
-#define PINMUX_CFG_REG(name, r, r_width, f_width) \
-       .reg = r, .reg_width = r_width, .field_width = f_width,         \
-       .cnt = (unsigned long [r_width / f_width]) {}, \
-       .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)])
-
-#define PINMUX_CFG_REG_VAR(name, r, r_width, var_fw0, var_fwn...) \
-       .reg = r, .reg_width = r_width, \
-       .cnt = (unsigned long [r_width]) {}, \
-       .var_field_width = (unsigned long [r_width]) { var_fw0, var_fwn, 0 }, \
-       .enum_ids = (pinmux_enum_t [])
-
-struct pinmux_data_reg {
-       unsigned long reg, reg_width, reg_shadow;
-       pinmux_enum_t *enum_ids;
-       void __iomem *mapped_reg;
-};
-
-#define PINMUX_DATA_REG(name, r, r_width) \
-       .reg = r, .reg_width = r_width, \
-       .enum_ids = (pinmux_enum_t [r_width]) \
-
-struct pinmux_irq {
-       int irq;
-       pinmux_enum_t *enum_ids;
-};
-
-#define PINMUX_IRQ(irq_nr, ids...)                        \
-       { .irq = irq_nr, .enum_ids = (pinmux_enum_t []) { ids, 0 } }    \
-
-struct pinmux_range {
-       pinmux_enum_t begin;
-       pinmux_enum_t end;
-       pinmux_enum_t force;
-};
-
-struct sh_pfc_soc_info {
-       char *name;
-       pinmux_enum_t reserved_id;
-       struct pinmux_range data;
-       struct pinmux_range input;
-       struct pinmux_range input_pd;
-       struct pinmux_range input_pu;
-       struct pinmux_range output;
-       struct pinmux_range mark;
-       struct pinmux_range function;
-
-       unsigned first_gpio, last_gpio;
-
-       struct pinmux_gpio *gpios;
-       struct pinmux_cfg_reg *cfg_regs;
-       struct pinmux_data_reg *data_regs;
-
-       pinmux_enum_t *gpio_data;
-       unsigned int gpio_data_size;
-
-       struct pinmux_irq *gpio_irq;
-       unsigned int gpio_irq_size;
-
-       unsigned long unlock_reg;
-};
-
-enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };
-
-/* 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)
-
-#define PORT_DATA_I_PD(nr)     \
-       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,    \
-                   PORT##nr##_IN, PORT##nr##_IN_PD)
-
-#define PORT_DATA_I_PU(nr)     \
-       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,    \
-                   PORT##nr##_IN, PORT##nr##_IN_PU)
-
-#define PORT_DATA_I_PU_PD(nr)  \
-       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0,                    \
-                   PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
-
-#define PORT_DATA_O(nr)                \
-       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
-
-#define PORT_DATA_IO(nr)       \
-       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,    \
-                   PORT##nr##_IN)
-
-#define PORT_DATA_IO_PD(nr)    \
-       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,    \
-                   PORT##nr##_IN, PORT##nr##_IN_PD)
-
-#define PORT_DATA_IO_PU(nr)    \
-       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,    \
-                   PORT##nr##_IN, PORT##nr##_IN_PU)
-
-#define PORT_DATA_IO_PU_PD(nr) \
-       PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT,    \
-                   PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
-
-/* helper macro for top 4 bits in PORTnCR */
-#define _PCRH(in, in_pd, in_pu, out)   \
-       0, (out), (in), 0,              \
-       0, 0, 0, 0,                     \
-       0, 0, (in_pd), 0,               \
-       0, 0, (in_pu), 0
-
-#define PORTCR(nr, reg)                                                        \
-       {                                                               \
-               PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) {             \
-                       _PCRH(PORT##nr##_IN, PORT##nr##_IN_PD,          \
-                             PORT##nr##_IN_PU, PORT##nr##_OUT),        \
-                               PORT##nr##_FN0, PORT##nr##_FN1,         \
-                               PORT##nr##_FN2, PORT##nr##_FN3,         \
-                               PORT##nr##_FN4, PORT##nr##_FN5,         \
-                               PORT##nr##_FN6, PORT##nr##_FN7 }        \
-       }
-
-#endif /* __SH_PFC_H */