Skip to content

Commit 03a1ee1

Browse files
osctobebebarino
authored andcommitted
clk: at91: allow setting all PMC clock parents via DT
We need to have clocks accessible via phandle to select them as peripheral clock parent using assigned-clock-parents in DT. Add support for PLLACK/PLLBCK/AUDIOPLLCK clocks where available. Signed-off-by: Michał Mirosław <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Link: https://lkml.kernel.org/r/fa39cc10dab8341ea4bc2b7152be9217b2cd34a5.1588630999.git.mirq-linux@rere.qmqm.pl Signed-off-by: Stephen Boyd <[email protected]>
1 parent 99767cd commit 03a1ee1

File tree

11 files changed

+41
-10
lines changed

11 files changed

+41
-10
lines changed

drivers/clk/at91/at91rm9200.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
9898
if (IS_ERR(regmap))
9999
return;
100100

101-
at91rm9200_pmc = pmc_data_allocate(PMC_MAIN + 1,
101+
at91rm9200_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
102102
nck(at91rm9200_systemck),
103103
nck(at91rm9200_periphck), 0, 4);
104104
if (!at91rm9200_pmc)
@@ -123,12 +123,16 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
123123
if (IS_ERR(hw))
124124
goto err_free;
125125

126+
at91rm9200_pmc->chws[PMC_PLLACK] = hw;
127+
126128
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
127129
&at91rm9200_pll_layout,
128130
&rm9200_pll_characteristics);
129131
if (IS_ERR(hw))
130132
goto err_free;
131133

134+
at91rm9200_pmc->chws[PMC_PLLBCK] = hw;
135+
132136
parent_names[0] = slowxtal_name;
133137
parent_names[1] = "mainck";
134138
parent_names[2] = "pllack";

drivers/clk/at91/at91sam9260.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
352352
if (IS_ERR(regmap))
353353
return;
354354

355-
at91sam9260_pmc = pmc_data_allocate(PMC_MAIN + 1,
355+
at91sam9260_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
356356
ndck(data->sck, data->num_sck),
357357
ndck(data->pck, data->num_pck),
358358
0, data->num_progck);
@@ -399,12 +399,16 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
399399
if (IS_ERR(hw))
400400
goto err_free;
401401

402+
at91sam9260_pmc->chws[PMC_PLLACK] = hw;
403+
402404
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
403405
data->pllb_layout,
404406
data->pllb_characteristics);
405407
if (IS_ERR(hw))
406408
goto err_free;
407409

410+
at91sam9260_pmc->chws[PMC_PLLBCK] = hw;
411+
408412
parent_names[0] = slck_name;
409413
parent_names[1] = "mainck";
410414
parent_names[2] = "pllack";

drivers/clk/at91/at91sam9g45.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
115115
if (IS_ERR(regmap))
116116
return;
117117

118-
at91sam9g45_pmc = pmc_data_allocate(PMC_MAIN + 1,
118+
at91sam9g45_pmc = pmc_data_allocate(PMC_PLLACK + 1,
119119
nck(at91sam9g45_systemck),
120120
nck(at91sam9g45_periphck), 0, 2);
121121
if (!at91sam9g45_pmc)
@@ -143,6 +143,8 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
143143
if (IS_ERR(hw))
144144
goto err_free;
145145

146+
at91sam9g45_pmc->chws[PMC_PLLACK] = hw;
147+
146148
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
147149
if (IS_ERR(hw))
148150
goto err_free;

drivers/clk/at91/at91sam9n12.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
128128
if (IS_ERR(regmap))
129129
return;
130130

131-
at91sam9n12_pmc = pmc_data_allocate(PMC_MAIN + 1,
131+
at91sam9n12_pmc = pmc_data_allocate(PMC_PLLBCK + 1,
132132
nck(at91sam9n12_systemck), 31, 0, 2);
133133
if (!at91sam9n12_pmc)
134134
return;
@@ -162,11 +162,15 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
162162
if (IS_ERR(hw))
163163
goto err_free;
164164

165+
at91sam9n12_pmc->chws[PMC_PLLACK] = hw;
166+
165167
hw = at91_clk_register_pll(regmap, "pllbck", "mainck", 1,
166168
&at91rm9200_pll_layout, &pllb_characteristics);
167169
if (IS_ERR(hw))
168170
goto err_free;
169171

172+
at91sam9n12_pmc->chws[PMC_PLLBCK] = hw;
173+
170174
parent_names[0] = slck_name;
171175
parent_names[1] = "mainck";
172176
parent_names[2] = "plladivck";

drivers/clk/at91/at91sam9rl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
8787
if (IS_ERR(regmap))
8888
return;
8989

90-
at91sam9rl_pmc = pmc_data_allocate(PMC_MAIN + 1,
90+
at91sam9rl_pmc = pmc_data_allocate(PMC_PLLACK + 1,
9191
nck(at91sam9rl_systemck),
9292
nck(at91sam9rl_periphck), 0, 2);
9393
if (!at91sam9rl_pmc)
@@ -105,6 +105,8 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
105105
if (IS_ERR(hw))
106106
goto err_free;
107107

108+
at91sam9rl_pmc->chws[PMC_PLLACK] = hw;
109+
108110
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
109111
if (IS_ERR(hw))
110112
goto err_free;

drivers/clk/at91/at91sam9x5.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
150150
if (IS_ERR(regmap))
151151
return;
152152

153-
at91sam9x5_pmc = pmc_data_allocate(PMC_MAIN + 1,
153+
at91sam9x5_pmc = pmc_data_allocate(PMC_PLLACK + 1,
154154
nck(at91sam9x5_systemck), 31, 0, 2);
155155
if (!at91sam9x5_pmc)
156156
return;
@@ -184,6 +184,8 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
184184
if (IS_ERR(hw))
185185
goto err_free;
186186

187+
at91sam9x5_pmc->chws[PMC_PLLACK] = hw;
188+
187189
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
188190
if (IS_ERR(hw))
189191
goto err_free;

drivers/clk/at91/sam9x60.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
182182
if (IS_ERR(regmap))
183183
return;
184184

185-
sam9x60_pmc = pmc_data_allocate(PMC_MAIN + 1,
185+
sam9x60_pmc = pmc_data_allocate(PMC_PLLACK + 1,
186186
nck(sam9x60_systemck),
187187
nck(sam9x60_periphck),
188188
nck(sam9x60_gck), 8);
@@ -214,6 +214,8 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
214214
if (IS_ERR(hw))
215215
goto err_free;
216216

217+
sam9x60_pmc->chws[PMC_PLLACK] = hw;
218+
217219
hw = sam9x60_clk_register_pll(regmap, &pmc_pll_lock, "upllck",
218220
"main_osc", 1, &upll_characteristics);
219221
if (IS_ERR(hw))

drivers/clk/at91/sama5d2.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
167167
if (IS_ERR(regmap))
168168
return;
169169

170-
sama5d2_pmc = pmc_data_allocate(PMC_I2S1_MUX + 1,
170+
sama5d2_pmc = pmc_data_allocate(PMC_AUDIOPLLCK + 1,
171171
nck(sama5d2_systemck),
172172
nck(sama5d2_periph32ck),
173173
nck(sama5d2_gck), 3);
@@ -203,6 +203,8 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
203203
if (IS_ERR(hw))
204204
goto err_free;
205205

206+
sama5d2_pmc->chws[PMC_PLLACK] = hw;
207+
206208
hw = at91_clk_register_audio_pll_frac(regmap, "audiopll_fracck",
207209
"mainck");
208210
if (IS_ERR(hw))
@@ -218,6 +220,8 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
218220
if (IS_ERR(hw))
219221
goto err_free;
220222

223+
sama5d2_pmc->chws[PMC_AUDIOPLLCK] = hw;
224+
221225
regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr");
222226
if (IS_ERR(regmap_sfr))
223227
regmap_sfr = NULL;

drivers/clk/at91/sama5d3.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
125125
if (IS_ERR(regmap))
126126
return;
127127

128-
sama5d3_pmc = pmc_data_allocate(PMC_MAIN + 1,
128+
sama5d3_pmc = pmc_data_allocate(PMC_PLLACK + 1,
129129
nck(sama5d3_systemck),
130130
nck(sama5d3_periphck), 0, 3);
131131
if (!sama5d3_pmc)
@@ -158,6 +158,8 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
158158
if (IS_ERR(hw))
159159
goto err_free;
160160

161+
sama5d3_pmc->chws[PMC_PLLACK] = hw;
162+
161163
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
162164
if (IS_ERR(hw))
163165
goto err_free;

drivers/clk/at91/sama5d4.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
140140
if (IS_ERR(regmap))
141141
return;
142142

143-
sama5d4_pmc = pmc_data_allocate(PMC_MCK2 + 1,
143+
sama5d4_pmc = pmc_data_allocate(PMC_PLLACK + 1,
144144
nck(sama5d4_systemck),
145145
nck(sama5d4_periph32ck), 0, 3);
146146
if (!sama5d4_pmc)
@@ -173,6 +173,8 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
173173
if (IS_ERR(hw))
174174
goto err_free;
175175

176+
sama5d4_pmc->chws[PMC_PLLACK] = hw;
177+
176178
hw = at91_clk_register_utmi(regmap, NULL, "utmick", "mainck");
177179
if (IS_ERR(hw))
178180
goto err_free;

0 commit comments

Comments
 (0)