diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-07-15 11:42:48 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-07-29 09:17:43 -0400 |
commit | df020272abd6e30673f397fea31e5e133a87c0fe (patch) | |
tree | d7064f9dd3e9f00be1eb509f9e979bca275bf4a0 /drivers/pinctrl/sh-pfc/pfc-sh7372.c | |
parent | e3d93b46718f12924128e5e70e2f3f992a95fa3b (diff) |
sh-pfc: Consolidate pin definition macros
Move the pin definition macros to a common header file.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/pfc-sh7372.c')
-rw-r--r-- | drivers/pinctrl/sh-pfc/pfc-sh7372.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7372.c b/drivers/pinctrl/sh-pfc/pfc-sh7372.c index 9174ff26738e..17f1c17956c8 100644 --- a/drivers/pinctrl/sh-pfc/pfc-sh7372.c +++ b/drivers/pinctrl/sh-pfc/pfc-sh7372.c | |||
@@ -829,13 +829,6 @@ static const u16 pinmux_data[] = { | |||
829 | PINMUX_DATA(MFIv4_MARK, MSEL4CR_6_1), | 829 | PINMUX_DATA(MFIv4_MARK, MSEL4CR_6_1), |
830 | }; | 830 | }; |
831 | 831 | ||
832 | #define SH7372_PIN(pin, cfgs) \ | ||
833 | { \ | ||
834 | .name = __stringify(PORT##pin), \ | ||
835 | .enum_id = PORT##pin##_DATA, \ | ||
836 | .configs = cfgs, \ | ||
837 | } | ||
838 | |||
839 | #define __I (SH_PFC_PIN_CFG_INPUT) | 832 | #define __I (SH_PFC_PIN_CFG_INPUT) |
840 | #define __O (SH_PFC_PIN_CFG_OUTPUT) | 833 | #define __O (SH_PFC_PIN_CFG_OUTPUT) |
841 | #define __IO (SH_PFC_PIN_CFG_INPUT | SH_PFC_PIN_CFG_OUTPUT) | 834 | #define __IO (SH_PFC_PIN_CFG_INPUT | SH_PFC_PIN_CFG_OUTPUT) |
@@ -843,15 +836,15 @@ static const u16 pinmux_data[] = { | |||
843 | #define __PU (SH_PFC_PIN_CFG_PULL_UP) | 836 | #define __PU (SH_PFC_PIN_CFG_PULL_UP) |
844 | #define __PUD (SH_PFC_PIN_CFG_PULL_DOWN | SH_PFC_PIN_CFG_PULL_UP) | 837 | #define __PUD (SH_PFC_PIN_CFG_PULL_DOWN | SH_PFC_PIN_CFG_PULL_UP) |
845 | 838 | ||
846 | #define SH7372_PIN_I_PD(pin) SH7372_PIN(pin, __I | __PD) | 839 | #define SH7372_PIN_I_PD(pin) SH_PFC_PIN_CFG(pin, __I | __PD) |
847 | #define SH7372_PIN_I_PU(pin) SH7372_PIN(pin, __I | __PU) | 840 | #define SH7372_PIN_I_PU(pin) SH_PFC_PIN_CFG(pin, __I | __PU) |
848 | #define SH7372_PIN_I_PU_PD(pin) SH7372_PIN(pin, __I | __PUD) | 841 | #define SH7372_PIN_I_PU_PD(pin) SH_PFC_PIN_CFG(pin, __I | __PUD) |
849 | #define SH7372_PIN_IO(pin) SH7372_PIN(pin, __IO) | 842 | #define SH7372_PIN_IO(pin) SH_PFC_PIN_CFG(pin, __IO) |
850 | #define SH7372_PIN_IO_PD(pin) SH7372_PIN(pin, __IO | __PD) | 843 | #define SH7372_PIN_IO_PD(pin) SH_PFC_PIN_CFG(pin, __IO | __PD) |
851 | #define SH7372_PIN_IO_PU(pin) SH7372_PIN(pin, __IO | __PU) | 844 | #define SH7372_PIN_IO_PU(pin) SH_PFC_PIN_CFG(pin, __IO | __PU) |
852 | #define SH7372_PIN_IO_PU_PD(pin) SH7372_PIN(pin, __IO | __PUD) | 845 | #define SH7372_PIN_IO_PU_PD(pin) SH_PFC_PIN_CFG(pin, __IO | __PUD) |
853 | #define SH7372_PIN_O(pin) SH7372_PIN(pin, __O) | 846 | #define SH7372_PIN_O(pin) SH_PFC_PIN_CFG(pin, __O) |
854 | #define SH7372_PIN_O_PU_PD(pin) SH7372_PIN(pin, __O | __PUD) | 847 | #define SH7372_PIN_O_PU_PD(pin) SH_PFC_PIN_CFG(pin, __O | __PUD) |
855 | 848 | ||
856 | static struct sh_pfc_pin pinmux_pins[] = { | 849 | static struct sh_pfc_pin pinmux_pins[] = { |
857 | /* Table 57-1 (I/O and Pull U/D) */ | 850 | /* Table 57-1 (I/O and Pull U/D) */ |