From 4f82e3ee724f1712f9e84b8802e24ea096a6089f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 15 Jul 2013 21:10:54 +0200 Subject: sh-pfc: Support pins not associated with a GPIO port Pins with selectable functions but without a GPIO port can't be named PORT_# or GP_#_#. Add a SH_PFC_PIN_NAMED macro to declare such pins in the pinmux pins array, naming them with the PIN_ prefix followed by the pin physical position. In order to make sure not to register those pins as GPIOs, add a SH_PFC_PIN_CFG_NO_GPIO pin flag to denote pins without a GPIO port. Signed-off-by: Laurent Pinchart Tested-by: Yusuke Goda --- drivers/pinctrl/sh-pfc/sh_pfc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/pinctrl/sh-pfc/sh_pfc.h') diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h index 2469b35cfda7..11bd0d970a52 100644 --- a/drivers/pinctrl/sh-pfc/sh_pfc.h +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h @@ -26,6 +26,7 @@ enum { #define SH_PFC_PIN_CFG_OUTPUT (1 << 1) #define SH_PFC_PIN_CFG_PULL_UP (1 << 2) #define SH_PFC_PIN_CFG_PULL_DOWN (1 << 3) +#define SH_PFC_PIN_CFG_NO_GPIO (1 << 31) struct sh_pfc_pin { u16 pin; @@ -266,6 +267,14 @@ struct sh_pfc_soc_info { .configs = cfgs, \ } +/* SH_PFC_PIN_NAMED - Expand to a sh_pfc_pin entry with the given name */ +#define SH_PFC_PIN_NAMED(row, col, _name) \ + { \ + .pin = PIN_NUMBER(row, col), \ + .name = __stringify(PIN_##_name), \ + .configs = SH_PFC_PIN_CFG_NO_GPIO, \ + } + /* PINMUX_DATA_ALL - Expand to a list of PORT_name_DATA, PORT_name_FN0, * PORT_name_OUT, PORT_name_IN marks */ -- cgit v1.2.3-55-g7522