diff options
author | Magnus Damm <damm@opensource.se> | 2010-05-11 01:00:14 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-13 04:32:47 -0400 |
commit | 5b10a27e9f0aa7282e3b8fd470e71201d6f5764c (patch) | |
tree | 3b4822de9545f134dbb2d183db13259ec8179cde | |
parent | b87cecef4ce4250c9bc44af04e60d71000d44581 (diff) |
sh: sh7785 mstp32 index rework
This patch adds sh7785 MSTP enums for mstp_clks[] index.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c index 28de049a59b1..cc34ec352996 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c | |||
@@ -87,31 +87,37 @@ struct clk div4_clks[DIV4_NR] = { | |||
87 | #define MSTPCR0 0xffc80030 | 87 | #define MSTPCR0 0xffc80030 |
88 | #define MSTPCR1 0xffc80034 | 88 | #define MSTPCR1 0xffc80034 |
89 | 89 | ||
90 | static struct clk mstp_clks[] = { | 90 | enum { MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, |
91 | MSTP021, MSTP020, MSTP017, MSTP016, | ||
92 | MSTP013, MSTP012, MSTP009, MSTP008, MSTP003, MSTP002, | ||
93 | MSTP119, MSTP117, MSTP105, MSTP104, MSTP100, | ||
94 | MSTP_NR }; | ||
95 | |||
96 | static struct clk mstp_clks[MSTP_NR] = { | ||
91 | /* MSTPCR0 */ | 97 | /* MSTPCR0 */ |
92 | SH_CLK_MSTP32("sci_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0), | 98 | [MSTP029] = SH_CLK_MSTP32("sci_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0), |
93 | SH_CLK_MSTP32("sci_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0), | 99 | [MSTP028] = SH_CLK_MSTP32("sci_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0), |
94 | SH_CLK_MSTP32("sci_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0), | 100 | [MSTP027] = SH_CLK_MSTP32("sci_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0), |
95 | SH_CLK_MSTP32("sci_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0), | 101 | [MSTP026] = SH_CLK_MSTP32("sci_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0), |
96 | SH_CLK_MSTP32("sci_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0), | 102 | [MSTP025] = SH_CLK_MSTP32("sci_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0), |
97 | SH_CLK_MSTP32("sci_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0), | 103 | [MSTP024] = SH_CLK_MSTP32("sci_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0), |
98 | SH_CLK_MSTP32("ssi_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 21, 0), | 104 | [MSTP021] = SH_CLK_MSTP32("ssi_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 21, 0), |
99 | SH_CLK_MSTP32("ssi_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 20, 0), | 105 | [MSTP020] = SH_CLK_MSTP32("ssi_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 20, 0), |
100 | SH_CLK_MSTP32("hac_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 17, 0), | 106 | [MSTP017] = SH_CLK_MSTP32("hac_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 17, 0), |
101 | SH_CLK_MSTP32("hac_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 16, 0), | 107 | [MSTP016] = SH_CLK_MSTP32("hac_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 16, 0), |
102 | SH_CLK_MSTP32("mmcif_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 13, 0), | 108 | [MSTP013] = SH_CLK_MSTP32("mmcif_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 13, 0), |
103 | SH_CLK_MSTP32("flctl_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 12, 0), | 109 | [MSTP012] = SH_CLK_MSTP32("flctl_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 12, 0), |
104 | SH_CLK_MSTP32("tmu345_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 9, 0), | 110 | [MSTP009] = SH_CLK_MSTP32("tmu345_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 9, 0), |
105 | SH_CLK_MSTP32("tmu012_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 8, 0), | 111 | [MSTP008] = SH_CLK_MSTP32("tmu012_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 8, 0), |
106 | SH_CLK_MSTP32("siof_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 3, 0), | 112 | [MSTP003] = SH_CLK_MSTP32("siof_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 3, 0), |
107 | SH_CLK_MSTP32("hspi_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 2, 0), | 113 | [MSTP002] = SH_CLK_MSTP32("hspi_fck", -1, &div4_clks[DIV4_P], MSTPCR0, 2, 0), |
108 | 114 | ||
109 | /* MSTPCR1 */ | 115 | /* MSTPCR1 */ |
110 | SH_CLK_MSTP32("hudi_fck", -1, NULL, MSTPCR1, 19, 0), | 116 | [MSTP119] = SH_CLK_MSTP32("hudi_fck", -1, NULL, MSTPCR1, 19, 0), |
111 | SH_CLK_MSTP32("ubc_fck", -1, NULL, MSTPCR1, 17, 0), | 117 | [MSTP117] = SH_CLK_MSTP32("ubc_fck", -1, NULL, MSTPCR1, 17, 0), |
112 | SH_CLK_MSTP32("dmac_11_6_fck", -1, NULL, MSTPCR1, 5, 0), | 118 | [MSTP105] = SH_CLK_MSTP32("dmac_11_6_fck", -1, NULL, MSTPCR1, 5, 0), |
113 | SH_CLK_MSTP32("dmac_5_0_fck", -1, NULL, MSTPCR1, 4, 0), | 119 | [MSTP104] = SH_CLK_MSTP32("dmac_5_0_fck", -1, NULL, MSTPCR1, 4, 0), |
114 | SH_CLK_MSTP32("gdta_fck", -1, NULL, MSTPCR1, 0, 0), | 120 | [MSTP100] = SH_CLK_MSTP32("gdta_fck", -1, NULL, MSTPCR1, 0, 0), |
115 | }; | 121 | }; |
116 | 122 | ||
117 | static struct clk_lookup lookups[] = { | 123 | static struct clk_lookup lookups[] = { |
@@ -119,32 +125,32 @@ static struct clk_lookup lookups[] = { | |||
119 | /* TMU0 */ | 125 | /* TMU0 */ |
120 | .dev_id = "sh_tmu.0", | 126 | .dev_id = "sh_tmu.0", |
121 | .con_id = "tmu_fck", | 127 | .con_id = "tmu_fck", |
122 | .clk = &mstp_clks[13], /* tmu012_fck */ | 128 | .clk = &mstp_clks[MSTP008], |
123 | }, { | 129 | }, { |
124 | /* TMU1 */ | 130 | /* TMU1 */ |
125 | .dev_id = "sh_tmu.1", | 131 | .dev_id = "sh_tmu.1", |
126 | .con_id = "tmu_fck", | 132 | .con_id = "tmu_fck", |
127 | .clk = &mstp_clks[13], | 133 | .clk = &mstp_clks[MSTP008], |
128 | }, { | 134 | }, { |
129 | /* TMU2 */ | 135 | /* TMU2 */ |
130 | .dev_id = "sh_tmu.2", | 136 | .dev_id = "sh_tmu.2", |
131 | .con_id = "tmu_fck", | 137 | .con_id = "tmu_fck", |
132 | .clk = &mstp_clks[13], | 138 | .clk = &mstp_clks[MSTP008], |
133 | }, { | 139 | }, { |
134 | /* TMU3 */ | 140 | /* TMU3 */ |
135 | .dev_id = "sh_tmu.3", | 141 | .dev_id = "sh_tmu.3", |
136 | .con_id = "tmu_fck", | 142 | .con_id = "tmu_fck", |
137 | .clk = &mstp_clks[12], /* tmu345_fck */ | 143 | .clk = &mstp_clks[MSTP009], |
138 | }, { | 144 | }, { |
139 | /* TMU4 */ | 145 | /* TMU4 */ |
140 | .dev_id = "sh_tmu.4", | 146 | .dev_id = "sh_tmu.4", |
141 | .con_id = "tmu_fck", | 147 | .con_id = "tmu_fck", |
142 | .clk = &mstp_clks[12], | 148 | .clk = &mstp_clks[MSTP009], |
143 | }, { | 149 | }, { |
144 | /* TMU5 */ | 150 | /* TMU5 */ |
145 | .dev_id = "sh_tmu.5", | 151 | .dev_id = "sh_tmu.5", |
146 | .con_id = "tmu_fck", | 152 | .con_id = "tmu_fck", |
147 | .clk = &mstp_clks[12], | 153 | .clk = &mstp_clks[MSTP009], |
148 | }, | 154 | }, |
149 | }; | 155 | }; |
150 | 156 | ||
@@ -161,7 +167,7 @@ int __init arch_clk_init(void) | |||
161 | ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), | 167 | ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), |
162 | &div4_table); | 168 | &div4_table); |
163 | if (!ret) | 169 | if (!ret) |
164 | ret = sh_clk_mstp32_register(mstp_clks, ARRAY_SIZE(mstp_clks)); | 170 | ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); |
165 | 171 | ||
166 | return ret; | 172 | return ret; |
167 | } | 173 | } |