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-sh7367.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-sh7367.c')
-rw-r--r-- | arch/arm/mach-shmobile/pfc-sh7367.c | 71 |
1 files changed, 24 insertions, 47 deletions
diff --git a/arch/arm/mach-shmobile/pfc-sh7367.c b/arch/arm/mach-shmobile/pfc-sh7367.c index 25181166e2d..32fbf0206b3 100644 --- a/arch/arm/mach-shmobile/pfc-sh7367.c +++ b/arch/arm/mach-shmobile/pfc-sh7367.c | |||
@@ -21,68 +21,49 @@ | |||
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <mach/sh7367.h> | 22 | #include <mach/sh7367.h> |
23 | 23 | ||
24 | #define _1(fn, pfx, sfx) fn(pfx, sfx) | 24 | #define CPU_ALL_PORT(fn, pfx, sfx) \ |
25 | 25 | PORT_10(fn, pfx, sfx), PORT_90(fn, pfx, sfx), \ | |
26 | #define _10(fn, pfx, sfx) \ | 26 | PORT_10(fn, pfx##10, sfx), PORT_90(fn, pfx##1, sfx), \ |
27 | _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \ | 27 | PORT_10(fn, pfx##20, sfx), PORT_10(fn, pfx##21, sfx), \ |
28 | _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \ | 28 | PORT_10(fn, pfx##22, sfx), PORT_10(fn, pfx##23, sfx), \ |
29 | _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \ | 29 | PORT_10(fn, pfx##24, sfx), PORT_10(fn, pfx##25, sfx), \ |
30 | _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \ | 30 | PORT_10(fn, pfx##26, sfx), PORT_1(fn, pfx##270, sfx), \ |
31 | _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx) | 31 | PORT_1(fn, pfx##271, sfx), PORT_1(fn, pfx##272, sfx) |
32 | |||
33 | #define _90(fn, pfx, sfx) \ | ||
34 | _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \ | ||
35 | _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \ | ||
36 | _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \ | ||
37 | _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx), \ | ||
38 | _10(fn, pfx##9, sfx) | ||
39 | |||
40 | #define _273(fn, pfx, sfx) \ | ||
41 | _10(fn, pfx, sfx), _90(fn, pfx, sfx), \ | ||
42 | _10(fn, pfx##10, sfx), _90(fn, pfx##1, sfx), \ | ||
43 | _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \ | ||
44 | _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \ | ||
45 | _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \ | ||
46 | _10(fn, pfx##26, sfx), _1(fn, pfx##270, sfx), \ | ||
47 | _1(fn, pfx##271, sfx), _1(fn, pfx##272, sfx) | ||
48 | |||
49 | #define _PORT(pfx, sfx) pfx##_##sfx | ||
50 | #define PORT_273(str) _273(_PORT, PORT, str) | ||
51 | 32 | ||
52 | enum { | 33 | enum { |
53 | PINMUX_RESERVED = 0, | 34 | PINMUX_RESERVED = 0, |
54 | 35 | ||
55 | PINMUX_DATA_BEGIN, | 36 | PINMUX_DATA_BEGIN, |
56 | PORT_273(DATA), /* PORT0_DATA -> PORT272_DATA */ | 37 | PORT_ALL(DATA), /* PORT0_DATA -> PORT272_DATA */ |
57 | PINMUX_DATA_END, | 38 | PINMUX_DATA_END, |
58 | 39 | ||
59 | PINMUX_INPUT_BEGIN, | 40 | PINMUX_INPUT_BEGIN, |
60 | PORT_273(IN), /* PORT0_IN -> PORT272_IN */ | 41 | PORT_ALL(IN), /* PORT0_IN -> PORT272_IN */ |
61 | PINMUX_INPUT_END, | 42 | PINMUX_INPUT_END, |
62 | 43 | ||
63 | PINMUX_INPUT_PULLUP_BEGIN, | 44 | PINMUX_INPUT_PULLUP_BEGIN, |
64 | PORT_273(IN_PU), /* PORT0_IN_PU -> PORT272_IN_PU */ | 45 | PORT_ALL(IN_PU), /* PORT0_IN_PU -> PORT272_IN_PU */ |
65 | PINMUX_INPUT_PULLUP_END, | 46 | PINMUX_INPUT_PULLUP_END, |
66 | 47 | ||
67 | PINMUX_INPUT_PULLDOWN_BEGIN, | 48 | PINMUX_INPUT_PULLDOWN_BEGIN, |
68 | PORT_273(IN_PD), /* PORT0_IN_PD -> PORT272_IN_PD */ | 49 | PORT_ALL(IN_PD), /* PORT0_IN_PD -> PORT272_IN_PD */ |
69 | PINMUX_INPUT_PULLDOWN_END, | 50 | PINMUX_INPUT_PULLDOWN_END, |
70 | 51 | ||
71 | PINMUX_OUTPUT_BEGIN, | 52 | PINMUX_OUTPUT_BEGIN, |
72 | PORT_273(OUT), /* PORT0_OUT -> PORT272_OUT */ | 53 | PORT_ALL(OUT), /* PORT0_OUT -> PORT272_OUT */ |
73 | PINMUX_OUTPUT_END, | 54 | PINMUX_OUTPUT_END, |
74 | 55 | ||
75 | PINMUX_FUNCTION_BEGIN, | 56 | PINMUX_FUNCTION_BEGIN, |
76 | PORT_273(FN_IN), /* PORT0_FN_IN -> PORT272_FN_IN */ | 57 | PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT272_FN_IN */ |
77 | PORT_273(FN_OUT), /* PORT0_FN_OUT -> PORT272_FN_OUT */ | 58 | PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT272_FN_OUT */ |
78 | PORT_273(FN0), /* PORT0_FN0 -> PORT272_FN0 */ | 59 | PORT_ALL(FN0), /* PORT0_FN0 -> PORT272_FN0 */ |
79 | PORT_273(FN1), /* PORT0_FN1 -> PORT272_FN1 */ | 60 | PORT_ALL(FN1), /* PORT0_FN1 -> PORT272_FN1 */ |
80 | PORT_273(FN2), /* PORT0_FN2 -> PORT272_FN2 */ | 61 | PORT_ALL(FN2), /* PORT0_FN2 -> PORT272_FN2 */ |
81 | PORT_273(FN3), /* PORT0_FN3 -> PORT272_FN3 */ | 62 | PORT_ALL(FN3), /* PORT0_FN3 -> PORT272_FN3 */ |
82 | PORT_273(FN4), /* PORT0_FN4 -> PORT272_FN4 */ | 63 | PORT_ALL(FN4), /* PORT0_FN4 -> PORT272_FN4 */ |
83 | PORT_273(FN5), /* PORT0_FN5 -> PORT272_FN5 */ | 64 | PORT_ALL(FN5), /* PORT0_FN5 -> PORT272_FN5 */ |
84 | PORT_273(FN6), /* PORT0_FN6 -> PORT272_FN6 */ | 65 | PORT_ALL(FN6), /* PORT0_FN6 -> PORT272_FN6 */ |
85 | PORT_273(FN7), /* PORT0_FN7 -> PORT272_FN7 */ | 66 | PORT_ALL(FN7), /* PORT0_FN7 -> PORT272_FN7 */ |
86 | 67 | ||
87 | MSELBCR_MSEL2_1, MSELBCR_MSEL2_0, | 68 | MSELBCR_MSEL2_1, MSELBCR_MSEL2_0, |
88 | PINMUX_FUNCTION_END, | 69 | PINMUX_FUNCTION_END, |
@@ -1063,13 +1044,9 @@ static pinmux_enum_t pinmux_data[] = { | |||
1063 | PINMUX_DATA(DIVLOCK_MARK, PORT272_FN1), | 1044 | PINMUX_DATA(DIVLOCK_MARK, PORT272_FN1), |
1064 | }; | 1045 | }; |
1065 | 1046 | ||
1066 | #define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA) | ||
1067 | #define GPIO_PORT_273() _273(_GPIO_PORT, , unused) | ||
1068 | #define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK) | ||
1069 | |||
1070 | static struct pinmux_gpio pinmux_gpios[] = { | 1047 | static struct pinmux_gpio pinmux_gpios[] = { |
1071 | /* 49-1 -> 49-6 (GPIO) */ | 1048 | /* 49-1 -> 49-6 (GPIO) */ |
1072 | GPIO_PORT_273(), | 1049 | GPIO_PORT_ALL(), |
1073 | 1050 | ||
1074 | /* Special Pull-up / Pull-down Functions */ | 1051 | /* Special Pull-up / Pull-down Functions */ |
1075 | GPIO_FN(PORT48_KEYIN0_PU), GPIO_FN(PORT49_KEYIN1_PU), | 1052 | GPIO_FN(PORT48_KEYIN0_PU), GPIO_FN(PORT49_KEYIN1_PU), |