diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-11-10 21:45:33 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-11-11 02:45:33 -0500 |
commit | 972c3fb69cd1cd8d549b8a06ce42611eab405c20 (patch) | |
tree | 958d994516ba847b88f747524a127190d2b9784d /arch/arm/mach-shmobile/pfc-sh73a0.c | |
parent | bd8d0cbaa00883c84741b98264f8318cdade9c71 (diff) |
ARM: mach-shmobile: move helper macro PORT_xx to sh_pfc.h
This patch moves PORT_xx helper macro to sh_pfc.h,
and it expects CPU_ALL_PORT() macro for each CPU
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/pfc-sh73a0.c')
-rw-r--r-- | arch/arm/mach-shmobile/pfc-sh73a0.c | 108 |
1 files changed, 46 insertions, 62 deletions
diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c index f860caa96671..a1ea11956b15 100644 --- a/arch/arm/mach-shmobile/pfc-sh73a0.c +++ b/arch/arm/mach-shmobile/pfc-sh73a0.c | |||
@@ -24,83 +24,71 @@ | |||
24 | #include <mach/sh73a0.h> | 24 | #include <mach/sh73a0.h> |
25 | #include <mach/irqs.h> | 25 | #include <mach/irqs.h> |
26 | 26 | ||
27 | #define _1(fn, pfx, sfx) fn(pfx, sfx) | 27 | #define CPU_ALL_PORT(fn, pfx, sfx) \ |
28 | 28 | PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \ | |
29 | #define _10(fn, pfx, sfx) \ | 29 | PORT_10(fn, pfx##2, sfx), PORT_10(fn, pfx##3, sfx), \ |
30 | _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \ | 30 | PORT_10(fn, pfx##4, sfx), PORT_10(fn, pfx##5, sfx), \ |
31 | _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \ | 31 | PORT_10(fn, pfx##6, sfx), PORT_10(fn, pfx##7, sfx), \ |
32 | _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \ | 32 | PORT_10(fn, pfx##8, sfx), PORT_10(fn, pfx##9, sfx), \ |
33 | _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \ | 33 | PORT_10(fn, pfx##10, sfx), \ |
34 | _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx) | 34 | PORT_1(fn, pfx##110, sfx), PORT_1(fn, pfx##111, sfx), \ |
35 | 35 | PORT_1(fn, pfx##112, sfx), PORT_1(fn, pfx##113, sfx), \ | |
36 | #define _310(fn, pfx, sfx) \ | 36 | PORT_1(fn, pfx##114, sfx), PORT_1(fn, pfx##115, sfx), \ |
37 | _10(fn, pfx, sfx), _10(fn, pfx##1, sfx), \ | 37 | PORT_1(fn, pfx##116, sfx), PORT_1(fn, pfx##117, sfx), \ |
38 | _10(fn, pfx##2, sfx), _10(fn, pfx##3, sfx), \ | 38 | PORT_1(fn, pfx##118, sfx), \ |
39 | _10(fn, pfx##4, sfx), _10(fn, pfx##5, sfx), \ | 39 | PORT_1(fn, pfx##128, sfx), PORT_1(fn, pfx##129, sfx), \ |
40 | _10(fn, pfx##6, sfx), _10(fn, pfx##7, sfx), \ | 40 | PORT_10(fn, pfx##13, sfx), PORT_10(fn, pfx##14, sfx), \ |
41 | _10(fn, pfx##8, sfx), _10(fn, pfx##9, sfx), \ | 41 | PORT_10(fn, pfx##15, sfx), \ |
42 | _10(fn, pfx##10, sfx), \ | 42 | PORT_1(fn, pfx##160, sfx), PORT_1(fn, pfx##161, sfx), \ |
43 | _1(fn, pfx##110, sfx), _1(fn, pfx##111, sfx), \ | 43 | PORT_1(fn, pfx##162, sfx), PORT_1(fn, pfx##163, sfx), \ |
44 | _1(fn, pfx##112, sfx), _1(fn, pfx##113, sfx), \ | 44 | PORT_1(fn, pfx##164, sfx), \ |
45 | _1(fn, pfx##114, sfx), _1(fn, pfx##115, sfx), \ | 45 | PORT_1(fn, pfx##192, sfx), PORT_1(fn, pfx##193, sfx), \ |
46 | _1(fn, pfx##116, sfx), _1(fn, pfx##117, sfx), \ | 46 | PORT_1(fn, pfx##194, sfx), PORT_1(fn, pfx##195, sfx), \ |
47 | _1(fn, pfx##118, sfx), \ | 47 | PORT_1(fn, pfx##196, sfx), PORT_1(fn, pfx##197, sfx), \ |
48 | _1(fn, pfx##128, sfx), _1(fn, pfx##129, sfx), \ | 48 | PORT_1(fn, pfx##198, sfx), PORT_1(fn, pfx##199, sfx), \ |
49 | _10(fn, pfx##13, sfx), _10(fn, pfx##14, sfx), \ | 49 | PORT_10(fn, pfx##20, sfx), PORT_10(fn, pfx##21, sfx), \ |
50 | _10(fn, pfx##15, sfx), \ | 50 | PORT_10(fn, pfx##22, sfx), PORT_10(fn, pfx##23, sfx), \ |
51 | _1(fn, pfx##160, sfx), _1(fn, pfx##161, sfx), \ | 51 | PORT_10(fn, pfx##24, sfx), PORT_10(fn, pfx##25, sfx), \ |
52 | _1(fn, pfx##162, sfx), _1(fn, pfx##163, sfx), \ | 52 | PORT_10(fn, pfx##26, sfx), PORT_10(fn, pfx##27, sfx), \ |
53 | _1(fn, pfx##164, sfx), \ | 53 | PORT_1(fn, pfx##280, sfx), PORT_1(fn, pfx##281, sfx), \ |
54 | _1(fn, pfx##192, sfx), _1(fn, pfx##193, sfx), \ | 54 | PORT_1(fn, pfx##282, sfx), \ |
55 | _1(fn, pfx##194, sfx), _1(fn, pfx##195, sfx), \ | 55 | PORT_1(fn, pfx##288, sfx), PORT_1(fn, pfx##289, sfx), \ |
56 | _1(fn, pfx##196, sfx), _1(fn, pfx##197, sfx), \ | 56 | PORT_10(fn, pfx##29, sfx), PORT_10(fn, pfx##30, sfx) |
57 | _1(fn, pfx##198, sfx), _1(fn, pfx##199, sfx), \ | ||
58 | _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \ | ||
59 | _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \ | ||
60 | _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \ | ||
61 | _10(fn, pfx##26, sfx), _10(fn, pfx##27, sfx), \ | ||
62 | _1(fn, pfx##280, sfx), _1(fn, pfx##281, sfx), \ | ||
63 | _1(fn, pfx##282, sfx), \ | ||
64 | _1(fn, pfx##288, sfx), _1(fn, pfx##289, sfx), \ | ||
65 | _10(fn, pfx##29, sfx), _10(fn, pfx##30, sfx) | ||
66 | |||
67 | #define _PORT(pfx, sfx) pfx##_##sfx | ||
68 | #define PORT_310(str) _310(_PORT, PORT, str) | ||
69 | 57 | ||
70 | enum { | 58 | enum { |
71 | PINMUX_RESERVED = 0, | 59 | PINMUX_RESERVED = 0, |
72 | 60 | ||
73 | PINMUX_DATA_BEGIN, | 61 | PINMUX_DATA_BEGIN, |
74 | PORT_310(DATA), /* PORT0_DATA -> PORT309_DATA */ | 62 | PORT_ALL(DATA), /* PORT0_DATA -> PORT309_DATA */ |
75 | PINMUX_DATA_END, | 63 | PINMUX_DATA_END, |
76 | 64 | ||
77 | PINMUX_INPUT_BEGIN, | 65 | PINMUX_INPUT_BEGIN, |
78 | PORT_310(IN), /* PORT0_IN -> PORT309_IN */ | 66 | PORT_ALL(IN), /* PORT0_IN -> PORT309_IN */ |
79 | PINMUX_INPUT_END, | 67 | PINMUX_INPUT_END, |
80 | 68 | ||
81 | PINMUX_INPUT_PULLUP_BEGIN, | 69 | PINMUX_INPUT_PULLUP_BEGIN, |
82 | PORT_310(IN_PU), /* PORT0_IN_PU -> PORT309_IN_PU */ | 70 | PORT_ALL(IN_PU), /* PORT0_IN_PU -> PORT309_IN_PU */ |
83 | PINMUX_INPUT_PULLUP_END, | 71 | PINMUX_INPUT_PULLUP_END, |
84 | 72 | ||
85 | PINMUX_INPUT_PULLDOWN_BEGIN, | 73 | PINMUX_INPUT_PULLDOWN_BEGIN, |
86 | PORT_310(IN_PD), /* PORT0_IN_PD -> PORT309_IN_PD */ | 74 | PORT_ALL(IN_PD), /* PORT0_IN_PD -> PORT309_IN_PD */ |
87 | PINMUX_INPUT_PULLDOWN_END, | 75 | PINMUX_INPUT_PULLDOWN_END, |
88 | 76 | ||
89 | PINMUX_OUTPUT_BEGIN, | 77 | PINMUX_OUTPUT_BEGIN, |
90 | PORT_310(OUT), /* PORT0_OUT -> PORT309_OUT */ | 78 | PORT_ALL(OUT), /* PORT0_OUT -> PORT309_OUT */ |
91 | PINMUX_OUTPUT_END, | 79 | PINMUX_OUTPUT_END, |
92 | 80 | ||
93 | PINMUX_FUNCTION_BEGIN, | 81 | PINMUX_FUNCTION_BEGIN, |
94 | PORT_310(FN_IN), /* PORT0_FN_IN -> PORT309_FN_IN */ | 82 | PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT309_FN_IN */ |
95 | PORT_310(FN_OUT), /* PORT0_FN_OUT -> PORT309_FN_OUT */ | 83 | PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT309_FN_OUT */ |
96 | PORT_310(FN0), /* PORT0_FN0 -> PORT309_FN0 */ | 84 | PORT_ALL(FN0), /* PORT0_FN0 -> PORT309_FN0 */ |
97 | PORT_310(FN1), /* PORT0_FN1 -> PORT309_FN1 */ | 85 | PORT_ALL(FN1), /* PORT0_FN1 -> PORT309_FN1 */ |
98 | PORT_310(FN2), /* PORT0_FN2 -> PORT309_FN2 */ | 86 | PORT_ALL(FN2), /* PORT0_FN2 -> PORT309_FN2 */ |
99 | PORT_310(FN3), /* PORT0_FN3 -> PORT309_FN3 */ | 87 | PORT_ALL(FN3), /* PORT0_FN3 -> PORT309_FN3 */ |
100 | PORT_310(FN4), /* PORT0_FN4 -> PORT309_FN4 */ | 88 | PORT_ALL(FN4), /* PORT0_FN4 -> PORT309_FN4 */ |
101 | PORT_310(FN5), /* PORT0_FN5 -> PORT309_FN5 */ | 89 | PORT_ALL(FN5), /* PORT0_FN5 -> PORT309_FN5 */ |
102 | PORT_310(FN6), /* PORT0_FN6 -> PORT309_FN6 */ | 90 | PORT_ALL(FN6), /* PORT0_FN6 -> PORT309_FN6 */ |
103 | PORT_310(FN7), /* PORT0_FN7 -> PORT309_FN7 */ | 91 | PORT_ALL(FN7), /* PORT0_FN7 -> PORT309_FN7 */ |
104 | 92 | ||
105 | MSEL2CR_MSEL19_0, MSEL2CR_MSEL19_1, | 93 | MSEL2CR_MSEL19_0, MSEL2CR_MSEL19_1, |
106 | MSEL2CR_MSEL18_0, MSEL2CR_MSEL18_1, | 94 | MSEL2CR_MSEL18_0, MSEL2CR_MSEL18_1, |
@@ -1555,12 +1543,8 @@ static pinmux_enum_t pinmux_data[] = { | |||
1555 | PINMUX_DATA(FSIAISLD_PU_MARK, PORT55_FN1, PORT55_IN_PU), | 1543 | PINMUX_DATA(FSIAISLD_PU_MARK, PORT55_FN1, PORT55_IN_PU), |
1556 | }; | 1544 | }; |
1557 | 1545 | ||
1558 | #define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA) | ||
1559 | #define GPIO_PORT_310() _310(_GPIO_PORT, , unused) | ||
1560 | #define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK) | ||
1561 | |||
1562 | static struct pinmux_gpio pinmux_gpios[] = { | 1546 | static struct pinmux_gpio pinmux_gpios[] = { |
1563 | GPIO_PORT_310(), | 1547 | GPIO_PORT_ALL(), |
1564 | 1548 | ||
1565 | /* Table 25-1 (Functions 0-7) */ | 1549 | /* Table 25-1 (Functions 0-7) */ |
1566 | GPIO_FN(VBUS_0), | 1550 | GPIO_FN(VBUS_0), |