diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-02-13 16:09:27 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-15 08:33:38 -0400 |
commit | 17dffe48d18f9c31ba7499af385e10bc02d7c7d9 (patch) | |
tree | b37a82b48c1ef03a8c3e6b52b305d12410bbbe44 /drivers/pinctrl/sh-pfc/pfc-sh7734.c | |
parent | c07f54f604b3b458f10452b60fe21c549218bf02 (diff) |
sh-pfc: Share the PORT_10_REV, PORT_32 and PORT_32_REV definitions
The macros are defined identically and used in two SoC-specific files,
share them.
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/pfc-sh7734.c')
-rw-r--r-- | drivers/pinctrl/sh-pfc/pfc-sh7734.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh7734.c b/drivers/pinctrl/sh-pfc/pfc-sh7734.c index 20c44dd7001a..99ea220269ff 100644 --- a/drivers/pinctrl/sh-pfc/pfc-sh7734.c +++ b/drivers/pinctrl/sh-pfc/pfc-sh7734.c | |||
@@ -14,11 +14,6 @@ | |||
14 | 14 | ||
15 | #include "sh_pfc.h" | 15 | #include "sh_pfc.h" |
16 | 16 | ||
17 | #define CPU_32_PORT(fn, pfx, sfx) \ | ||
18 | PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \ | ||
19 | PORT_10(fn, pfx##2, sfx), PORT_1(fn, pfx##30, sfx), \ | ||
20 | PORT_1(fn, pfx##31, sfx) | ||
21 | |||
22 | #define CPU_32_PORT5(fn, pfx, sfx) \ | 17 | #define CPU_32_PORT5(fn, pfx, sfx) \ |
23 | PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \ | 18 | PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \ |
24 | PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \ | 19 | PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \ |
@@ -29,11 +24,11 @@ | |||
29 | 24 | ||
30 | /* GPSR0 - GPSR5 */ | 25 | /* GPSR0 - GPSR5 */ |
31 | #define CPU_ALL_PORT(fn, pfx, sfx) \ | 26 | #define CPU_ALL_PORT(fn, pfx, sfx) \ |
32 | CPU_32_PORT(fn, pfx##_0_, sfx), \ | 27 | PORT_32(fn, pfx##_0_, sfx), \ |
33 | CPU_32_PORT(fn, pfx##_1_, sfx), \ | 28 | PORT_32(fn, pfx##_1_, sfx), \ |
34 | CPU_32_PORT(fn, pfx##_2_, sfx), \ | 29 | PORT_32(fn, pfx##_2_, sfx), \ |
35 | CPU_32_PORT(fn, pfx##_3_, sfx), \ | 30 | PORT_32(fn, pfx##_3_, sfx), \ |
36 | CPU_32_PORT(fn, pfx##_4_, sfx), \ | 31 | PORT_32(fn, pfx##_4_, sfx), \ |
37 | CPU_32_PORT5(fn, pfx##_5_, sfx) | 32 | CPU_32_PORT5(fn, pfx##_5_, sfx) |
38 | 33 | ||
39 | #define _GP_GPIO(pfx, sfx) PINMUX_GPIO(GPIO_GP##pfx, GP##pfx##_DATA) | 34 | #define _GP_GPIO(pfx, sfx) PINMUX_GPIO(GPIO_GP##pfx, GP##pfx##_DATA) |
@@ -47,20 +42,8 @@ | |||
47 | #define PINMUX_GPIO_GP_ALL() CPU_ALL_PORT(_GP_GPIO, , unused) | 42 | #define PINMUX_GPIO_GP_ALL() CPU_ALL_PORT(_GP_GPIO, , unused) |
48 | #define PINMUX_DATA_GP_ALL() CPU_ALL_PORT(_GP_DATA, , unused) | 43 | #define PINMUX_DATA_GP_ALL() CPU_ALL_PORT(_GP_DATA, , unused) |
49 | 44 | ||
50 | #define PORT_10_REV(fn, pfx, sfx) \ | 45 | #define GP_INOUTSEL(bank) PORT_32_REV(_GP_INOUTSEL, _##bank##_, unused) |
51 | PORT_1(fn, pfx##9, sfx), PORT_1(fn, pfx##8, sfx), \ | 46 | #define GP_INDT(bank) PORT_32_REV(_GP_INDT, _##bank##_, unused) |
52 | PORT_1(fn, pfx##7, sfx), PORT_1(fn, pfx##6, sfx), \ | ||
53 | PORT_1(fn, pfx##5, sfx), PORT_1(fn, pfx##4, sfx), \ | ||
54 | PORT_1(fn, pfx##3, sfx), PORT_1(fn, pfx##2, sfx), \ | ||
55 | PORT_1(fn, pfx##1, sfx), PORT_1(fn, pfx##0, sfx) | ||
56 | |||
57 | #define CPU_32_PORT_REV(fn, pfx, sfx) \ | ||
58 | PORT_1(fn, pfx##31, sfx), PORT_1(fn, pfx##30, sfx), \ | ||
59 | PORT_10_REV(fn, pfx##2, sfx), PORT_10_REV(fn, pfx##1, sfx), \ | ||
60 | PORT_10_REV(fn, pfx, sfx) | ||
61 | |||
62 | #define GP_INOUTSEL(bank) CPU_32_PORT_REV(_GP_INOUTSEL, _##bank##_, unused) | ||
63 | #define GP_INDT(bank) CPU_32_PORT_REV(_GP_INDT, _##bank##_, unused) | ||
64 | 47 | ||
65 | #define PINMUX_IPSR_DATA(ipsr, fn) PINMUX_DATA(fn##_MARK, FN_##ipsr, FN_##fn) | 48 | #define PINMUX_IPSR_DATA(ipsr, fn) PINMUX_DATA(fn##_MARK, FN_##ipsr, FN_##fn) |
66 | #define PINMUX_IPSR_MODSEL_DATA(ipsr, fn, ms) PINMUX_DATA(fn##_MARK, FN_##ms, \ | 49 | #define PINMUX_IPSR_MODSEL_DATA(ipsr, fn, ms) PINMUX_DATA(fn##_MARK, FN_##ms, \ |