summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc/sh_pfc.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2012-11-29 13:24:07 +0100
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-03-15 13:33:38 +0100
commita373ed0aa229f06e7d699797669b664ef39d97c1 (patch)
tree0fe20a0492d3bd6953fc706eaa97bc28d7e14ff9 /drivers/pinctrl/sh-pfc/sh_pfc.h
parentsh-pfc: Don't needlessly check GPIO type in sh_gpio_free() (diff)
downloadlinux-a373ed0aa229f06e7d699797669b664ef39d97c1.tar.xz
linux-a373ed0aa229f06e7d699797669b664ef39d97c1.zip
sh-pfc: Split pins and functions definition tables
Split the GPIOs table into a pins table for real GPIOs and a functions table for function GPIOs. Only register pins with the pinctrl core. The function GPIOs remain accessible as GPIOs. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/sh_pfc.h')
-rw-r--r--drivers/pinctrl/sh-pfc/sh_pfc.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 6ed7ab9d56d4..940170a4c64f 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -35,23 +35,27 @@ enum {
#define PINMUX_FLAG_DREG_SHIFT 10
#define PINMUX_FLAG_DREG (0x3f << PINMUX_FLAG_DREG_SHIFT)
-struct pinmux_gpio {
+struct pinmux_pin {
const pinmux_enum_t enum_id;
pinmux_flag_t flags;
const char *name;
};
+struct pinmux_func {
+ const pinmux_enum_t enum_id;
+ const char *name;
+};
+
#define PINMUX_GPIO(gpio, data_or_mark) \
[gpio] = { \
.name = __stringify(gpio), \
.enum_id = data_or_mark, \
.flags = PINMUX_TYPE_GPIO \
}
-#define PINMUX_GPIO_FN(gpio, data_or_mark) \
- [gpio] = { \
+#define PINMUX_GPIO_FN(gpio, base, data_or_mark) \
+ [gpio - (base)] = { \
.name = __stringify(gpio), \
.enum_id = data_or_mark, \
- .flags = PINMUX_TYPE_FUNCTION \
}
#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0
@@ -106,9 +110,10 @@ struct sh_pfc_soc_info {
struct pinmux_range output;
struct pinmux_range function;
- struct pinmux_gpio *gpios;
+ struct pinmux_pin *pins;
unsigned int nr_pins;
- unsigned int nr_gpios;
+ struct pinmux_func *func_gpios;
+ unsigned int nr_func_gpios;
struct pinmux_cfg_reg *cfg_regs;
struct pinmux_data_reg *data_regs;
@@ -145,7 +150,7 @@ enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };
#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_FN(GPIO_FN_##str, str##_MARK)
+#define GPIO_FN(str) PINMUX_GPIO_FN(GPIO_FN_##str, PINMUX_FN_BASE, str##_MARK)
/* helper macro for pinmux_enum_t */
#define PORT_DATA_I(nr) \