diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-02-14 00:59:49 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-07-29 15:17:47 +0200 |
commit | 9689896cb106bf756ec3616beaeb57da6e39a6a0 (patch) | |
tree | d14f4c7a47a83473d3bb2f2c2dbd7e2eef4ff48b | |
parent | 3ce0d7eba042b186cdf9e50f53320240ae36cf6b (diff) | |
download | linux-9689896cb106bf756ec3616beaeb57da6e39a6a0.tar.gz linux-9689896cb106bf756ec3616beaeb57da6e39a6a0.tar.bz2 linux-9689896cb106bf756ec3616beaeb57da6e39a6a0.zip |
sh-pfc: Add pin number to struct sh_pfc_pin
The pin number is usually equal to the GPIO number but can differ when
GPIO numbering is sparse.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
-rw-r--r-- | drivers/pinctrl/sh-pfc/sh_pfc.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h index 596ceb7faf78..839e69548a2c 100644 --- a/drivers/pinctrl/sh-pfc/sh_pfc.h +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h @@ -28,6 +28,7 @@ enum { #define SH_PFC_PIN_CFG_PULL_DOWN (1 << 3) struct sh_pfc_pin { + u16 pin; u16 enum_id; const char *name; unsigned int configs; @@ -214,8 +215,9 @@ struct sh_pfc_soc_info { #define GP_ALL(str) CPU_ALL_PORT(_GP_ALL, str) /* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */ -#define _GP_GPIO(bank, pin, _name, sfx) \ - [(bank * 32) + pin] = { \ +#define _GP_GPIO(bank, _pin, _name, sfx) \ + [(bank * 32) + _pin] = { \ + .pin = (bank * 32) + _pin, \ .name = __stringify(_name), \ .enum_id = _name##_DATA, \ } @@ -250,17 +252,19 @@ struct sh_pfc_soc_info { #define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str) /* PINMUX_GPIO - Expand to a sh_pfc_pin entry */ -#define PINMUX_GPIO(pin) \ - [GPIO_##pin] = { \ +#define PINMUX_GPIO(_pin) \ + [GPIO_##_pin] = { \ + .pin = (u16)-1, \ .name = __stringify(name), \ - .enum_id = pin##_DATA, \ + .enum_id = _pin##_DATA, \ } /* SH_PFC_PIN_CFG - Expand to a sh_pfc_pin entry (named PORT#) with config */ -#define SH_PFC_PIN_CFG(pin, cfgs) \ +#define SH_PFC_PIN_CFG(_pin, cfgs) \ { \ - .name = __stringify(PORT##pin), \ - .enum_id = PORT##pin##_DATA, \ + .pin = _pin, \ + .name = __stringify(PORT##_pin), \ + .enum_id = PORT##_pin##_DATA, \ .configs = cfgs, \ } |