Commit 9689896c authored by Laurent Pinchart's avatar Laurent Pinchart

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: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: default avatarYusuke Goda <yusuke.goda.sx@renesas.com>
parent 3ce0d7eb
...@@ -28,6 +28,7 @@ enum { ...@@ -28,6 +28,7 @@ enum {
#define SH_PFC_PIN_CFG_PULL_DOWN (1 << 3) #define SH_PFC_PIN_CFG_PULL_DOWN (1 << 3)
struct sh_pfc_pin { struct sh_pfc_pin {
u16 pin;
u16 enum_id; u16 enum_id;
const char *name; const char *name;
unsigned int configs; unsigned int configs;
...@@ -214,8 +215,9 @@ struct sh_pfc_soc_info { ...@@ -214,8 +215,9 @@ struct sh_pfc_soc_info {
#define GP_ALL(str) CPU_ALL_PORT(_GP_ALL, str) #define GP_ALL(str) CPU_ALL_PORT(_GP_ALL, str)
/* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */ /* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */
#define _GP_GPIO(bank, pin, _name, sfx) \ #define _GP_GPIO(bank, _pin, _name, sfx) \
[(bank * 32) + pin] = { \ [(bank * 32) + _pin] = { \
.pin = (bank * 32) + _pin, \
.name = __stringify(_name), \ .name = __stringify(_name), \
.enum_id = _name##_DATA, \ .enum_id = _name##_DATA, \
} }
...@@ -250,17 +252,19 @@ struct sh_pfc_soc_info { ...@@ -250,17 +252,19 @@ struct sh_pfc_soc_info {
#define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str) #define PORT_ALL(str) CPU_ALL_PORT(_PORT_ALL, PORT, str)
/* PINMUX_GPIO - Expand to a sh_pfc_pin entry */ /* PINMUX_GPIO - Expand to a sh_pfc_pin entry */
#define PINMUX_GPIO(pin) \ #define PINMUX_GPIO(_pin) \
[GPIO_##pin] = { \ [GPIO_##_pin] = { \
.pin = (u16)-1, \
.name = __stringify(name), \ .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 */ /* 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), \ .pin = _pin, \
.enum_id = PORT##pin##_DATA, \ .name = __stringify(PORT##_pin), \
.enum_id = PORT##_pin##_DATA, \
.configs = cfgs, \ .configs = cfgs, \
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment