1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
3 * Copyright (c) 2018 BayLibre, SAS.
4 * Author: Jerome Brunet <jbrunet@baylibre.com>
8 #include <linux/clk-provider.h>
9 #include <linux/init.h>
10 #include <linux/module.h>
12 #include <linux/platform_device.h>
13 #include <linux/regmap.h>
14 #include <linux/reset.h>
15 #include <linux/reset-controller.h>
16 #include <linux/slab.h>
18 #include <soc/amlogic/reset-meson-aux.h>
20 #include "meson-clkc-utils.h"
21 #include "axg-audio.h"
22 #include "clk-regmap.h"
23 #include "clk-phase.h"
26 #include <dt-bindings/clock/axg-audio-clkc.h>
28 #define AUD_GATE(_name, _reg, _bit, _pname, _iflags) { \
29 .data = &(struct clk_regmap_gate_data){ \
33 .hw.init = &(struct clk_init_data) { \
34 .name = "aud_"#_name, \
35 .ops = &clk_regmap_gate_ops, \
36 .parent_names = (const char *[]){ #_pname }, \
38 .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \
42 #define AUD_MUX(_name, _reg, _mask, _shift, _dflags, _pdata, _iflags) { \
43 .data = &(struct clk_regmap_mux_data){ \
49 .hw.init = &(struct clk_init_data){ \
50 .name = "aud_"#_name, \
51 .ops = &clk_regmap_mux_ops, \
52 .parent_data = _pdata, \
53 .num_parents = ARRAY_SIZE(_pdata), \
54 .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \
58 #define AUD_DIV(_name, _reg, _shift, _width, _dflags, _pname, _iflags) { \
59 .data = &(struct clk_regmap_div_data){ \
65 .hw.init = &(struct clk_init_data){ \
66 .name = "aud_"#_name, \
67 .ops = &clk_regmap_divider_ops, \
68 .parent_names = (const char *[]){ #_pname }, \
74 #define AUD_PCLK_GATE(_name, _reg, _bit) { \
75 .data = &(struct clk_regmap_gate_data){ \
79 .hw.init = &(struct clk_init_data) { \
80 .name = "aud_"#_name, \
81 .ops = &clk_regmap_gate_ops, \
82 .parent_names = (const char *[]){ "aud_top" }, \
87 #define AUD_SCLK_DIV(_name, _reg, _div_shift, _div_width, \
88 _hi_shift, _hi_width, _pname, _iflags) { \
89 .data = &(struct meson_sclk_div_data) { \
92 .shift = (_div_shift), \
93 .width = (_div_width), \
97 .shift = (_hi_shift), \
98 .width = (_hi_width), \
101 .hw.init = &(struct clk_init_data) { \
102 .name = "aud_"#_name, \
103 .ops = &meson_sclk_div_ops, \
104 .parent_names = (const char *[]){ #_pname }, \
106 .flags = (_iflags), \
110 #define AUD_TRIPHASE(_name, _reg, _width, _shift0, _shift1, _shift2, \
112 .data = &(struct meson_clk_triphase_data) { \
115 .shift = (_shift0), \
120 .shift = (_shift1), \
125 .shift = (_shift2), \
129 .hw.init = &(struct clk_init_data) { \
130 .name = "aud_"#_name, \
131 .ops = &meson_clk_triphase_ops, \
132 .parent_names = (const char *[]){ #_pname }, \
134 .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \
138 #define AUD_PHASE(_name, _reg, _width, _shift, _pname, _iflags) { \
139 .data = &(struct meson_clk_phase_data) { \
146 .hw.init = &(struct clk_init_data) { \
147 .name = "aud_"#_name, \
148 .ops = &meson_clk_phase_ops, \
149 .parent_names = (const char *[]){ #_pname }, \
151 .flags = (_iflags), \
155 #define AUD_SCLK_WS(_name, _reg, _width, _shift_ph, _shift_ws, _pname, \
157 .data = &(struct meson_sclk_ws_inv_data) { \
160 .shift = (_shift_ph), \
165 .shift = (_shift_ws), \
169 .hw.init = &(struct clk_init_data) { \
170 .name = "aud_"#_name, \
171 .ops = &meson_clk_phase_ops, \
172 .parent_names = (const char *[]){ #_pname }, \
174 .flags = (_iflags), \
178 /* Audio Master Clocks */
179 static const struct clk_parent_data mst_mux_parent_data
[] = {
180 { .fw_name
= "mst_in0", },
181 { .fw_name
= "mst_in1", },
182 { .fw_name
= "mst_in2", },
183 { .fw_name
= "mst_in3", },
184 { .fw_name
= "mst_in4", },
185 { .fw_name
= "mst_in5", },
186 { .fw_name
= "mst_in6", },
187 { .fw_name
= "mst_in7", },
190 #define AUD_MST_MUX(_name, _reg, _flag) \
191 AUD_MUX(_name##_sel, _reg, 0x7, 24, _flag, \
192 mst_mux_parent_data, 0)
193 #define AUD_MST_DIV(_name, _reg, _flag) \
194 AUD_DIV(_name##_div, _reg, 0, 16, _flag, \
195 aud_##_name##_sel, CLK_SET_RATE_PARENT)
196 #define AUD_MST_MCLK_GATE(_name, _reg) \
197 AUD_GATE(_name, _reg, 31, aud_##_name##_div, \
200 #define AUD_MST_MCLK_MUX(_name, _reg) \
201 AUD_MST_MUX(_name, _reg, CLK_MUX_ROUND_CLOSEST)
202 #define AUD_MST_MCLK_DIV(_name, _reg) \
203 AUD_MST_DIV(_name, _reg, CLK_DIVIDER_ROUND_CLOSEST)
205 #define AUD_MST_SYS_MUX(_name, _reg) \
206 AUD_MST_MUX(_name, _reg, 0)
207 #define AUD_MST_SYS_DIV(_name, _reg) \
208 AUD_MST_DIV(_name, _reg, 0)
211 #define AUD_MST_SCLK_PRE_EN(_name, _reg) \
212 AUD_GATE(mst_##_name##_sclk_pre_en, _reg, 31, \
213 aud_mst_##_name##_mclk, 0)
214 #define AUD_MST_SCLK_DIV(_name, _reg) \
215 AUD_SCLK_DIV(mst_##_name##_sclk_div, _reg, 20, 10, 0, 0, \
216 aud_mst_##_name##_sclk_pre_en, \
218 #define AUD_MST_SCLK_POST_EN(_name, _reg) \
219 AUD_GATE(mst_##_name##_sclk_post_en, _reg, 30, \
220 aud_mst_##_name##_sclk_div, CLK_SET_RATE_PARENT)
221 #define AUD_MST_SCLK(_name, _reg) \
222 AUD_TRIPHASE(mst_##_name##_sclk, _reg, 1, 0, 2, 4, \
223 aud_mst_##_name##_sclk_post_en, CLK_SET_RATE_PARENT)
225 #define AUD_MST_LRCLK_DIV(_name, _reg) \
226 AUD_SCLK_DIV(mst_##_name##_lrclk_div, _reg, 0, 10, 10, 10, \
227 aud_mst_##_name##_sclk_post_en, 0)
228 #define AUD_MST_LRCLK(_name, _reg) \
229 AUD_TRIPHASE(mst_##_name##_lrclk, _reg, 1, 1, 3, 5, \
230 aud_mst_##_name##_lrclk_div, CLK_SET_RATE_PARENT)
232 /* TDM bit clock sources */
233 static const struct clk_parent_data tdm_sclk_parent_data
[] = {
234 { .name
= "aud_mst_a_sclk", .index
= -1, },
235 { .name
= "aud_mst_b_sclk", .index
= -1, },
236 { .name
= "aud_mst_c_sclk", .index
= -1, },
237 { .name
= "aud_mst_d_sclk", .index
= -1, },
238 { .name
= "aud_mst_e_sclk", .index
= -1, },
239 { .name
= "aud_mst_f_sclk", .index
= -1, },
240 { .fw_name
= "slv_sclk0", },
241 { .fw_name
= "slv_sclk1", },
242 { .fw_name
= "slv_sclk2", },
243 { .fw_name
= "slv_sclk3", },
244 { .fw_name
= "slv_sclk4", },
245 { .fw_name
= "slv_sclk5", },
246 { .fw_name
= "slv_sclk6", },
247 { .fw_name
= "slv_sclk7", },
248 { .fw_name
= "slv_sclk8", },
249 { .fw_name
= "slv_sclk9", },
252 /* TDM sample clock sources */
253 static const struct clk_parent_data tdm_lrclk_parent_data
[] = {
254 { .name
= "aud_mst_a_lrclk", .index
= -1, },
255 { .name
= "aud_mst_b_lrclk", .index
= -1, },
256 { .name
= "aud_mst_c_lrclk", .index
= -1, },
257 { .name
= "aud_mst_d_lrclk", .index
= -1, },
258 { .name
= "aud_mst_e_lrclk", .index
= -1, },
259 { .name
= "aud_mst_f_lrclk", .index
= -1, },
260 { .fw_name
= "slv_lrclk0", },
261 { .fw_name
= "slv_lrclk1", },
262 { .fw_name
= "slv_lrclk2", },
263 { .fw_name
= "slv_lrclk3", },
264 { .fw_name
= "slv_lrclk4", },
265 { .fw_name
= "slv_lrclk5", },
266 { .fw_name
= "slv_lrclk6", },
267 { .fw_name
= "slv_lrclk7", },
268 { .fw_name
= "slv_lrclk8", },
269 { .fw_name
= "slv_lrclk9", },
272 #define AUD_TDM_SCLK_MUX(_name, _reg) \
273 AUD_MUX(tdm##_name##_sclk_sel, _reg, 0xf, 24, \
274 CLK_MUX_ROUND_CLOSEST, tdm_sclk_parent_data, 0)
275 #define AUD_TDM_SCLK_PRE_EN(_name, _reg) \
276 AUD_GATE(tdm##_name##_sclk_pre_en, _reg, 31, \
277 aud_tdm##_name##_sclk_sel, CLK_SET_RATE_PARENT)
278 #define AUD_TDM_SCLK_POST_EN(_name, _reg) \
279 AUD_GATE(tdm##_name##_sclk_post_en, _reg, 30, \
280 aud_tdm##_name##_sclk_pre_en, CLK_SET_RATE_PARENT)
281 #define AUD_TDM_SCLK(_name, _reg) \
282 AUD_PHASE(tdm##_name##_sclk, _reg, 1, 29, \
283 aud_tdm##_name##_sclk_post_en, \
284 CLK_DUTY_CYCLE_PARENT | CLK_SET_RATE_PARENT)
285 #define AUD_TDM_SCLK_WS(_name, _reg) \
286 AUD_SCLK_WS(tdm##_name##_sclk, _reg, 1, 29, 28, \
287 aud_tdm##_name##_sclk_post_en, \
288 CLK_DUTY_CYCLE_PARENT | CLK_SET_RATE_PARENT)
290 #define AUD_TDM_LRLCK(_name, _reg) \
291 AUD_MUX(tdm##_name##_lrclk, _reg, 0xf, 20, \
292 CLK_MUX_ROUND_CLOSEST, tdm_lrclk_parent_data, 0)
294 /* Pad master clock sources */
295 static const struct clk_parent_data mclk_pad_ctrl_parent_data
[] = {
296 { .name
= "aud_mst_a_mclk", .index
= -1, },
297 { .name
= "aud_mst_b_mclk", .index
= -1, },
298 { .name
= "aud_mst_c_mclk", .index
= -1, },
299 { .name
= "aud_mst_d_mclk", .index
= -1, },
300 { .name
= "aud_mst_e_mclk", .index
= -1, },
301 { .name
= "aud_mst_f_mclk", .index
= -1, },
304 /* Pad bit clock sources */
305 static const struct clk_parent_data sclk_pad_ctrl_parent_data
[] = {
306 { .name
= "aud_mst_a_sclk", .index
= -1, },
307 { .name
= "aud_mst_b_sclk", .index
= -1, },
308 { .name
= "aud_mst_c_sclk", .index
= -1, },
309 { .name
= "aud_mst_d_sclk", .index
= -1, },
310 { .name
= "aud_mst_e_sclk", .index
= -1, },
311 { .name
= "aud_mst_f_sclk", .index
= -1, },
314 /* Pad sample clock sources */
315 static const struct clk_parent_data lrclk_pad_ctrl_parent_data
[] = {
316 { .name
= "aud_mst_a_lrclk", .index
= -1, },
317 { .name
= "aud_mst_b_lrclk", .index
= -1, },
318 { .name
= "aud_mst_c_lrclk", .index
= -1, },
319 { .name
= "aud_mst_d_lrclk", .index
= -1, },
320 { .name
= "aud_mst_e_lrclk", .index
= -1, },
321 { .name
= "aud_mst_f_lrclk", .index
= -1, },
324 #define AUD_TDM_PAD_CTRL(_name, _reg, _shift, _parents) \
325 AUD_MUX(_name, _reg, 0x7, _shift, 0, _parents, \
326 CLK_SET_RATE_NO_REPARENT)
329 static struct clk_regmap ddr_arb
=
330 AUD_PCLK_GATE(ddr_arb
, AUDIO_CLK_GATE_EN
, 0);
331 static struct clk_regmap pdm
=
332 AUD_PCLK_GATE(pdm
, AUDIO_CLK_GATE_EN
, 1);
333 static struct clk_regmap tdmin_a
=
334 AUD_PCLK_GATE(tdmin_a
, AUDIO_CLK_GATE_EN
, 2);
335 static struct clk_regmap tdmin_b
=
336 AUD_PCLK_GATE(tdmin_b
, AUDIO_CLK_GATE_EN
, 3);
337 static struct clk_regmap tdmin_c
=
338 AUD_PCLK_GATE(tdmin_c
, AUDIO_CLK_GATE_EN
, 4);
339 static struct clk_regmap tdmin_lb
=
340 AUD_PCLK_GATE(tdmin_lb
, AUDIO_CLK_GATE_EN
, 5);
341 static struct clk_regmap tdmout_a
=
342 AUD_PCLK_GATE(tdmout_a
, AUDIO_CLK_GATE_EN
, 6);
343 static struct clk_regmap tdmout_b
=
344 AUD_PCLK_GATE(tdmout_b
, AUDIO_CLK_GATE_EN
, 7);
345 static struct clk_regmap tdmout_c
=
346 AUD_PCLK_GATE(tdmout_c
, AUDIO_CLK_GATE_EN
, 8);
347 static struct clk_regmap frddr_a
=
348 AUD_PCLK_GATE(frddr_a
, AUDIO_CLK_GATE_EN
, 9);
349 static struct clk_regmap frddr_b
=
350 AUD_PCLK_GATE(frddr_b
, AUDIO_CLK_GATE_EN
, 10);
351 static struct clk_regmap frddr_c
=
352 AUD_PCLK_GATE(frddr_c
, AUDIO_CLK_GATE_EN
, 11);
353 static struct clk_regmap toddr_a
=
354 AUD_PCLK_GATE(toddr_a
, AUDIO_CLK_GATE_EN
, 12);
355 static struct clk_regmap toddr_b
=
356 AUD_PCLK_GATE(toddr_b
, AUDIO_CLK_GATE_EN
, 13);
357 static struct clk_regmap toddr_c
=
358 AUD_PCLK_GATE(toddr_c
, AUDIO_CLK_GATE_EN
, 14);
359 static struct clk_regmap loopback
=
360 AUD_PCLK_GATE(loopback
, AUDIO_CLK_GATE_EN
, 15);
361 static struct clk_regmap spdifin
=
362 AUD_PCLK_GATE(spdifin
, AUDIO_CLK_GATE_EN
, 16);
363 static struct clk_regmap spdifout
=
364 AUD_PCLK_GATE(spdifout
, AUDIO_CLK_GATE_EN
, 17);
365 static struct clk_regmap resample
=
366 AUD_PCLK_GATE(resample
, AUDIO_CLK_GATE_EN
, 18);
367 static struct clk_regmap power_detect
=
368 AUD_PCLK_GATE(power_detect
, AUDIO_CLK_GATE_EN
, 19);
370 static struct clk_regmap spdifout_clk_sel
=
371 AUD_MST_MCLK_MUX(spdifout_clk
, AUDIO_CLK_SPDIFOUT_CTRL
);
372 static struct clk_regmap pdm_dclk_sel
=
373 AUD_MST_MCLK_MUX(pdm_dclk
, AUDIO_CLK_PDMIN_CTRL0
);
374 static struct clk_regmap spdifin_clk_sel
=
375 AUD_MST_SYS_MUX(spdifin_clk
, AUDIO_CLK_SPDIFIN_CTRL
);
376 static struct clk_regmap pdm_sysclk_sel
=
377 AUD_MST_SYS_MUX(pdm_sysclk
, AUDIO_CLK_PDMIN_CTRL1
);
378 static struct clk_regmap spdifout_b_clk_sel
=
379 AUD_MST_MCLK_MUX(spdifout_b_clk
, AUDIO_CLK_SPDIFOUT_B_CTRL
);
381 static struct clk_regmap spdifout_clk_div
=
382 AUD_MST_MCLK_DIV(spdifout_clk
, AUDIO_CLK_SPDIFOUT_CTRL
);
383 static struct clk_regmap pdm_dclk_div
=
384 AUD_MST_MCLK_DIV(pdm_dclk
, AUDIO_CLK_PDMIN_CTRL0
);
385 static struct clk_regmap spdifin_clk_div
=
386 AUD_MST_SYS_DIV(spdifin_clk
, AUDIO_CLK_SPDIFIN_CTRL
);
387 static struct clk_regmap pdm_sysclk_div
=
388 AUD_MST_SYS_DIV(pdm_sysclk
, AUDIO_CLK_PDMIN_CTRL1
);
389 static struct clk_regmap spdifout_b_clk_div
=
390 AUD_MST_MCLK_DIV(spdifout_b_clk
, AUDIO_CLK_SPDIFOUT_B_CTRL
);
392 static struct clk_regmap spdifout_clk
=
393 AUD_MST_MCLK_GATE(spdifout_clk
, AUDIO_CLK_SPDIFOUT_CTRL
);
394 static struct clk_regmap spdifin_clk
=
395 AUD_MST_MCLK_GATE(spdifin_clk
, AUDIO_CLK_SPDIFIN_CTRL
);
396 static struct clk_regmap pdm_dclk
=
397 AUD_MST_MCLK_GATE(pdm_dclk
, AUDIO_CLK_PDMIN_CTRL0
);
398 static struct clk_regmap pdm_sysclk
=
399 AUD_MST_MCLK_GATE(pdm_sysclk
, AUDIO_CLK_PDMIN_CTRL1
);
400 static struct clk_regmap spdifout_b_clk
=
401 AUD_MST_MCLK_GATE(spdifout_b_clk
, AUDIO_CLK_SPDIFOUT_B_CTRL
);
403 static struct clk_regmap mst_a_sclk_pre_en
=
404 AUD_MST_SCLK_PRE_EN(a
, AUDIO_MST_A_SCLK_CTRL0
);
405 static struct clk_regmap mst_b_sclk_pre_en
=
406 AUD_MST_SCLK_PRE_EN(b
, AUDIO_MST_B_SCLK_CTRL0
);
407 static struct clk_regmap mst_c_sclk_pre_en
=
408 AUD_MST_SCLK_PRE_EN(c
, AUDIO_MST_C_SCLK_CTRL0
);
409 static struct clk_regmap mst_d_sclk_pre_en
=
410 AUD_MST_SCLK_PRE_EN(d
, AUDIO_MST_D_SCLK_CTRL0
);
411 static struct clk_regmap mst_e_sclk_pre_en
=
412 AUD_MST_SCLK_PRE_EN(e
, AUDIO_MST_E_SCLK_CTRL0
);
413 static struct clk_regmap mst_f_sclk_pre_en
=
414 AUD_MST_SCLK_PRE_EN(f
, AUDIO_MST_F_SCLK_CTRL0
);
416 static struct clk_regmap mst_a_sclk_div
=
417 AUD_MST_SCLK_DIV(a
, AUDIO_MST_A_SCLK_CTRL0
);
418 static struct clk_regmap mst_b_sclk_div
=
419 AUD_MST_SCLK_DIV(b
, AUDIO_MST_B_SCLK_CTRL0
);
420 static struct clk_regmap mst_c_sclk_div
=
421 AUD_MST_SCLK_DIV(c
, AUDIO_MST_C_SCLK_CTRL0
);
422 static struct clk_regmap mst_d_sclk_div
=
423 AUD_MST_SCLK_DIV(d
, AUDIO_MST_D_SCLK_CTRL0
);
424 static struct clk_regmap mst_e_sclk_div
=
425 AUD_MST_SCLK_DIV(e
, AUDIO_MST_E_SCLK_CTRL0
);
426 static struct clk_regmap mst_f_sclk_div
=
427 AUD_MST_SCLK_DIV(f
, AUDIO_MST_F_SCLK_CTRL0
);
429 static struct clk_regmap mst_a_sclk_post_en
=
430 AUD_MST_SCLK_POST_EN(a
, AUDIO_MST_A_SCLK_CTRL0
);
431 static struct clk_regmap mst_b_sclk_post_en
=
432 AUD_MST_SCLK_POST_EN(b
, AUDIO_MST_B_SCLK_CTRL0
);
433 static struct clk_regmap mst_c_sclk_post_en
=
434 AUD_MST_SCLK_POST_EN(c
, AUDIO_MST_C_SCLK_CTRL0
);
435 static struct clk_regmap mst_d_sclk_post_en
=
436 AUD_MST_SCLK_POST_EN(d
, AUDIO_MST_D_SCLK_CTRL0
);
437 static struct clk_regmap mst_e_sclk_post_en
=
438 AUD_MST_SCLK_POST_EN(e
, AUDIO_MST_E_SCLK_CTRL0
);
439 static struct clk_regmap mst_f_sclk_post_en
=
440 AUD_MST_SCLK_POST_EN(f
, AUDIO_MST_F_SCLK_CTRL0
);
442 static struct clk_regmap mst_a_sclk
=
443 AUD_MST_SCLK(a
, AUDIO_MST_A_SCLK_CTRL1
);
444 static struct clk_regmap mst_b_sclk
=
445 AUD_MST_SCLK(b
, AUDIO_MST_B_SCLK_CTRL1
);
446 static struct clk_regmap mst_c_sclk
=
447 AUD_MST_SCLK(c
, AUDIO_MST_C_SCLK_CTRL1
);
448 static struct clk_regmap mst_d_sclk
=
449 AUD_MST_SCLK(d
, AUDIO_MST_D_SCLK_CTRL1
);
450 static struct clk_regmap mst_e_sclk
=
451 AUD_MST_SCLK(e
, AUDIO_MST_E_SCLK_CTRL1
);
452 static struct clk_regmap mst_f_sclk
=
453 AUD_MST_SCLK(f
, AUDIO_MST_F_SCLK_CTRL1
);
455 static struct clk_regmap mst_a_lrclk_div
=
456 AUD_MST_LRCLK_DIV(a
, AUDIO_MST_A_SCLK_CTRL0
);
457 static struct clk_regmap mst_b_lrclk_div
=
458 AUD_MST_LRCLK_DIV(b
, AUDIO_MST_B_SCLK_CTRL0
);
459 static struct clk_regmap mst_c_lrclk_div
=
460 AUD_MST_LRCLK_DIV(c
, AUDIO_MST_C_SCLK_CTRL0
);
461 static struct clk_regmap mst_d_lrclk_div
=
462 AUD_MST_LRCLK_DIV(d
, AUDIO_MST_D_SCLK_CTRL0
);
463 static struct clk_regmap mst_e_lrclk_div
=
464 AUD_MST_LRCLK_DIV(e
, AUDIO_MST_E_SCLK_CTRL0
);
465 static struct clk_regmap mst_f_lrclk_div
=
466 AUD_MST_LRCLK_DIV(f
, AUDIO_MST_F_SCLK_CTRL0
);
468 static struct clk_regmap mst_a_lrclk
=
469 AUD_MST_LRCLK(a
, AUDIO_MST_A_SCLK_CTRL1
);
470 static struct clk_regmap mst_b_lrclk
=
471 AUD_MST_LRCLK(b
, AUDIO_MST_B_SCLK_CTRL1
);
472 static struct clk_regmap mst_c_lrclk
=
473 AUD_MST_LRCLK(c
, AUDIO_MST_C_SCLK_CTRL1
);
474 static struct clk_regmap mst_d_lrclk
=
475 AUD_MST_LRCLK(d
, AUDIO_MST_D_SCLK_CTRL1
);
476 static struct clk_regmap mst_e_lrclk
=
477 AUD_MST_LRCLK(e
, AUDIO_MST_E_SCLK_CTRL1
);
478 static struct clk_regmap mst_f_lrclk
=
479 AUD_MST_LRCLK(f
, AUDIO_MST_F_SCLK_CTRL1
);
481 static struct clk_regmap tdmin_a_sclk_sel
=
482 AUD_TDM_SCLK_MUX(in_a
, AUDIO_CLK_TDMIN_A_CTRL
);
483 static struct clk_regmap tdmin_b_sclk_sel
=
484 AUD_TDM_SCLK_MUX(in_b
, AUDIO_CLK_TDMIN_B_CTRL
);
485 static struct clk_regmap tdmin_c_sclk_sel
=
486 AUD_TDM_SCLK_MUX(in_c
, AUDIO_CLK_TDMIN_C_CTRL
);
487 static struct clk_regmap tdmin_lb_sclk_sel
=
488 AUD_TDM_SCLK_MUX(in_lb
, AUDIO_CLK_TDMIN_LB_CTRL
);
489 static struct clk_regmap tdmout_a_sclk_sel
=
490 AUD_TDM_SCLK_MUX(out_a
, AUDIO_CLK_TDMOUT_A_CTRL
);
491 static struct clk_regmap tdmout_b_sclk_sel
=
492 AUD_TDM_SCLK_MUX(out_b
, AUDIO_CLK_TDMOUT_B_CTRL
);
493 static struct clk_regmap tdmout_c_sclk_sel
=
494 AUD_TDM_SCLK_MUX(out_c
, AUDIO_CLK_TDMOUT_C_CTRL
);
496 static struct clk_regmap tdmin_a_sclk_pre_en
=
497 AUD_TDM_SCLK_PRE_EN(in_a
, AUDIO_CLK_TDMIN_A_CTRL
);
498 static struct clk_regmap tdmin_b_sclk_pre_en
=
499 AUD_TDM_SCLK_PRE_EN(in_b
, AUDIO_CLK_TDMIN_B_CTRL
);
500 static struct clk_regmap tdmin_c_sclk_pre_en
=
501 AUD_TDM_SCLK_PRE_EN(in_c
, AUDIO_CLK_TDMIN_C_CTRL
);
502 static struct clk_regmap tdmin_lb_sclk_pre_en
=
503 AUD_TDM_SCLK_PRE_EN(in_lb
, AUDIO_CLK_TDMIN_LB_CTRL
);
504 static struct clk_regmap tdmout_a_sclk_pre_en
=
505 AUD_TDM_SCLK_PRE_EN(out_a
, AUDIO_CLK_TDMOUT_A_CTRL
);
506 static struct clk_regmap tdmout_b_sclk_pre_en
=
507 AUD_TDM_SCLK_PRE_EN(out_b
, AUDIO_CLK_TDMOUT_B_CTRL
);
508 static struct clk_regmap tdmout_c_sclk_pre_en
=
509 AUD_TDM_SCLK_PRE_EN(out_c
, AUDIO_CLK_TDMOUT_C_CTRL
);
511 static struct clk_regmap tdmin_a_sclk_post_en
=
512 AUD_TDM_SCLK_POST_EN(in_a
, AUDIO_CLK_TDMIN_A_CTRL
);
513 static struct clk_regmap tdmin_b_sclk_post_en
=
514 AUD_TDM_SCLK_POST_EN(in_b
, AUDIO_CLK_TDMIN_B_CTRL
);
515 static struct clk_regmap tdmin_c_sclk_post_en
=
516 AUD_TDM_SCLK_POST_EN(in_c
, AUDIO_CLK_TDMIN_C_CTRL
);
517 static struct clk_regmap tdmin_lb_sclk_post_en
=
518 AUD_TDM_SCLK_POST_EN(in_lb
, AUDIO_CLK_TDMIN_LB_CTRL
);
519 static struct clk_regmap tdmout_a_sclk_post_en
=
520 AUD_TDM_SCLK_POST_EN(out_a
, AUDIO_CLK_TDMOUT_A_CTRL
);
521 static struct clk_regmap tdmout_b_sclk_post_en
=
522 AUD_TDM_SCLK_POST_EN(out_b
, AUDIO_CLK_TDMOUT_B_CTRL
);
523 static struct clk_regmap tdmout_c_sclk_post_en
=
524 AUD_TDM_SCLK_POST_EN(out_c
, AUDIO_CLK_TDMOUT_C_CTRL
);
526 static struct clk_regmap tdmin_a_sclk
=
527 AUD_TDM_SCLK(in_a
, AUDIO_CLK_TDMIN_A_CTRL
);
528 static struct clk_regmap tdmin_b_sclk
=
529 AUD_TDM_SCLK(in_b
, AUDIO_CLK_TDMIN_B_CTRL
);
530 static struct clk_regmap tdmin_c_sclk
=
531 AUD_TDM_SCLK(in_c
, AUDIO_CLK_TDMIN_C_CTRL
);
532 static struct clk_regmap tdmin_lb_sclk
=
533 AUD_TDM_SCLK(in_lb
, AUDIO_CLK_TDMIN_LB_CTRL
);
535 static struct clk_regmap tdmin_a_lrclk
=
536 AUD_TDM_LRLCK(in_a
, AUDIO_CLK_TDMIN_A_CTRL
);
537 static struct clk_regmap tdmin_b_lrclk
=
538 AUD_TDM_LRLCK(in_b
, AUDIO_CLK_TDMIN_B_CTRL
);
539 static struct clk_regmap tdmin_c_lrclk
=
540 AUD_TDM_LRLCK(in_c
, AUDIO_CLK_TDMIN_C_CTRL
);
541 static struct clk_regmap tdmin_lb_lrclk
=
542 AUD_TDM_LRLCK(in_lb
, AUDIO_CLK_TDMIN_LB_CTRL
);
543 static struct clk_regmap tdmout_a_lrclk
=
544 AUD_TDM_LRLCK(out_a
, AUDIO_CLK_TDMOUT_A_CTRL
);
545 static struct clk_regmap tdmout_b_lrclk
=
546 AUD_TDM_LRLCK(out_b
, AUDIO_CLK_TDMOUT_B_CTRL
);
547 static struct clk_regmap tdmout_c_lrclk
=
548 AUD_TDM_LRLCK(out_c
, AUDIO_CLK_TDMOUT_C_CTRL
);
551 static struct clk_regmap axg_tdmout_a_sclk
=
552 AUD_TDM_SCLK(out_a
, AUDIO_CLK_TDMOUT_A_CTRL
);
553 static struct clk_regmap axg_tdmout_b_sclk
=
554 AUD_TDM_SCLK(out_b
, AUDIO_CLK_TDMOUT_B_CTRL
);
555 static struct clk_regmap axg_tdmout_c_sclk
=
556 AUD_TDM_SCLK(out_c
, AUDIO_CLK_TDMOUT_C_CTRL
);
558 /* AXG/G12A Clocks */
559 static struct clk_hw axg_aud_top
= {
560 .init
= &(struct clk_init_data
) {
561 /* Provide aud_top signal name on axg and g12a */
563 .ops
= &(const struct clk_ops
) {},
564 .parent_data
= &(const struct clk_parent_data
) {
571 static struct clk_regmap mst_a_mclk_sel
=
572 AUD_MST_MCLK_MUX(mst_a_mclk
, AUDIO_MCLK_A_CTRL
);
573 static struct clk_regmap mst_b_mclk_sel
=
574 AUD_MST_MCLK_MUX(mst_b_mclk
, AUDIO_MCLK_B_CTRL
);
575 static struct clk_regmap mst_c_mclk_sel
=
576 AUD_MST_MCLK_MUX(mst_c_mclk
, AUDIO_MCLK_C_CTRL
);
577 static struct clk_regmap mst_d_mclk_sel
=
578 AUD_MST_MCLK_MUX(mst_d_mclk
, AUDIO_MCLK_D_CTRL
);
579 static struct clk_regmap mst_e_mclk_sel
=
580 AUD_MST_MCLK_MUX(mst_e_mclk
, AUDIO_MCLK_E_CTRL
);
581 static struct clk_regmap mst_f_mclk_sel
=
582 AUD_MST_MCLK_MUX(mst_f_mclk
, AUDIO_MCLK_F_CTRL
);
584 static struct clk_regmap mst_a_mclk_div
=
585 AUD_MST_MCLK_DIV(mst_a_mclk
, AUDIO_MCLK_A_CTRL
);
586 static struct clk_regmap mst_b_mclk_div
=
587 AUD_MST_MCLK_DIV(mst_b_mclk
, AUDIO_MCLK_B_CTRL
);
588 static struct clk_regmap mst_c_mclk_div
=
589 AUD_MST_MCLK_DIV(mst_c_mclk
, AUDIO_MCLK_C_CTRL
);
590 static struct clk_regmap mst_d_mclk_div
=
591 AUD_MST_MCLK_DIV(mst_d_mclk
, AUDIO_MCLK_D_CTRL
);
592 static struct clk_regmap mst_e_mclk_div
=
593 AUD_MST_MCLK_DIV(mst_e_mclk
, AUDIO_MCLK_E_CTRL
);
594 static struct clk_regmap mst_f_mclk_div
=
595 AUD_MST_MCLK_DIV(mst_f_mclk
, AUDIO_MCLK_F_CTRL
);
597 static struct clk_regmap mst_a_mclk
=
598 AUD_MST_MCLK_GATE(mst_a_mclk
, AUDIO_MCLK_A_CTRL
);
599 static struct clk_regmap mst_b_mclk
=
600 AUD_MST_MCLK_GATE(mst_b_mclk
, AUDIO_MCLK_B_CTRL
);
601 static struct clk_regmap mst_c_mclk
=
602 AUD_MST_MCLK_GATE(mst_c_mclk
, AUDIO_MCLK_C_CTRL
);
603 static struct clk_regmap mst_d_mclk
=
604 AUD_MST_MCLK_GATE(mst_d_mclk
, AUDIO_MCLK_D_CTRL
);
605 static struct clk_regmap mst_e_mclk
=
606 AUD_MST_MCLK_GATE(mst_e_mclk
, AUDIO_MCLK_E_CTRL
);
607 static struct clk_regmap mst_f_mclk
=
608 AUD_MST_MCLK_GATE(mst_f_mclk
, AUDIO_MCLK_F_CTRL
);
611 static struct clk_regmap g12a_tdm_mclk_pad_0
= AUD_TDM_PAD_CTRL(
612 mclk_pad_0
, AUDIO_MST_PAD_CTRL0
, 0, mclk_pad_ctrl_parent_data
);
613 static struct clk_regmap g12a_tdm_mclk_pad_1
= AUD_TDM_PAD_CTRL(
614 mclk_pad_1
, AUDIO_MST_PAD_CTRL0
, 4, mclk_pad_ctrl_parent_data
);
615 static struct clk_regmap g12a_tdm_lrclk_pad_0
= AUD_TDM_PAD_CTRL(
616 lrclk_pad_0
, AUDIO_MST_PAD_CTRL1
, 16, lrclk_pad_ctrl_parent_data
);
617 static struct clk_regmap g12a_tdm_lrclk_pad_1
= AUD_TDM_PAD_CTRL(
618 lrclk_pad_1
, AUDIO_MST_PAD_CTRL1
, 20, lrclk_pad_ctrl_parent_data
);
619 static struct clk_regmap g12a_tdm_lrclk_pad_2
= AUD_TDM_PAD_CTRL(
620 lrclk_pad_2
, AUDIO_MST_PAD_CTRL1
, 24, lrclk_pad_ctrl_parent_data
);
621 static struct clk_regmap g12a_tdm_sclk_pad_0
= AUD_TDM_PAD_CTRL(
622 sclk_pad_0
, AUDIO_MST_PAD_CTRL1
, 0, sclk_pad_ctrl_parent_data
);
623 static struct clk_regmap g12a_tdm_sclk_pad_1
= AUD_TDM_PAD_CTRL(
624 sclk_pad_1
, AUDIO_MST_PAD_CTRL1
, 4, sclk_pad_ctrl_parent_data
);
625 static struct clk_regmap g12a_tdm_sclk_pad_2
= AUD_TDM_PAD_CTRL(
626 sclk_pad_2
, AUDIO_MST_PAD_CTRL1
, 8, sclk_pad_ctrl_parent_data
);
628 static struct clk_regmap g12a_tdmout_a_sclk
=
629 AUD_TDM_SCLK_WS(out_a
, AUDIO_CLK_TDMOUT_A_CTRL
);
630 static struct clk_regmap g12a_tdmout_b_sclk
=
631 AUD_TDM_SCLK_WS(out_b
, AUDIO_CLK_TDMOUT_B_CTRL
);
632 static struct clk_regmap g12a_tdmout_c_sclk
=
633 AUD_TDM_SCLK_WS(out_c
, AUDIO_CLK_TDMOUT_C_CTRL
);
635 static struct clk_regmap toram
=
636 AUD_PCLK_GATE(toram
, AUDIO_CLK_GATE_EN
, 20);
637 static struct clk_regmap spdifout_b
=
638 AUD_PCLK_GATE(spdifout_b
, AUDIO_CLK_GATE_EN
, 21);
639 static struct clk_regmap eqdrc
=
640 AUD_PCLK_GATE(eqdrc
, AUDIO_CLK_GATE_EN
, 22);
643 static struct clk_regmap sm1_clk81_en
= {
644 .data
= &(struct clk_regmap_gate_data
){
645 .offset
= AUDIO_CLK81_EN
,
648 .hw
.init
= &(struct clk_init_data
) {
649 .name
= "aud_clk81_en",
650 .ops
= &clk_regmap_gate_ops
,
651 .parent_data
= &(const struct clk_parent_data
) {
658 static struct clk_regmap sm1_sysclk_a_div
= {
659 .data
= &(struct clk_regmap_div_data
){
660 .offset
= AUDIO_CLK81_CTRL
,
664 .hw
.init
= &(struct clk_init_data
) {
665 .name
= "aud_sysclk_a_div",
666 .ops
= &clk_regmap_divider_ops
,
667 .parent_hws
= (const struct clk_hw
*[]) {
671 .flags
= CLK_SET_RATE_PARENT
,
675 static struct clk_regmap sm1_sysclk_a_en
= {
676 .data
= &(struct clk_regmap_gate_data
){
677 .offset
= AUDIO_CLK81_CTRL
,
680 .hw
.init
= &(struct clk_init_data
) {
681 .name
= "aud_sysclk_a_en",
682 .ops
= &clk_regmap_gate_ops
,
683 .parent_hws
= (const struct clk_hw
*[]) {
684 &sm1_sysclk_a_div
.hw
,
687 .flags
= CLK_SET_RATE_PARENT
,
691 static struct clk_regmap sm1_sysclk_b_div
= {
692 .data
= &(struct clk_regmap_div_data
){
693 .offset
= AUDIO_CLK81_CTRL
,
697 .hw
.init
= &(struct clk_init_data
) {
698 .name
= "aud_sysclk_b_div",
699 .ops
= &clk_regmap_divider_ops
,
700 .parent_hws
= (const struct clk_hw
*[]) {
704 .flags
= CLK_SET_RATE_PARENT
,
708 static struct clk_regmap sm1_sysclk_b_en
= {
709 .data
= &(struct clk_regmap_gate_data
){
710 .offset
= AUDIO_CLK81_CTRL
,
713 .hw
.init
= &(struct clk_init_data
) {
714 .name
= "aud_sysclk_b_en",
715 .ops
= &clk_regmap_gate_ops
,
716 .parent_hws
= (const struct clk_hw
*[]) {
717 &sm1_sysclk_b_div
.hw
,
720 .flags
= CLK_SET_RATE_PARENT
,
724 static const struct clk_hw
*sm1_aud_top_parents
[] = {
729 static struct clk_regmap sm1_aud_top
= {
730 .data
= &(struct clk_regmap_mux_data
){
731 .offset
= AUDIO_CLK81_CTRL
,
735 .hw
.init
= &(struct clk_init_data
){
737 .ops
= &clk_regmap_mux_ops
,
738 .parent_hws
= sm1_aud_top_parents
,
739 .num_parents
= ARRAY_SIZE(sm1_aud_top_parents
),
740 .flags
= CLK_SET_RATE_NO_REPARENT
,
744 static struct clk_regmap resample_b
=
745 AUD_PCLK_GATE(resample_b
, AUDIO_CLK_GATE_EN
, 26);
746 static struct clk_regmap tovad
=
747 AUD_PCLK_GATE(tovad
, AUDIO_CLK_GATE_EN
, 27);
748 static struct clk_regmap locker
=
749 AUD_PCLK_GATE(locker
, AUDIO_CLK_GATE_EN
, 28);
750 static struct clk_regmap spdifin_lb
=
751 AUD_PCLK_GATE(spdifin_lb
, AUDIO_CLK_GATE_EN
, 29);
752 static struct clk_regmap frddr_d
=
753 AUD_PCLK_GATE(frddr_d
, AUDIO_CLK_GATE_EN1
, 0);
754 static struct clk_regmap toddr_d
=
755 AUD_PCLK_GATE(toddr_d
, AUDIO_CLK_GATE_EN1
, 1);
756 static struct clk_regmap loopback_b
=
757 AUD_PCLK_GATE(loopback_b
, AUDIO_CLK_GATE_EN1
, 2);
758 static struct clk_regmap earcrx
=
759 AUD_PCLK_GATE(earcrx
, AUDIO_CLK_GATE_EN1
, 6);
762 static struct clk_regmap sm1_mst_a_mclk_sel
=
763 AUD_MST_MCLK_MUX(mst_a_mclk
, AUDIO_SM1_MCLK_A_CTRL
);
764 static struct clk_regmap sm1_mst_b_mclk_sel
=
765 AUD_MST_MCLK_MUX(mst_b_mclk
, AUDIO_SM1_MCLK_B_CTRL
);
766 static struct clk_regmap sm1_mst_c_mclk_sel
=
767 AUD_MST_MCLK_MUX(mst_c_mclk
, AUDIO_SM1_MCLK_C_CTRL
);
768 static struct clk_regmap sm1_mst_d_mclk_sel
=
769 AUD_MST_MCLK_MUX(mst_d_mclk
, AUDIO_SM1_MCLK_D_CTRL
);
770 static struct clk_regmap sm1_mst_e_mclk_sel
=
771 AUD_MST_MCLK_MUX(mst_e_mclk
, AUDIO_SM1_MCLK_E_CTRL
);
772 static struct clk_regmap sm1_mst_f_mclk_sel
=
773 AUD_MST_MCLK_MUX(mst_f_mclk
, AUDIO_SM1_MCLK_F_CTRL
);
774 static struct clk_regmap sm1_earcrx_cmdc_clk_sel
=
775 AUD_MST_MCLK_MUX(earcrx_cmdc_clk
, AUDIO_EARCRX_CMDC_CLK_CTRL
);
776 static struct clk_regmap sm1_earcrx_dmac_clk_sel
=
777 AUD_MST_MCLK_MUX(earcrx_dmac_clk
, AUDIO_EARCRX_DMAC_CLK_CTRL
);
779 static struct clk_regmap sm1_mst_a_mclk_div
=
780 AUD_MST_MCLK_DIV(mst_a_mclk
, AUDIO_SM1_MCLK_A_CTRL
);
781 static struct clk_regmap sm1_mst_b_mclk_div
=
782 AUD_MST_MCLK_DIV(mst_b_mclk
, AUDIO_SM1_MCLK_B_CTRL
);
783 static struct clk_regmap sm1_mst_c_mclk_div
=
784 AUD_MST_MCLK_DIV(mst_c_mclk
, AUDIO_SM1_MCLK_C_CTRL
);
785 static struct clk_regmap sm1_mst_d_mclk_div
=
786 AUD_MST_MCLK_DIV(mst_d_mclk
, AUDIO_SM1_MCLK_D_CTRL
);
787 static struct clk_regmap sm1_mst_e_mclk_div
=
788 AUD_MST_MCLK_DIV(mst_e_mclk
, AUDIO_SM1_MCLK_E_CTRL
);
789 static struct clk_regmap sm1_mst_f_mclk_div
=
790 AUD_MST_MCLK_DIV(mst_f_mclk
, AUDIO_SM1_MCLK_F_CTRL
);
791 static struct clk_regmap sm1_earcrx_cmdc_clk_div
=
792 AUD_MST_MCLK_DIV(earcrx_cmdc_clk
, AUDIO_EARCRX_CMDC_CLK_CTRL
);
793 static struct clk_regmap sm1_earcrx_dmac_clk_div
=
794 AUD_MST_MCLK_DIV(earcrx_dmac_clk
, AUDIO_EARCRX_DMAC_CLK_CTRL
);
797 static struct clk_regmap sm1_mst_a_mclk
=
798 AUD_MST_MCLK_GATE(mst_a_mclk
, AUDIO_SM1_MCLK_A_CTRL
);
799 static struct clk_regmap sm1_mst_b_mclk
=
800 AUD_MST_MCLK_GATE(mst_b_mclk
, AUDIO_SM1_MCLK_B_CTRL
);
801 static struct clk_regmap sm1_mst_c_mclk
=
802 AUD_MST_MCLK_GATE(mst_c_mclk
, AUDIO_SM1_MCLK_C_CTRL
);
803 static struct clk_regmap sm1_mst_d_mclk
=
804 AUD_MST_MCLK_GATE(mst_d_mclk
, AUDIO_SM1_MCLK_D_CTRL
);
805 static struct clk_regmap sm1_mst_e_mclk
=
806 AUD_MST_MCLK_GATE(mst_e_mclk
, AUDIO_SM1_MCLK_E_CTRL
);
807 static struct clk_regmap sm1_mst_f_mclk
=
808 AUD_MST_MCLK_GATE(mst_f_mclk
, AUDIO_SM1_MCLK_F_CTRL
);
809 static struct clk_regmap sm1_earcrx_cmdc_clk
=
810 AUD_MST_MCLK_GATE(earcrx_cmdc_clk
, AUDIO_EARCRX_CMDC_CLK_CTRL
);
811 static struct clk_regmap sm1_earcrx_dmac_clk
=
812 AUD_MST_MCLK_GATE(earcrx_dmac_clk
, AUDIO_EARCRX_DMAC_CLK_CTRL
);
814 static struct clk_regmap sm1_tdm_mclk_pad_0
= AUD_TDM_PAD_CTRL(
815 tdm_mclk_pad_0
, AUDIO_SM1_MST_PAD_CTRL0
, 0, mclk_pad_ctrl_parent_data
);
816 static struct clk_regmap sm1_tdm_mclk_pad_1
= AUD_TDM_PAD_CTRL(
817 tdm_mclk_pad_1
, AUDIO_SM1_MST_PAD_CTRL0
, 4, mclk_pad_ctrl_parent_data
);
818 static struct clk_regmap sm1_tdm_lrclk_pad_0
= AUD_TDM_PAD_CTRL(
819 tdm_lrclk_pad_0
, AUDIO_SM1_MST_PAD_CTRL1
, 16, lrclk_pad_ctrl_parent_data
);
820 static struct clk_regmap sm1_tdm_lrclk_pad_1
= AUD_TDM_PAD_CTRL(
821 tdm_lrclk_pad_1
, AUDIO_SM1_MST_PAD_CTRL1
, 20, lrclk_pad_ctrl_parent_data
);
822 static struct clk_regmap sm1_tdm_lrclk_pad_2
= AUD_TDM_PAD_CTRL(
823 tdm_lrclk_pad_2
, AUDIO_SM1_MST_PAD_CTRL1
, 24, lrclk_pad_ctrl_parent_data
);
824 static struct clk_regmap sm1_tdm_sclk_pad_0
= AUD_TDM_PAD_CTRL(
825 tdm_sclk_pad_0
, AUDIO_SM1_MST_PAD_CTRL1
, 0, sclk_pad_ctrl_parent_data
);
826 static struct clk_regmap sm1_tdm_sclk_pad_1
= AUD_TDM_PAD_CTRL(
827 tdm_sclk_pad_1
, AUDIO_SM1_MST_PAD_CTRL1
, 4, sclk_pad_ctrl_parent_data
);
828 static struct clk_regmap sm1_tdm_sclk_pad_2
= AUD_TDM_PAD_CTRL(
829 tdm_sclk_pad_2
, AUDIO_SM1_MST_PAD_CTRL1
, 8, sclk_pad_ctrl_parent_data
);
832 * Array of all clocks provided by this provider
833 * The input clocks of the controller will be populated at runtime
835 static struct clk_hw
*axg_audio_hw_clks
[] = {
836 [AUD_CLKID_DDR_ARB
] = &ddr_arb
.hw
,
837 [AUD_CLKID_PDM
] = &pdm
.hw
,
838 [AUD_CLKID_TDMIN_A
] = &tdmin_a
.hw
,
839 [AUD_CLKID_TDMIN_B
] = &tdmin_b
.hw
,
840 [AUD_CLKID_TDMIN_C
] = &tdmin_c
.hw
,
841 [AUD_CLKID_TDMIN_LB
] = &tdmin_lb
.hw
,
842 [AUD_CLKID_TDMOUT_A
] = &tdmout_a
.hw
,
843 [AUD_CLKID_TDMOUT_B
] = &tdmout_b
.hw
,
844 [AUD_CLKID_TDMOUT_C
] = &tdmout_c
.hw
,
845 [AUD_CLKID_FRDDR_A
] = &frddr_a
.hw
,
846 [AUD_CLKID_FRDDR_B
] = &frddr_b
.hw
,
847 [AUD_CLKID_FRDDR_C
] = &frddr_c
.hw
,
848 [AUD_CLKID_TODDR_A
] = &toddr_a
.hw
,
849 [AUD_CLKID_TODDR_B
] = &toddr_b
.hw
,
850 [AUD_CLKID_TODDR_C
] = &toddr_c
.hw
,
851 [AUD_CLKID_LOOPBACK
] = &loopback
.hw
,
852 [AUD_CLKID_SPDIFIN
] = &spdifin
.hw
,
853 [AUD_CLKID_SPDIFOUT
] = &spdifout
.hw
,
854 [AUD_CLKID_RESAMPLE
] = &resample
.hw
,
855 [AUD_CLKID_POWER_DETECT
] = &power_detect
.hw
,
856 [AUD_CLKID_MST_A_MCLK_SEL
] = &mst_a_mclk_sel
.hw
,
857 [AUD_CLKID_MST_B_MCLK_SEL
] = &mst_b_mclk_sel
.hw
,
858 [AUD_CLKID_MST_C_MCLK_SEL
] = &mst_c_mclk_sel
.hw
,
859 [AUD_CLKID_MST_D_MCLK_SEL
] = &mst_d_mclk_sel
.hw
,
860 [AUD_CLKID_MST_E_MCLK_SEL
] = &mst_e_mclk_sel
.hw
,
861 [AUD_CLKID_MST_F_MCLK_SEL
] = &mst_f_mclk_sel
.hw
,
862 [AUD_CLKID_MST_A_MCLK_DIV
] = &mst_a_mclk_div
.hw
,
863 [AUD_CLKID_MST_B_MCLK_DIV
] = &mst_b_mclk_div
.hw
,
864 [AUD_CLKID_MST_C_MCLK_DIV
] = &mst_c_mclk_div
.hw
,
865 [AUD_CLKID_MST_D_MCLK_DIV
] = &mst_d_mclk_div
.hw
,
866 [AUD_CLKID_MST_E_MCLK_DIV
] = &mst_e_mclk_div
.hw
,
867 [AUD_CLKID_MST_F_MCLK_DIV
] = &mst_f_mclk_div
.hw
,
868 [AUD_CLKID_MST_A_MCLK
] = &mst_a_mclk
.hw
,
869 [AUD_CLKID_MST_B_MCLK
] = &mst_b_mclk
.hw
,
870 [AUD_CLKID_MST_C_MCLK
] = &mst_c_mclk
.hw
,
871 [AUD_CLKID_MST_D_MCLK
] = &mst_d_mclk
.hw
,
872 [AUD_CLKID_MST_E_MCLK
] = &mst_e_mclk
.hw
,
873 [AUD_CLKID_MST_F_MCLK
] = &mst_f_mclk
.hw
,
874 [AUD_CLKID_SPDIFOUT_CLK_SEL
] = &spdifout_clk_sel
.hw
,
875 [AUD_CLKID_SPDIFOUT_CLK_DIV
] = &spdifout_clk_div
.hw
,
876 [AUD_CLKID_SPDIFOUT_CLK
] = &spdifout_clk
.hw
,
877 [AUD_CLKID_SPDIFIN_CLK_SEL
] = &spdifin_clk_sel
.hw
,
878 [AUD_CLKID_SPDIFIN_CLK_DIV
] = &spdifin_clk_div
.hw
,
879 [AUD_CLKID_SPDIFIN_CLK
] = &spdifin_clk
.hw
,
880 [AUD_CLKID_PDM_DCLK_SEL
] = &pdm_dclk_sel
.hw
,
881 [AUD_CLKID_PDM_DCLK_DIV
] = &pdm_dclk_div
.hw
,
882 [AUD_CLKID_PDM_DCLK
] = &pdm_dclk
.hw
,
883 [AUD_CLKID_PDM_SYSCLK_SEL
] = &pdm_sysclk_sel
.hw
,
884 [AUD_CLKID_PDM_SYSCLK_DIV
] = &pdm_sysclk_div
.hw
,
885 [AUD_CLKID_PDM_SYSCLK
] = &pdm_sysclk
.hw
,
886 [AUD_CLKID_MST_A_SCLK_PRE_EN
] = &mst_a_sclk_pre_en
.hw
,
887 [AUD_CLKID_MST_B_SCLK_PRE_EN
] = &mst_b_sclk_pre_en
.hw
,
888 [AUD_CLKID_MST_C_SCLK_PRE_EN
] = &mst_c_sclk_pre_en
.hw
,
889 [AUD_CLKID_MST_D_SCLK_PRE_EN
] = &mst_d_sclk_pre_en
.hw
,
890 [AUD_CLKID_MST_E_SCLK_PRE_EN
] = &mst_e_sclk_pre_en
.hw
,
891 [AUD_CLKID_MST_F_SCLK_PRE_EN
] = &mst_f_sclk_pre_en
.hw
,
892 [AUD_CLKID_MST_A_SCLK_DIV
] = &mst_a_sclk_div
.hw
,
893 [AUD_CLKID_MST_B_SCLK_DIV
] = &mst_b_sclk_div
.hw
,
894 [AUD_CLKID_MST_C_SCLK_DIV
] = &mst_c_sclk_div
.hw
,
895 [AUD_CLKID_MST_D_SCLK_DIV
] = &mst_d_sclk_div
.hw
,
896 [AUD_CLKID_MST_E_SCLK_DIV
] = &mst_e_sclk_div
.hw
,
897 [AUD_CLKID_MST_F_SCLK_DIV
] = &mst_f_sclk_div
.hw
,
898 [AUD_CLKID_MST_A_SCLK_POST_EN
] = &mst_a_sclk_post_en
.hw
,
899 [AUD_CLKID_MST_B_SCLK_POST_EN
] = &mst_b_sclk_post_en
.hw
,
900 [AUD_CLKID_MST_C_SCLK_POST_EN
] = &mst_c_sclk_post_en
.hw
,
901 [AUD_CLKID_MST_D_SCLK_POST_EN
] = &mst_d_sclk_post_en
.hw
,
902 [AUD_CLKID_MST_E_SCLK_POST_EN
] = &mst_e_sclk_post_en
.hw
,
903 [AUD_CLKID_MST_F_SCLK_POST_EN
] = &mst_f_sclk_post_en
.hw
,
904 [AUD_CLKID_MST_A_SCLK
] = &mst_a_sclk
.hw
,
905 [AUD_CLKID_MST_B_SCLK
] = &mst_b_sclk
.hw
,
906 [AUD_CLKID_MST_C_SCLK
] = &mst_c_sclk
.hw
,
907 [AUD_CLKID_MST_D_SCLK
] = &mst_d_sclk
.hw
,
908 [AUD_CLKID_MST_E_SCLK
] = &mst_e_sclk
.hw
,
909 [AUD_CLKID_MST_F_SCLK
] = &mst_f_sclk
.hw
,
910 [AUD_CLKID_MST_A_LRCLK_DIV
] = &mst_a_lrclk_div
.hw
,
911 [AUD_CLKID_MST_B_LRCLK_DIV
] = &mst_b_lrclk_div
.hw
,
912 [AUD_CLKID_MST_C_LRCLK_DIV
] = &mst_c_lrclk_div
.hw
,
913 [AUD_CLKID_MST_D_LRCLK_DIV
] = &mst_d_lrclk_div
.hw
,
914 [AUD_CLKID_MST_E_LRCLK_DIV
] = &mst_e_lrclk_div
.hw
,
915 [AUD_CLKID_MST_F_LRCLK_DIV
] = &mst_f_lrclk_div
.hw
,
916 [AUD_CLKID_MST_A_LRCLK
] = &mst_a_lrclk
.hw
,
917 [AUD_CLKID_MST_B_LRCLK
] = &mst_b_lrclk
.hw
,
918 [AUD_CLKID_MST_C_LRCLK
] = &mst_c_lrclk
.hw
,
919 [AUD_CLKID_MST_D_LRCLK
] = &mst_d_lrclk
.hw
,
920 [AUD_CLKID_MST_E_LRCLK
] = &mst_e_lrclk
.hw
,
921 [AUD_CLKID_MST_F_LRCLK
] = &mst_f_lrclk
.hw
,
922 [AUD_CLKID_TDMIN_A_SCLK_SEL
] = &tdmin_a_sclk_sel
.hw
,
923 [AUD_CLKID_TDMIN_B_SCLK_SEL
] = &tdmin_b_sclk_sel
.hw
,
924 [AUD_CLKID_TDMIN_C_SCLK_SEL
] = &tdmin_c_sclk_sel
.hw
,
925 [AUD_CLKID_TDMIN_LB_SCLK_SEL
] = &tdmin_lb_sclk_sel
.hw
,
926 [AUD_CLKID_TDMOUT_A_SCLK_SEL
] = &tdmout_a_sclk_sel
.hw
,
927 [AUD_CLKID_TDMOUT_B_SCLK_SEL
] = &tdmout_b_sclk_sel
.hw
,
928 [AUD_CLKID_TDMOUT_C_SCLK_SEL
] = &tdmout_c_sclk_sel
.hw
,
929 [AUD_CLKID_TDMIN_A_SCLK_PRE_EN
] = &tdmin_a_sclk_pre_en
.hw
,
930 [AUD_CLKID_TDMIN_B_SCLK_PRE_EN
] = &tdmin_b_sclk_pre_en
.hw
,
931 [AUD_CLKID_TDMIN_C_SCLK_PRE_EN
] = &tdmin_c_sclk_pre_en
.hw
,
932 [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN
] = &tdmin_lb_sclk_pre_en
.hw
,
933 [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN
] = &tdmout_a_sclk_pre_en
.hw
,
934 [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN
] = &tdmout_b_sclk_pre_en
.hw
,
935 [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN
] = &tdmout_c_sclk_pre_en
.hw
,
936 [AUD_CLKID_TDMIN_A_SCLK_POST_EN
] = &tdmin_a_sclk_post_en
.hw
,
937 [AUD_CLKID_TDMIN_B_SCLK_POST_EN
] = &tdmin_b_sclk_post_en
.hw
,
938 [AUD_CLKID_TDMIN_C_SCLK_POST_EN
] = &tdmin_c_sclk_post_en
.hw
,
939 [AUD_CLKID_TDMIN_LB_SCLK_POST_EN
] = &tdmin_lb_sclk_post_en
.hw
,
940 [AUD_CLKID_TDMOUT_A_SCLK_POST_EN
] = &tdmout_a_sclk_post_en
.hw
,
941 [AUD_CLKID_TDMOUT_B_SCLK_POST_EN
] = &tdmout_b_sclk_post_en
.hw
,
942 [AUD_CLKID_TDMOUT_C_SCLK_POST_EN
] = &tdmout_c_sclk_post_en
.hw
,
943 [AUD_CLKID_TDMIN_A_SCLK
] = &tdmin_a_sclk
.hw
,
944 [AUD_CLKID_TDMIN_B_SCLK
] = &tdmin_b_sclk
.hw
,
945 [AUD_CLKID_TDMIN_C_SCLK
] = &tdmin_c_sclk
.hw
,
946 [AUD_CLKID_TDMIN_LB_SCLK
] = &tdmin_lb_sclk
.hw
,
947 [AUD_CLKID_TDMOUT_A_SCLK
] = &axg_tdmout_a_sclk
.hw
,
948 [AUD_CLKID_TDMOUT_B_SCLK
] = &axg_tdmout_b_sclk
.hw
,
949 [AUD_CLKID_TDMOUT_C_SCLK
] = &axg_tdmout_c_sclk
.hw
,
950 [AUD_CLKID_TDMIN_A_LRCLK
] = &tdmin_a_lrclk
.hw
,
951 [AUD_CLKID_TDMIN_B_LRCLK
] = &tdmin_b_lrclk
.hw
,
952 [AUD_CLKID_TDMIN_C_LRCLK
] = &tdmin_c_lrclk
.hw
,
953 [AUD_CLKID_TDMIN_LB_LRCLK
] = &tdmin_lb_lrclk
.hw
,
954 [AUD_CLKID_TDMOUT_A_LRCLK
] = &tdmout_a_lrclk
.hw
,
955 [AUD_CLKID_TDMOUT_B_LRCLK
] = &tdmout_b_lrclk
.hw
,
956 [AUD_CLKID_TDMOUT_C_LRCLK
] = &tdmout_c_lrclk
.hw
,
957 [AUD_CLKID_TOP
] = &axg_aud_top
,
961 * Array of all G12A clocks provided by this provider
962 * The input clocks of the controller will be populated at runtime
964 static struct clk_hw
*g12a_audio_hw_clks
[] = {
965 [AUD_CLKID_DDR_ARB
] = &ddr_arb
.hw
,
966 [AUD_CLKID_PDM
] = &pdm
.hw
,
967 [AUD_CLKID_TDMIN_A
] = &tdmin_a
.hw
,
968 [AUD_CLKID_TDMIN_B
] = &tdmin_b
.hw
,
969 [AUD_CLKID_TDMIN_C
] = &tdmin_c
.hw
,
970 [AUD_CLKID_TDMIN_LB
] = &tdmin_lb
.hw
,
971 [AUD_CLKID_TDMOUT_A
] = &tdmout_a
.hw
,
972 [AUD_CLKID_TDMOUT_B
] = &tdmout_b
.hw
,
973 [AUD_CLKID_TDMOUT_C
] = &tdmout_c
.hw
,
974 [AUD_CLKID_FRDDR_A
] = &frddr_a
.hw
,
975 [AUD_CLKID_FRDDR_B
] = &frddr_b
.hw
,
976 [AUD_CLKID_FRDDR_C
] = &frddr_c
.hw
,
977 [AUD_CLKID_TODDR_A
] = &toddr_a
.hw
,
978 [AUD_CLKID_TODDR_B
] = &toddr_b
.hw
,
979 [AUD_CLKID_TODDR_C
] = &toddr_c
.hw
,
980 [AUD_CLKID_LOOPBACK
] = &loopback
.hw
,
981 [AUD_CLKID_SPDIFIN
] = &spdifin
.hw
,
982 [AUD_CLKID_SPDIFOUT
] = &spdifout
.hw
,
983 [AUD_CLKID_RESAMPLE
] = &resample
.hw
,
984 [AUD_CLKID_POWER_DETECT
] = &power_detect
.hw
,
985 [AUD_CLKID_SPDIFOUT_B
] = &spdifout_b
.hw
,
986 [AUD_CLKID_MST_A_MCLK_SEL
] = &mst_a_mclk_sel
.hw
,
987 [AUD_CLKID_MST_B_MCLK_SEL
] = &mst_b_mclk_sel
.hw
,
988 [AUD_CLKID_MST_C_MCLK_SEL
] = &mst_c_mclk_sel
.hw
,
989 [AUD_CLKID_MST_D_MCLK_SEL
] = &mst_d_mclk_sel
.hw
,
990 [AUD_CLKID_MST_E_MCLK_SEL
] = &mst_e_mclk_sel
.hw
,
991 [AUD_CLKID_MST_F_MCLK_SEL
] = &mst_f_mclk_sel
.hw
,
992 [AUD_CLKID_MST_A_MCLK_DIV
] = &mst_a_mclk_div
.hw
,
993 [AUD_CLKID_MST_B_MCLK_DIV
] = &mst_b_mclk_div
.hw
,
994 [AUD_CLKID_MST_C_MCLK_DIV
] = &mst_c_mclk_div
.hw
,
995 [AUD_CLKID_MST_D_MCLK_DIV
] = &mst_d_mclk_div
.hw
,
996 [AUD_CLKID_MST_E_MCLK_DIV
] = &mst_e_mclk_div
.hw
,
997 [AUD_CLKID_MST_F_MCLK_DIV
] = &mst_f_mclk_div
.hw
,
998 [AUD_CLKID_MST_A_MCLK
] = &mst_a_mclk
.hw
,
999 [AUD_CLKID_MST_B_MCLK
] = &mst_b_mclk
.hw
,
1000 [AUD_CLKID_MST_C_MCLK
] = &mst_c_mclk
.hw
,
1001 [AUD_CLKID_MST_D_MCLK
] = &mst_d_mclk
.hw
,
1002 [AUD_CLKID_MST_E_MCLK
] = &mst_e_mclk
.hw
,
1003 [AUD_CLKID_MST_F_MCLK
] = &mst_f_mclk
.hw
,
1004 [AUD_CLKID_SPDIFOUT_CLK_SEL
] = &spdifout_clk_sel
.hw
,
1005 [AUD_CLKID_SPDIFOUT_CLK_DIV
] = &spdifout_clk_div
.hw
,
1006 [AUD_CLKID_SPDIFOUT_CLK
] = &spdifout_clk
.hw
,
1007 [AUD_CLKID_SPDIFOUT_B_CLK_SEL
] = &spdifout_b_clk_sel
.hw
,
1008 [AUD_CLKID_SPDIFOUT_B_CLK_DIV
] = &spdifout_b_clk_div
.hw
,
1009 [AUD_CLKID_SPDIFOUT_B_CLK
] = &spdifout_b_clk
.hw
,
1010 [AUD_CLKID_SPDIFIN_CLK_SEL
] = &spdifin_clk_sel
.hw
,
1011 [AUD_CLKID_SPDIFIN_CLK_DIV
] = &spdifin_clk_div
.hw
,
1012 [AUD_CLKID_SPDIFIN_CLK
] = &spdifin_clk
.hw
,
1013 [AUD_CLKID_PDM_DCLK_SEL
] = &pdm_dclk_sel
.hw
,
1014 [AUD_CLKID_PDM_DCLK_DIV
] = &pdm_dclk_div
.hw
,
1015 [AUD_CLKID_PDM_DCLK
] = &pdm_dclk
.hw
,
1016 [AUD_CLKID_PDM_SYSCLK_SEL
] = &pdm_sysclk_sel
.hw
,
1017 [AUD_CLKID_PDM_SYSCLK_DIV
] = &pdm_sysclk_div
.hw
,
1018 [AUD_CLKID_PDM_SYSCLK
] = &pdm_sysclk
.hw
,
1019 [AUD_CLKID_MST_A_SCLK_PRE_EN
] = &mst_a_sclk_pre_en
.hw
,
1020 [AUD_CLKID_MST_B_SCLK_PRE_EN
] = &mst_b_sclk_pre_en
.hw
,
1021 [AUD_CLKID_MST_C_SCLK_PRE_EN
] = &mst_c_sclk_pre_en
.hw
,
1022 [AUD_CLKID_MST_D_SCLK_PRE_EN
] = &mst_d_sclk_pre_en
.hw
,
1023 [AUD_CLKID_MST_E_SCLK_PRE_EN
] = &mst_e_sclk_pre_en
.hw
,
1024 [AUD_CLKID_MST_F_SCLK_PRE_EN
] = &mst_f_sclk_pre_en
.hw
,
1025 [AUD_CLKID_MST_A_SCLK_DIV
] = &mst_a_sclk_div
.hw
,
1026 [AUD_CLKID_MST_B_SCLK_DIV
] = &mst_b_sclk_div
.hw
,
1027 [AUD_CLKID_MST_C_SCLK_DIV
] = &mst_c_sclk_div
.hw
,
1028 [AUD_CLKID_MST_D_SCLK_DIV
] = &mst_d_sclk_div
.hw
,
1029 [AUD_CLKID_MST_E_SCLK_DIV
] = &mst_e_sclk_div
.hw
,
1030 [AUD_CLKID_MST_F_SCLK_DIV
] = &mst_f_sclk_div
.hw
,
1031 [AUD_CLKID_MST_A_SCLK_POST_EN
] = &mst_a_sclk_post_en
.hw
,
1032 [AUD_CLKID_MST_B_SCLK_POST_EN
] = &mst_b_sclk_post_en
.hw
,
1033 [AUD_CLKID_MST_C_SCLK_POST_EN
] = &mst_c_sclk_post_en
.hw
,
1034 [AUD_CLKID_MST_D_SCLK_POST_EN
] = &mst_d_sclk_post_en
.hw
,
1035 [AUD_CLKID_MST_E_SCLK_POST_EN
] = &mst_e_sclk_post_en
.hw
,
1036 [AUD_CLKID_MST_F_SCLK_POST_EN
] = &mst_f_sclk_post_en
.hw
,
1037 [AUD_CLKID_MST_A_SCLK
] = &mst_a_sclk
.hw
,
1038 [AUD_CLKID_MST_B_SCLK
] = &mst_b_sclk
.hw
,
1039 [AUD_CLKID_MST_C_SCLK
] = &mst_c_sclk
.hw
,
1040 [AUD_CLKID_MST_D_SCLK
] = &mst_d_sclk
.hw
,
1041 [AUD_CLKID_MST_E_SCLK
] = &mst_e_sclk
.hw
,
1042 [AUD_CLKID_MST_F_SCLK
] = &mst_f_sclk
.hw
,
1043 [AUD_CLKID_MST_A_LRCLK_DIV
] = &mst_a_lrclk_div
.hw
,
1044 [AUD_CLKID_MST_B_LRCLK_DIV
] = &mst_b_lrclk_div
.hw
,
1045 [AUD_CLKID_MST_C_LRCLK_DIV
] = &mst_c_lrclk_div
.hw
,
1046 [AUD_CLKID_MST_D_LRCLK_DIV
] = &mst_d_lrclk_div
.hw
,
1047 [AUD_CLKID_MST_E_LRCLK_DIV
] = &mst_e_lrclk_div
.hw
,
1048 [AUD_CLKID_MST_F_LRCLK_DIV
] = &mst_f_lrclk_div
.hw
,
1049 [AUD_CLKID_MST_A_LRCLK
] = &mst_a_lrclk
.hw
,
1050 [AUD_CLKID_MST_B_LRCLK
] = &mst_b_lrclk
.hw
,
1051 [AUD_CLKID_MST_C_LRCLK
] = &mst_c_lrclk
.hw
,
1052 [AUD_CLKID_MST_D_LRCLK
] = &mst_d_lrclk
.hw
,
1053 [AUD_CLKID_MST_E_LRCLK
] = &mst_e_lrclk
.hw
,
1054 [AUD_CLKID_MST_F_LRCLK
] = &mst_f_lrclk
.hw
,
1055 [AUD_CLKID_TDMIN_A_SCLK_SEL
] = &tdmin_a_sclk_sel
.hw
,
1056 [AUD_CLKID_TDMIN_B_SCLK_SEL
] = &tdmin_b_sclk_sel
.hw
,
1057 [AUD_CLKID_TDMIN_C_SCLK_SEL
] = &tdmin_c_sclk_sel
.hw
,
1058 [AUD_CLKID_TDMIN_LB_SCLK_SEL
] = &tdmin_lb_sclk_sel
.hw
,
1059 [AUD_CLKID_TDMOUT_A_SCLK_SEL
] = &tdmout_a_sclk_sel
.hw
,
1060 [AUD_CLKID_TDMOUT_B_SCLK_SEL
] = &tdmout_b_sclk_sel
.hw
,
1061 [AUD_CLKID_TDMOUT_C_SCLK_SEL
] = &tdmout_c_sclk_sel
.hw
,
1062 [AUD_CLKID_TDMIN_A_SCLK_PRE_EN
] = &tdmin_a_sclk_pre_en
.hw
,
1063 [AUD_CLKID_TDMIN_B_SCLK_PRE_EN
] = &tdmin_b_sclk_pre_en
.hw
,
1064 [AUD_CLKID_TDMIN_C_SCLK_PRE_EN
] = &tdmin_c_sclk_pre_en
.hw
,
1065 [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN
] = &tdmin_lb_sclk_pre_en
.hw
,
1066 [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN
] = &tdmout_a_sclk_pre_en
.hw
,
1067 [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN
] = &tdmout_b_sclk_pre_en
.hw
,
1068 [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN
] = &tdmout_c_sclk_pre_en
.hw
,
1069 [AUD_CLKID_TDMIN_A_SCLK_POST_EN
] = &tdmin_a_sclk_post_en
.hw
,
1070 [AUD_CLKID_TDMIN_B_SCLK_POST_EN
] = &tdmin_b_sclk_post_en
.hw
,
1071 [AUD_CLKID_TDMIN_C_SCLK_POST_EN
] = &tdmin_c_sclk_post_en
.hw
,
1072 [AUD_CLKID_TDMIN_LB_SCLK_POST_EN
] = &tdmin_lb_sclk_post_en
.hw
,
1073 [AUD_CLKID_TDMOUT_A_SCLK_POST_EN
] = &tdmout_a_sclk_post_en
.hw
,
1074 [AUD_CLKID_TDMOUT_B_SCLK_POST_EN
] = &tdmout_b_sclk_post_en
.hw
,
1075 [AUD_CLKID_TDMOUT_C_SCLK_POST_EN
] = &tdmout_c_sclk_post_en
.hw
,
1076 [AUD_CLKID_TDMIN_A_SCLK
] = &tdmin_a_sclk
.hw
,
1077 [AUD_CLKID_TDMIN_B_SCLK
] = &tdmin_b_sclk
.hw
,
1078 [AUD_CLKID_TDMIN_C_SCLK
] = &tdmin_c_sclk
.hw
,
1079 [AUD_CLKID_TDMIN_LB_SCLK
] = &tdmin_lb_sclk
.hw
,
1080 [AUD_CLKID_TDMOUT_A_SCLK
] = &g12a_tdmout_a_sclk
.hw
,
1081 [AUD_CLKID_TDMOUT_B_SCLK
] = &g12a_tdmout_b_sclk
.hw
,
1082 [AUD_CLKID_TDMOUT_C_SCLK
] = &g12a_tdmout_c_sclk
.hw
,
1083 [AUD_CLKID_TDMIN_A_LRCLK
] = &tdmin_a_lrclk
.hw
,
1084 [AUD_CLKID_TDMIN_B_LRCLK
] = &tdmin_b_lrclk
.hw
,
1085 [AUD_CLKID_TDMIN_C_LRCLK
] = &tdmin_c_lrclk
.hw
,
1086 [AUD_CLKID_TDMIN_LB_LRCLK
] = &tdmin_lb_lrclk
.hw
,
1087 [AUD_CLKID_TDMOUT_A_LRCLK
] = &tdmout_a_lrclk
.hw
,
1088 [AUD_CLKID_TDMOUT_B_LRCLK
] = &tdmout_b_lrclk
.hw
,
1089 [AUD_CLKID_TDMOUT_C_LRCLK
] = &tdmout_c_lrclk
.hw
,
1090 [AUD_CLKID_TDM_MCLK_PAD0
] = &g12a_tdm_mclk_pad_0
.hw
,
1091 [AUD_CLKID_TDM_MCLK_PAD1
] = &g12a_tdm_mclk_pad_1
.hw
,
1092 [AUD_CLKID_TDM_LRCLK_PAD0
] = &g12a_tdm_lrclk_pad_0
.hw
,
1093 [AUD_CLKID_TDM_LRCLK_PAD1
] = &g12a_tdm_lrclk_pad_1
.hw
,
1094 [AUD_CLKID_TDM_LRCLK_PAD2
] = &g12a_tdm_lrclk_pad_2
.hw
,
1095 [AUD_CLKID_TDM_SCLK_PAD0
] = &g12a_tdm_sclk_pad_0
.hw
,
1096 [AUD_CLKID_TDM_SCLK_PAD1
] = &g12a_tdm_sclk_pad_1
.hw
,
1097 [AUD_CLKID_TDM_SCLK_PAD2
] = &g12a_tdm_sclk_pad_2
.hw
,
1098 [AUD_CLKID_TOP
] = &axg_aud_top
,
1102 * Array of all SM1 clocks provided by this provider
1103 * The input clocks of the controller will be populated at runtime
1105 static struct clk_hw
*sm1_audio_hw_clks
[] = {
1106 [AUD_CLKID_DDR_ARB
] = &ddr_arb
.hw
,
1107 [AUD_CLKID_PDM
] = &pdm
.hw
,
1108 [AUD_CLKID_TDMIN_A
] = &tdmin_a
.hw
,
1109 [AUD_CLKID_TDMIN_B
] = &tdmin_b
.hw
,
1110 [AUD_CLKID_TDMIN_C
] = &tdmin_c
.hw
,
1111 [AUD_CLKID_TDMIN_LB
] = &tdmin_lb
.hw
,
1112 [AUD_CLKID_TDMOUT_A
] = &tdmout_a
.hw
,
1113 [AUD_CLKID_TDMOUT_B
] = &tdmout_b
.hw
,
1114 [AUD_CLKID_TDMOUT_C
] = &tdmout_c
.hw
,
1115 [AUD_CLKID_FRDDR_A
] = &frddr_a
.hw
,
1116 [AUD_CLKID_FRDDR_B
] = &frddr_b
.hw
,
1117 [AUD_CLKID_FRDDR_C
] = &frddr_c
.hw
,
1118 [AUD_CLKID_TODDR_A
] = &toddr_a
.hw
,
1119 [AUD_CLKID_TODDR_B
] = &toddr_b
.hw
,
1120 [AUD_CLKID_TODDR_C
] = &toddr_c
.hw
,
1121 [AUD_CLKID_LOOPBACK
] = &loopback
.hw
,
1122 [AUD_CLKID_SPDIFIN
] = &spdifin
.hw
,
1123 [AUD_CLKID_SPDIFOUT
] = &spdifout
.hw
,
1124 [AUD_CLKID_RESAMPLE
] = &resample
.hw
,
1125 [AUD_CLKID_SPDIFOUT_B
] = &spdifout_b
.hw
,
1126 [AUD_CLKID_MST_A_MCLK_SEL
] = &sm1_mst_a_mclk_sel
.hw
,
1127 [AUD_CLKID_MST_B_MCLK_SEL
] = &sm1_mst_b_mclk_sel
.hw
,
1128 [AUD_CLKID_MST_C_MCLK_SEL
] = &sm1_mst_c_mclk_sel
.hw
,
1129 [AUD_CLKID_MST_D_MCLK_SEL
] = &sm1_mst_d_mclk_sel
.hw
,
1130 [AUD_CLKID_MST_E_MCLK_SEL
] = &sm1_mst_e_mclk_sel
.hw
,
1131 [AUD_CLKID_MST_F_MCLK_SEL
] = &sm1_mst_f_mclk_sel
.hw
,
1132 [AUD_CLKID_MST_A_MCLK_DIV
] = &sm1_mst_a_mclk_div
.hw
,
1133 [AUD_CLKID_MST_B_MCLK_DIV
] = &sm1_mst_b_mclk_div
.hw
,
1134 [AUD_CLKID_MST_C_MCLK_DIV
] = &sm1_mst_c_mclk_div
.hw
,
1135 [AUD_CLKID_MST_D_MCLK_DIV
] = &sm1_mst_d_mclk_div
.hw
,
1136 [AUD_CLKID_MST_E_MCLK_DIV
] = &sm1_mst_e_mclk_div
.hw
,
1137 [AUD_CLKID_MST_F_MCLK_DIV
] = &sm1_mst_f_mclk_div
.hw
,
1138 [AUD_CLKID_MST_A_MCLK
] = &sm1_mst_a_mclk
.hw
,
1139 [AUD_CLKID_MST_B_MCLK
] = &sm1_mst_b_mclk
.hw
,
1140 [AUD_CLKID_MST_C_MCLK
] = &sm1_mst_c_mclk
.hw
,
1141 [AUD_CLKID_MST_D_MCLK
] = &sm1_mst_d_mclk
.hw
,
1142 [AUD_CLKID_MST_E_MCLK
] = &sm1_mst_e_mclk
.hw
,
1143 [AUD_CLKID_MST_F_MCLK
] = &sm1_mst_f_mclk
.hw
,
1144 [AUD_CLKID_SPDIFOUT_CLK_SEL
] = &spdifout_clk_sel
.hw
,
1145 [AUD_CLKID_SPDIFOUT_CLK_DIV
] = &spdifout_clk_div
.hw
,
1146 [AUD_CLKID_SPDIFOUT_CLK
] = &spdifout_clk
.hw
,
1147 [AUD_CLKID_SPDIFOUT_B_CLK_SEL
] = &spdifout_b_clk_sel
.hw
,
1148 [AUD_CLKID_SPDIFOUT_B_CLK_DIV
] = &spdifout_b_clk_div
.hw
,
1149 [AUD_CLKID_SPDIFOUT_B_CLK
] = &spdifout_b_clk
.hw
,
1150 [AUD_CLKID_SPDIFIN_CLK_SEL
] = &spdifin_clk_sel
.hw
,
1151 [AUD_CLKID_SPDIFIN_CLK_DIV
] = &spdifin_clk_div
.hw
,
1152 [AUD_CLKID_SPDIFIN_CLK
] = &spdifin_clk
.hw
,
1153 [AUD_CLKID_PDM_DCLK_SEL
] = &pdm_dclk_sel
.hw
,
1154 [AUD_CLKID_PDM_DCLK_DIV
] = &pdm_dclk_div
.hw
,
1155 [AUD_CLKID_PDM_DCLK
] = &pdm_dclk
.hw
,
1156 [AUD_CLKID_PDM_SYSCLK_SEL
] = &pdm_sysclk_sel
.hw
,
1157 [AUD_CLKID_PDM_SYSCLK_DIV
] = &pdm_sysclk_div
.hw
,
1158 [AUD_CLKID_PDM_SYSCLK
] = &pdm_sysclk
.hw
,
1159 [AUD_CLKID_MST_A_SCLK_PRE_EN
] = &mst_a_sclk_pre_en
.hw
,
1160 [AUD_CLKID_MST_B_SCLK_PRE_EN
] = &mst_b_sclk_pre_en
.hw
,
1161 [AUD_CLKID_MST_C_SCLK_PRE_EN
] = &mst_c_sclk_pre_en
.hw
,
1162 [AUD_CLKID_MST_D_SCLK_PRE_EN
] = &mst_d_sclk_pre_en
.hw
,
1163 [AUD_CLKID_MST_E_SCLK_PRE_EN
] = &mst_e_sclk_pre_en
.hw
,
1164 [AUD_CLKID_MST_F_SCLK_PRE_EN
] = &mst_f_sclk_pre_en
.hw
,
1165 [AUD_CLKID_MST_A_SCLK_DIV
] = &mst_a_sclk_div
.hw
,
1166 [AUD_CLKID_MST_B_SCLK_DIV
] = &mst_b_sclk_div
.hw
,
1167 [AUD_CLKID_MST_C_SCLK_DIV
] = &mst_c_sclk_div
.hw
,
1168 [AUD_CLKID_MST_D_SCLK_DIV
] = &mst_d_sclk_div
.hw
,
1169 [AUD_CLKID_MST_E_SCLK_DIV
] = &mst_e_sclk_div
.hw
,
1170 [AUD_CLKID_MST_F_SCLK_DIV
] = &mst_f_sclk_div
.hw
,
1171 [AUD_CLKID_MST_A_SCLK_POST_EN
] = &mst_a_sclk_post_en
.hw
,
1172 [AUD_CLKID_MST_B_SCLK_POST_EN
] = &mst_b_sclk_post_en
.hw
,
1173 [AUD_CLKID_MST_C_SCLK_POST_EN
] = &mst_c_sclk_post_en
.hw
,
1174 [AUD_CLKID_MST_D_SCLK_POST_EN
] = &mst_d_sclk_post_en
.hw
,
1175 [AUD_CLKID_MST_E_SCLK_POST_EN
] = &mst_e_sclk_post_en
.hw
,
1176 [AUD_CLKID_MST_F_SCLK_POST_EN
] = &mst_f_sclk_post_en
.hw
,
1177 [AUD_CLKID_MST_A_SCLK
] = &mst_a_sclk
.hw
,
1178 [AUD_CLKID_MST_B_SCLK
] = &mst_b_sclk
.hw
,
1179 [AUD_CLKID_MST_C_SCLK
] = &mst_c_sclk
.hw
,
1180 [AUD_CLKID_MST_D_SCLK
] = &mst_d_sclk
.hw
,
1181 [AUD_CLKID_MST_E_SCLK
] = &mst_e_sclk
.hw
,
1182 [AUD_CLKID_MST_F_SCLK
] = &mst_f_sclk
.hw
,
1183 [AUD_CLKID_MST_A_LRCLK_DIV
] = &mst_a_lrclk_div
.hw
,
1184 [AUD_CLKID_MST_B_LRCLK_DIV
] = &mst_b_lrclk_div
.hw
,
1185 [AUD_CLKID_MST_C_LRCLK_DIV
] = &mst_c_lrclk_div
.hw
,
1186 [AUD_CLKID_MST_D_LRCLK_DIV
] = &mst_d_lrclk_div
.hw
,
1187 [AUD_CLKID_MST_E_LRCLK_DIV
] = &mst_e_lrclk_div
.hw
,
1188 [AUD_CLKID_MST_F_LRCLK_DIV
] = &mst_f_lrclk_div
.hw
,
1189 [AUD_CLKID_MST_A_LRCLK
] = &mst_a_lrclk
.hw
,
1190 [AUD_CLKID_MST_B_LRCLK
] = &mst_b_lrclk
.hw
,
1191 [AUD_CLKID_MST_C_LRCLK
] = &mst_c_lrclk
.hw
,
1192 [AUD_CLKID_MST_D_LRCLK
] = &mst_d_lrclk
.hw
,
1193 [AUD_CLKID_MST_E_LRCLK
] = &mst_e_lrclk
.hw
,
1194 [AUD_CLKID_MST_F_LRCLK
] = &mst_f_lrclk
.hw
,
1195 [AUD_CLKID_TDMIN_A_SCLK_SEL
] = &tdmin_a_sclk_sel
.hw
,
1196 [AUD_CLKID_TDMIN_B_SCLK_SEL
] = &tdmin_b_sclk_sel
.hw
,
1197 [AUD_CLKID_TDMIN_C_SCLK_SEL
] = &tdmin_c_sclk_sel
.hw
,
1198 [AUD_CLKID_TDMIN_LB_SCLK_SEL
] = &tdmin_lb_sclk_sel
.hw
,
1199 [AUD_CLKID_TDMOUT_A_SCLK_SEL
] = &tdmout_a_sclk_sel
.hw
,
1200 [AUD_CLKID_TDMOUT_B_SCLK_SEL
] = &tdmout_b_sclk_sel
.hw
,
1201 [AUD_CLKID_TDMOUT_C_SCLK_SEL
] = &tdmout_c_sclk_sel
.hw
,
1202 [AUD_CLKID_TDMIN_A_SCLK_PRE_EN
] = &tdmin_a_sclk_pre_en
.hw
,
1203 [AUD_CLKID_TDMIN_B_SCLK_PRE_EN
] = &tdmin_b_sclk_pre_en
.hw
,
1204 [AUD_CLKID_TDMIN_C_SCLK_PRE_EN
] = &tdmin_c_sclk_pre_en
.hw
,
1205 [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN
] = &tdmin_lb_sclk_pre_en
.hw
,
1206 [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN
] = &tdmout_a_sclk_pre_en
.hw
,
1207 [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN
] = &tdmout_b_sclk_pre_en
.hw
,
1208 [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN
] = &tdmout_c_sclk_pre_en
.hw
,
1209 [AUD_CLKID_TDMIN_A_SCLK_POST_EN
] = &tdmin_a_sclk_post_en
.hw
,
1210 [AUD_CLKID_TDMIN_B_SCLK_POST_EN
] = &tdmin_b_sclk_post_en
.hw
,
1211 [AUD_CLKID_TDMIN_C_SCLK_POST_EN
] = &tdmin_c_sclk_post_en
.hw
,
1212 [AUD_CLKID_TDMIN_LB_SCLK_POST_EN
] = &tdmin_lb_sclk_post_en
.hw
,
1213 [AUD_CLKID_TDMOUT_A_SCLK_POST_EN
] = &tdmout_a_sclk_post_en
.hw
,
1214 [AUD_CLKID_TDMOUT_B_SCLK_POST_EN
] = &tdmout_b_sclk_post_en
.hw
,
1215 [AUD_CLKID_TDMOUT_C_SCLK_POST_EN
] = &tdmout_c_sclk_post_en
.hw
,
1216 [AUD_CLKID_TDMIN_A_SCLK
] = &tdmin_a_sclk
.hw
,
1217 [AUD_CLKID_TDMIN_B_SCLK
] = &tdmin_b_sclk
.hw
,
1218 [AUD_CLKID_TDMIN_C_SCLK
] = &tdmin_c_sclk
.hw
,
1219 [AUD_CLKID_TDMIN_LB_SCLK
] = &tdmin_lb_sclk
.hw
,
1220 [AUD_CLKID_TDMOUT_A_SCLK
] = &g12a_tdmout_a_sclk
.hw
,
1221 [AUD_CLKID_TDMOUT_B_SCLK
] = &g12a_tdmout_b_sclk
.hw
,
1222 [AUD_CLKID_TDMOUT_C_SCLK
] = &g12a_tdmout_c_sclk
.hw
,
1223 [AUD_CLKID_TDMIN_A_LRCLK
] = &tdmin_a_lrclk
.hw
,
1224 [AUD_CLKID_TDMIN_B_LRCLK
] = &tdmin_b_lrclk
.hw
,
1225 [AUD_CLKID_TDMIN_C_LRCLK
] = &tdmin_c_lrclk
.hw
,
1226 [AUD_CLKID_TDMIN_LB_LRCLK
] = &tdmin_lb_lrclk
.hw
,
1227 [AUD_CLKID_TDMOUT_A_LRCLK
] = &tdmout_a_lrclk
.hw
,
1228 [AUD_CLKID_TDMOUT_B_LRCLK
] = &tdmout_b_lrclk
.hw
,
1229 [AUD_CLKID_TDMOUT_C_LRCLK
] = &tdmout_c_lrclk
.hw
,
1230 [AUD_CLKID_TDM_MCLK_PAD0
] = &sm1_tdm_mclk_pad_0
.hw
,
1231 [AUD_CLKID_TDM_MCLK_PAD1
] = &sm1_tdm_mclk_pad_1
.hw
,
1232 [AUD_CLKID_TDM_LRCLK_PAD0
] = &sm1_tdm_lrclk_pad_0
.hw
,
1233 [AUD_CLKID_TDM_LRCLK_PAD1
] = &sm1_tdm_lrclk_pad_1
.hw
,
1234 [AUD_CLKID_TDM_LRCLK_PAD2
] = &sm1_tdm_lrclk_pad_2
.hw
,
1235 [AUD_CLKID_TDM_SCLK_PAD0
] = &sm1_tdm_sclk_pad_0
.hw
,
1236 [AUD_CLKID_TDM_SCLK_PAD1
] = &sm1_tdm_sclk_pad_1
.hw
,
1237 [AUD_CLKID_TDM_SCLK_PAD2
] = &sm1_tdm_sclk_pad_2
.hw
,
1238 [AUD_CLKID_TOP
] = &sm1_aud_top
.hw
,
1239 [AUD_CLKID_TORAM
] = &toram
.hw
,
1240 [AUD_CLKID_EQDRC
] = &eqdrc
.hw
,
1241 [AUD_CLKID_RESAMPLE_B
] = &resample_b
.hw
,
1242 [AUD_CLKID_TOVAD
] = &tovad
.hw
,
1243 [AUD_CLKID_LOCKER
] = &locker
.hw
,
1244 [AUD_CLKID_SPDIFIN_LB
] = &spdifin_lb
.hw
,
1245 [AUD_CLKID_FRDDR_D
] = &frddr_d
.hw
,
1246 [AUD_CLKID_TODDR_D
] = &toddr_d
.hw
,
1247 [AUD_CLKID_LOOPBACK_B
] = &loopback_b
.hw
,
1248 [AUD_CLKID_CLK81_EN
] = &sm1_clk81_en
.hw
,
1249 [AUD_CLKID_SYSCLK_A_DIV
] = &sm1_sysclk_a_div
.hw
,
1250 [AUD_CLKID_SYSCLK_A_EN
] = &sm1_sysclk_a_en
.hw
,
1251 [AUD_CLKID_SYSCLK_B_DIV
] = &sm1_sysclk_b_div
.hw
,
1252 [AUD_CLKID_SYSCLK_B_EN
] = &sm1_sysclk_b_en
.hw
,
1253 [AUD_CLKID_EARCRX
] = &earcrx
.hw
,
1254 [AUD_CLKID_EARCRX_CMDC_SEL
] = &sm1_earcrx_cmdc_clk_sel
.hw
,
1255 [AUD_CLKID_EARCRX_CMDC_DIV
] = &sm1_earcrx_cmdc_clk_div
.hw
,
1256 [AUD_CLKID_EARCRX_CMDC
] = &sm1_earcrx_cmdc_clk
.hw
,
1257 [AUD_CLKID_EARCRX_DMAC_SEL
] = &sm1_earcrx_dmac_clk_sel
.hw
,
1258 [AUD_CLKID_EARCRX_DMAC_DIV
] = &sm1_earcrx_dmac_clk_div
.hw
,
1259 [AUD_CLKID_EARCRX_DMAC
] = &sm1_earcrx_dmac_clk
.hw
,
1263 /* Convenience table to populate regmap in .probe(). */
1264 static struct clk_regmap
*const axg_clk_regmaps
[] = {
1327 &mst_a_sclk_post_en
,
1328 &mst_b_sclk_post_en
,
1329 &mst_c_sclk_post_en
,
1330 &mst_d_sclk_post_en
,
1331 &mst_e_sclk_post_en
,
1332 &mst_f_sclk_post_en
,
1358 &tdmin_a_sclk_pre_en
,
1359 &tdmin_b_sclk_pre_en
,
1360 &tdmin_c_sclk_pre_en
,
1361 &tdmin_lb_sclk_pre_en
,
1362 &tdmout_a_sclk_pre_en
,
1363 &tdmout_b_sclk_pre_en
,
1364 &tdmout_c_sclk_pre_en
,
1365 &tdmin_a_sclk_post_en
,
1366 &tdmin_b_sclk_post_en
,
1367 &tdmin_c_sclk_post_en
,
1368 &tdmin_lb_sclk_post_en
,
1369 &tdmout_a_sclk_post_en
,
1370 &tdmout_b_sclk_post_en
,
1371 &tdmout_c_sclk_post_en
,
1388 static struct clk_regmap
*const g12a_clk_regmaps
[] = {
1452 &mst_a_sclk_post_en
,
1453 &mst_b_sclk_post_en
,
1454 &mst_c_sclk_post_en
,
1455 &mst_d_sclk_post_en
,
1456 &mst_e_sclk_post_en
,
1457 &mst_f_sclk_post_en
,
1483 &tdmin_a_sclk_pre_en
,
1484 &tdmin_b_sclk_pre_en
,
1485 &tdmin_c_sclk_pre_en
,
1486 &tdmin_lb_sclk_pre_en
,
1487 &tdmout_a_sclk_pre_en
,
1488 &tdmout_b_sclk_pre_en
,
1489 &tdmout_c_sclk_pre_en
,
1490 &tdmin_a_sclk_post_en
,
1491 &tdmin_b_sclk_post_en
,
1492 &tdmin_c_sclk_post_en
,
1493 &tdmin_lb_sclk_post_en
,
1494 &tdmout_a_sclk_post_en
,
1495 &tdmout_b_sclk_post_en
,
1496 &tdmout_c_sclk_post_en
,
1501 &g12a_tdmout_a_sclk
,
1502 &g12a_tdmout_b_sclk
,
1503 &g12a_tdmout_c_sclk
,
1511 &spdifout_b_clk_sel
,
1512 &spdifout_b_clk_div
,
1514 &g12a_tdm_mclk_pad_0
,
1515 &g12a_tdm_mclk_pad_1
,
1516 &g12a_tdm_lrclk_pad_0
,
1517 &g12a_tdm_lrclk_pad_1
,
1518 &g12a_tdm_lrclk_pad_2
,
1519 &g12a_tdm_sclk_pad_0
,
1520 &g12a_tdm_sclk_pad_1
,
1521 &g12a_tdm_sclk_pad_2
,
1526 static struct clk_regmap
*const sm1_clk_regmaps
[] = {
1547 &sm1_mst_a_mclk_sel
,
1548 &sm1_mst_b_mclk_sel
,
1549 &sm1_mst_c_mclk_sel
,
1550 &sm1_mst_d_mclk_sel
,
1551 &sm1_mst_e_mclk_sel
,
1552 &sm1_mst_f_mclk_sel
,
1553 &sm1_mst_a_mclk_div
,
1554 &sm1_mst_b_mclk_div
,
1555 &sm1_mst_c_mclk_div
,
1556 &sm1_mst_d_mclk_div
,
1557 &sm1_mst_e_mclk_div
,
1558 &sm1_mst_f_mclk_div
,
1589 &mst_a_sclk_post_en
,
1590 &mst_b_sclk_post_en
,
1591 &mst_c_sclk_post_en
,
1592 &mst_d_sclk_post_en
,
1593 &mst_e_sclk_post_en
,
1594 &mst_f_sclk_post_en
,
1620 &tdmin_a_sclk_pre_en
,
1621 &tdmin_b_sclk_pre_en
,
1622 &tdmin_c_sclk_pre_en
,
1623 &tdmin_lb_sclk_pre_en
,
1624 &tdmout_a_sclk_pre_en
,
1625 &tdmout_b_sclk_pre_en
,
1626 &tdmout_c_sclk_pre_en
,
1627 &tdmin_a_sclk_post_en
,
1628 &tdmin_b_sclk_post_en
,
1629 &tdmin_c_sclk_post_en
,
1630 &tdmin_lb_sclk_post_en
,
1631 &tdmout_a_sclk_post_en
,
1632 &tdmout_b_sclk_post_en
,
1633 &tdmout_c_sclk_post_en
,
1638 &g12a_tdmout_a_sclk
,
1639 &g12a_tdmout_b_sclk
,
1640 &g12a_tdmout_c_sclk
,
1648 &spdifout_b_clk_sel
,
1649 &spdifout_b_clk_div
,
1651 &sm1_tdm_mclk_pad_0
,
1652 &sm1_tdm_mclk_pad_1
,
1653 &sm1_tdm_lrclk_pad_0
,
1654 &sm1_tdm_lrclk_pad_1
,
1655 &sm1_tdm_lrclk_pad_2
,
1656 &sm1_tdm_sclk_pad_0
,
1657 &sm1_tdm_sclk_pad_1
,
1658 &sm1_tdm_sclk_pad_2
,
1675 &sm1_earcrx_cmdc_clk_sel
,
1676 &sm1_earcrx_cmdc_clk_div
,
1677 &sm1_earcrx_cmdc_clk
,
1678 &sm1_earcrx_dmac_clk_sel
,
1679 &sm1_earcrx_dmac_clk_div
,
1680 &sm1_earcrx_dmac_clk
,
1683 static struct regmap_config axg_audio_regmap_cfg
= {
1689 struct audioclk_data
{
1690 struct clk_regmap
*const *regmap_clks
;
1691 unsigned int regmap_clk_num
;
1692 struct meson_clk_hw_data hw_clks
;
1693 unsigned int max_register
;
1694 const char *rst_drvname
;
1697 static int axg_audio_clkc_probe(struct platform_device
*pdev
)
1699 struct device
*dev
= &pdev
->dev
;
1700 const struct audioclk_data
*data
;
1707 data
= of_device_get_match_data(dev
);
1711 regs
= devm_platform_ioremap_resource(pdev
, 0);
1713 return PTR_ERR(regs
);
1715 axg_audio_regmap_cfg
.max_register
= data
->max_register
;
1716 map
= devm_regmap_init_mmio(dev
, regs
, &axg_audio_regmap_cfg
);
1718 dev_err(dev
, "failed to init regmap: %ld\n", PTR_ERR(map
));
1719 return PTR_ERR(map
);
1722 /* Get the mandatory peripheral clock */
1723 clk
= devm_clk_get_enabled(dev
, "pclk");
1725 return PTR_ERR(clk
);
1727 ret
= device_reset(dev
);
1729 dev_err_probe(dev
, ret
, "failed to reset device\n");
1733 /* Populate regmap for the regmap backed clocks */
1734 for (i
= 0; i
< data
->regmap_clk_num
; i
++)
1735 data
->regmap_clks
[i
]->map
= map
;
1737 /* Take care to skip the registered input clocks */
1738 for (i
= AUD_CLKID_DDR_ARB
; i
< data
->hw_clks
.num
; i
++) {
1741 hw
= data
->hw_clks
.hws
[i
];
1742 /* array might be sparse */
1746 name
= hw
->init
->name
;
1748 ret
= devm_clk_hw_register(dev
, hw
);
1750 dev_err(dev
, "failed to register clock %s\n", name
);
1755 ret
= devm_of_clk_add_hw_provider(dev
, meson_clk_hw_get
, (void *)&data
->hw_clks
);
1759 /* Register auxiliary reset driver when applicable */
1760 if (data
->rst_drvname
)
1761 ret
= devm_meson_rst_aux_register(dev
, map
, data
->rst_drvname
);
1766 static const struct audioclk_data axg_audioclk_data
= {
1767 .regmap_clks
= axg_clk_regmaps
,
1768 .regmap_clk_num
= ARRAY_SIZE(axg_clk_regmaps
),
1770 .hws
= axg_audio_hw_clks
,
1771 .num
= ARRAY_SIZE(axg_audio_hw_clks
),
1773 .max_register
= AUDIO_CLK_PDMIN_CTRL1
,
1776 static const struct audioclk_data g12a_audioclk_data
= {
1777 .regmap_clks
= g12a_clk_regmaps
,
1778 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
1780 .hws
= g12a_audio_hw_clks
,
1781 .num
= ARRAY_SIZE(g12a_audio_hw_clks
),
1783 .max_register
= AUDIO_CLK_SPDIFOUT_B_CTRL
,
1784 .rst_drvname
= "rst-g12a",
1787 static const struct audioclk_data sm1_audioclk_data
= {
1788 .regmap_clks
= sm1_clk_regmaps
,
1789 .regmap_clk_num
= ARRAY_SIZE(sm1_clk_regmaps
),
1791 .hws
= sm1_audio_hw_clks
,
1792 .num
= ARRAY_SIZE(sm1_audio_hw_clks
),
1794 .max_register
= AUDIO_EARCRX_DMAC_CLK_CTRL
,
1795 .rst_drvname
= "rst-sm1",
1798 static const struct of_device_id clkc_match_table
[] = {
1800 .compatible
= "amlogic,axg-audio-clkc",
1801 .data
= &axg_audioclk_data
1803 .compatible
= "amlogic,g12a-audio-clkc",
1804 .data
= &g12a_audioclk_data
1806 .compatible
= "amlogic,sm1-audio-clkc",
1807 .data
= &sm1_audioclk_data
1810 MODULE_DEVICE_TABLE(of
, clkc_match_table
);
1812 static struct platform_driver axg_audio_driver
= {
1813 .probe
= axg_audio_clkc_probe
,
1815 .name
= "axg-audio-clkc",
1816 .of_match_table
= clkc_match_table
,
1819 module_platform_driver(axg_audio_driver
);
1821 MODULE_DESCRIPTION("Amlogic AXG/G12A/SM1 Audio Clock driver");
1822 MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
1823 MODULE_LICENSE("GPL");
1824 MODULE_IMPORT_NS(CLK_MESON
);