11cd50181SJerome Brunet // SPDX-License-Identifier: (GPL-2.0 OR MIT)
21cd50181SJerome Brunet /*
31cd50181SJerome Brunet * Copyright (c) 2018 BayLibre, SAS.
41cd50181SJerome Brunet * Author: Jerome Brunet <jbrunet@baylibre.com>
51cd50181SJerome Brunet */
61cd50181SJerome Brunet
71cd50181SJerome Brunet #include <linux/clk.h>
81cd50181SJerome Brunet #include <linux/clk-provider.h>
91cd50181SJerome Brunet #include <linux/init.h>
101cd50181SJerome Brunet #include <linux/module.h>
11a96cbb14SRob Herring #include <linux/of.h>
121cd50181SJerome Brunet #include <linux/platform_device.h>
131cd50181SJerome Brunet #include <linux/regmap.h>
141cd50181SJerome Brunet #include <linux/reset.h>
157cfefab6SJerome Brunet #include <linux/reset-controller.h>
161cd50181SJerome Brunet #include <linux/slab.h>
171cd50181SJerome Brunet
1805d3b7c6SNeil Armstrong #include "meson-clkc-utils.h"
191cd50181SJerome Brunet #include "axg-audio.h"
20889c2b7eSJerome Brunet #include "clk-regmap.h"
21889c2b7eSJerome Brunet #include "clk-phase.h"
22889c2b7eSJerome Brunet #include "sclk-div.h"
231cd50181SJerome Brunet
2446382631SNeil Armstrong #include <dt-bindings/clock/axg-audio-clkc.h>
2546382631SNeil Armstrong
268ff93f28SJerome Brunet #define AUD_GATE(_name, _reg, _bit, _pname, _iflags) { \
271cd50181SJerome Brunet .data = &(struct clk_regmap_gate_data){ \
281cd50181SJerome Brunet .offset = (_reg), \
291cd50181SJerome Brunet .bit_idx = (_bit), \
301cd50181SJerome Brunet }, \
311cd50181SJerome Brunet .hw.init = &(struct clk_init_data) { \
32b18819c4SJerome Brunet .name = "aud_"#_name, \
331cd50181SJerome Brunet .ops = &clk_regmap_gate_ops, \
348ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \
351cd50181SJerome Brunet .num_parents = 1, \
361cd50181SJerome Brunet .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \
371cd50181SJerome Brunet }, \
381cd50181SJerome Brunet }
391cd50181SJerome Brunet
408ff93f28SJerome Brunet #define AUD_MUX(_name, _reg, _mask, _shift, _dflags, _pdata, _iflags) { \
411cd50181SJerome Brunet .data = &(struct clk_regmap_mux_data){ \
421cd50181SJerome Brunet .offset = (_reg), \
431cd50181SJerome Brunet .mask = (_mask), \
441cd50181SJerome Brunet .shift = (_shift), \
451cd50181SJerome Brunet .flags = (_dflags), \
461cd50181SJerome Brunet }, \
471cd50181SJerome Brunet .hw.init = &(struct clk_init_data){ \
48b18819c4SJerome Brunet .name = "aud_"#_name, \
491cd50181SJerome Brunet .ops = &clk_regmap_mux_ops, \
50282420eeSAlexandre Mergnat .parent_data = _pdata, \
51282420eeSAlexandre Mergnat .num_parents = ARRAY_SIZE(_pdata), \
521cd50181SJerome Brunet .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \
531cd50181SJerome Brunet }, \
541cd50181SJerome Brunet }
551cd50181SJerome Brunet
568ff93f28SJerome Brunet #define AUD_DIV(_name, _reg, _shift, _width, _dflags, _pname, _iflags) { \
571cd50181SJerome Brunet .data = &(struct clk_regmap_div_data){ \
581cd50181SJerome Brunet .offset = (_reg), \
591cd50181SJerome Brunet .shift = (_shift), \
601cd50181SJerome Brunet .width = (_width), \
611cd50181SJerome Brunet .flags = (_dflags), \
621cd50181SJerome Brunet }, \
631cd50181SJerome Brunet .hw.init = &(struct clk_init_data){ \
64b18819c4SJerome Brunet .name = "aud_"#_name, \
651cd50181SJerome Brunet .ops = &clk_regmap_divider_ops, \
668ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \
671cd50181SJerome Brunet .num_parents = 1, \
681cd50181SJerome Brunet .flags = (_iflags), \
691cd50181SJerome Brunet }, \
701cd50181SJerome Brunet }
711cd50181SJerome Brunet
72be4fe445SJerome Brunet #define AUD_PCLK_GATE(_name, _reg, _bit) { \
73282420eeSAlexandre Mergnat .data = &(struct clk_regmap_gate_data){ \
74be4fe445SJerome Brunet .offset = (_reg), \
75282420eeSAlexandre Mergnat .bit_idx = (_bit), \
76282420eeSAlexandre Mergnat }, \
77282420eeSAlexandre Mergnat .hw.init = &(struct clk_init_data) { \
78282420eeSAlexandre Mergnat .name = "aud_"#_name, \
79282420eeSAlexandre Mergnat .ops = &clk_regmap_gate_ops, \
80cf52db45SJerome Brunet .parent_names = (const char *[]){ "aud_top" }, \
81282420eeSAlexandre Mergnat .num_parents = 1, \
82282420eeSAlexandre Mergnat }, \
83282420eeSAlexandre Mergnat }
841cd50181SJerome Brunet
85b18819c4SJerome Brunet #define AUD_SCLK_DIV(_name, _reg, _div_shift, _div_width, \
868ff93f28SJerome Brunet _hi_shift, _hi_width, _pname, _iflags) { \
871cd50181SJerome Brunet .data = &(struct meson_sclk_div_data) { \
881cd50181SJerome Brunet .div = { \
891cd50181SJerome Brunet .reg_off = (_reg), \
901cd50181SJerome Brunet .shift = (_div_shift), \
911cd50181SJerome Brunet .width = (_div_width), \
921cd50181SJerome Brunet }, \
931cd50181SJerome Brunet .hi = { \
941cd50181SJerome Brunet .reg_off = (_reg), \
951cd50181SJerome Brunet .shift = (_hi_shift), \
961cd50181SJerome Brunet .width = (_hi_width), \
971cd50181SJerome Brunet }, \
981cd50181SJerome Brunet }, \
991cd50181SJerome Brunet .hw.init = &(struct clk_init_data) { \
100b18819c4SJerome Brunet .name = "aud_"#_name, \
1011cd50181SJerome Brunet .ops = &meson_sclk_div_ops, \
1028ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \
1031cd50181SJerome Brunet .num_parents = 1, \
1041cd50181SJerome Brunet .flags = (_iflags), \
1051cd50181SJerome Brunet }, \
1061cd50181SJerome Brunet }
1071cd50181SJerome Brunet
108b18819c4SJerome Brunet #define AUD_TRIPHASE(_name, _reg, _width, _shift0, _shift1, _shift2, \
1098ff93f28SJerome Brunet _pname, _iflags) { \
1101cd50181SJerome Brunet .data = &(struct meson_clk_triphase_data) { \
1111cd50181SJerome Brunet .ph0 = { \
1121cd50181SJerome Brunet .reg_off = (_reg), \
1131cd50181SJerome Brunet .shift = (_shift0), \
1141cd50181SJerome Brunet .width = (_width), \
1151cd50181SJerome Brunet }, \
1161cd50181SJerome Brunet .ph1 = { \
1171cd50181SJerome Brunet .reg_off = (_reg), \
1181cd50181SJerome Brunet .shift = (_shift1), \
1191cd50181SJerome Brunet .width = (_width), \
1201cd50181SJerome Brunet }, \
1211cd50181SJerome Brunet .ph2 = { \
1221cd50181SJerome Brunet .reg_off = (_reg), \
1231cd50181SJerome Brunet .shift = (_shift2), \
1241cd50181SJerome Brunet .width = (_width), \
1251cd50181SJerome Brunet }, \
1261cd50181SJerome Brunet }, \
1271cd50181SJerome Brunet .hw.init = &(struct clk_init_data) { \
128b18819c4SJerome Brunet .name = "aud_"#_name, \
1291cd50181SJerome Brunet .ops = &meson_clk_triphase_ops, \
1308ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \
1311cd50181SJerome Brunet .num_parents = 1, \
1321cd50181SJerome Brunet .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \
1331cd50181SJerome Brunet }, \
1341cd50181SJerome Brunet }
1351cd50181SJerome Brunet
1368ff93f28SJerome Brunet #define AUD_PHASE(_name, _reg, _width, _shift, _pname, _iflags) { \
1378ff93f28SJerome Brunet .data = &(struct meson_clk_phase_data) { \
1388ff93f28SJerome Brunet .ph = { \
1398ff93f28SJerome Brunet .reg_off = (_reg), \
1408ff93f28SJerome Brunet .shift = (_shift), \
1418ff93f28SJerome Brunet .width = (_width), \
1428ff93f28SJerome Brunet }, \
1438ff93f28SJerome Brunet }, \
1448ff93f28SJerome Brunet .hw.init = &(struct clk_init_data) { \
1458ff93f28SJerome Brunet .name = "aud_"#_name, \
1468ff93f28SJerome Brunet .ops = &meson_clk_phase_ops, \
1478ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \
1488ff93f28SJerome Brunet .num_parents = 1, \
1498ff93f28SJerome Brunet .flags = (_iflags), \
1508ff93f28SJerome Brunet }, \
1518ff93f28SJerome Brunet }
1528ff93f28SJerome Brunet
1534fd433fdSJerome Brunet #define AUD_SCLK_WS(_name, _reg, _width, _shift_ph, _shift_ws, _pname, \
1544fd433fdSJerome Brunet _iflags) { \
1554fd433fdSJerome Brunet .data = &(struct meson_sclk_ws_inv_data) { \
1564fd433fdSJerome Brunet .ph = { \
1574fd433fdSJerome Brunet .reg_off = (_reg), \
1584fd433fdSJerome Brunet .shift = (_shift_ph), \
1594fd433fdSJerome Brunet .width = (_width), \
1604fd433fdSJerome Brunet }, \
1614fd433fdSJerome Brunet .ws = { \
1624fd433fdSJerome Brunet .reg_off = (_reg), \
1634fd433fdSJerome Brunet .shift = (_shift_ws), \
1644fd433fdSJerome Brunet .width = (_width), \
1654fd433fdSJerome Brunet }, \
1664fd433fdSJerome Brunet }, \
1674fd433fdSJerome Brunet .hw.init = &(struct clk_init_data) { \
1684fd433fdSJerome Brunet .name = "aud_"#_name, \
1694fd433fdSJerome Brunet .ops = &meson_clk_phase_ops, \
1704fd433fdSJerome Brunet .parent_names = (const char *[]){ #_pname }, \
1714fd433fdSJerome Brunet .num_parents = 1, \
1724fd433fdSJerome Brunet .flags = (_iflags), \
1734fd433fdSJerome Brunet }, \
1744fd433fdSJerome Brunet }
1754fd433fdSJerome Brunet
1768ff93f28SJerome Brunet /* Audio Master Clocks */
1778ff93f28SJerome Brunet static const struct clk_parent_data mst_mux_parent_data[] = {
1788ff93f28SJerome Brunet { .fw_name = "mst_in0", },
1798ff93f28SJerome Brunet { .fw_name = "mst_in1", },
1808ff93f28SJerome Brunet { .fw_name = "mst_in2", },
1818ff93f28SJerome Brunet { .fw_name = "mst_in3", },
1828ff93f28SJerome Brunet { .fw_name = "mst_in4", },
1838ff93f28SJerome Brunet { .fw_name = "mst_in5", },
1848ff93f28SJerome Brunet { .fw_name = "mst_in6", },
1858ff93f28SJerome Brunet { .fw_name = "mst_in7", },
1868ff93f28SJerome Brunet };
1878ff93f28SJerome Brunet
1888ff93f28SJerome Brunet #define AUD_MST_MUX(_name, _reg, _flag) \
1898ff93f28SJerome Brunet AUD_MUX(_name##_sel, _reg, 0x7, 24, _flag, \
1908ff93f28SJerome Brunet mst_mux_parent_data, 0)
1918ff93f28SJerome Brunet #define AUD_MST_DIV(_name, _reg, _flag) \
1928ff93f28SJerome Brunet AUD_DIV(_name##_div, _reg, 0, 16, _flag, \
1938ff93f28SJerome Brunet aud_##_name##_sel, CLK_SET_RATE_PARENT)
1948ff93f28SJerome Brunet #define AUD_MST_MCLK_GATE(_name, _reg) \
1958ff93f28SJerome Brunet AUD_GATE(_name, _reg, 31, aud_##_name##_div, \
1968ff93f28SJerome Brunet CLK_SET_RATE_PARENT)
1978ff93f28SJerome Brunet
1988ff93f28SJerome Brunet #define AUD_MST_MCLK_MUX(_name, _reg) \
1998ff93f28SJerome Brunet AUD_MST_MUX(_name, _reg, CLK_MUX_ROUND_CLOSEST)
2008ff93f28SJerome Brunet #define AUD_MST_MCLK_DIV(_name, _reg) \
2018ff93f28SJerome Brunet AUD_MST_DIV(_name, _reg, CLK_DIVIDER_ROUND_CLOSEST)
2028ff93f28SJerome Brunet
2038ff93f28SJerome Brunet #define AUD_MST_SYS_MUX(_name, _reg) \
2048ff93f28SJerome Brunet AUD_MST_MUX(_name, _reg, 0)
2058ff93f28SJerome Brunet #define AUD_MST_SYS_DIV(_name, _reg) \
2068ff93f28SJerome Brunet AUD_MST_DIV(_name, _reg, 0)
2078ff93f28SJerome Brunet
2088ff93f28SJerome Brunet /* Sample Clocks */
2098ff93f28SJerome Brunet #define AUD_MST_SCLK_PRE_EN(_name, _reg) \
2108ff93f28SJerome Brunet AUD_GATE(mst_##_name##_sclk_pre_en, _reg, 31, \
2118ff93f28SJerome Brunet aud_mst_##_name##_mclk, 0)
2128ff93f28SJerome Brunet #define AUD_MST_SCLK_DIV(_name, _reg) \
2138ff93f28SJerome Brunet AUD_SCLK_DIV(mst_##_name##_sclk_div, _reg, 20, 10, 0, 0, \
2148ff93f28SJerome Brunet aud_mst_##_name##_sclk_pre_en, \
2158ff93f28SJerome Brunet CLK_SET_RATE_PARENT)
2168ff93f28SJerome Brunet #define AUD_MST_SCLK_POST_EN(_name, _reg) \
2178ff93f28SJerome Brunet AUD_GATE(mst_##_name##_sclk_post_en, _reg, 30, \
2188ff93f28SJerome Brunet aud_mst_##_name##_sclk_div, CLK_SET_RATE_PARENT)
219b18819c4SJerome Brunet #define AUD_MST_SCLK(_name, _reg) \
220b18819c4SJerome Brunet AUD_TRIPHASE(mst_##_name##_sclk, _reg, 1, 0, 2, 4, \
221282420eeSAlexandre Mergnat aud_mst_##_name##_sclk_post_en, CLK_SET_RATE_PARENT)
2221cd50181SJerome Brunet
223b18819c4SJerome Brunet #define AUD_MST_LRCLK_DIV(_name, _reg) \
224b18819c4SJerome Brunet AUD_SCLK_DIV(mst_##_name##_lrclk_div, _reg, 0, 10, 10, 10, \
2258ff93f28SJerome Brunet aud_mst_##_name##_sclk_post_en, 0)
226b18819c4SJerome Brunet #define AUD_MST_LRCLK(_name, _reg) \
227b18819c4SJerome Brunet AUD_TRIPHASE(mst_##_name##_lrclk, _reg, 1, 1, 3, 5, \
228282420eeSAlexandre Mergnat aud_mst_##_name##_lrclk_div, CLK_SET_RATE_PARENT)
2291cd50181SJerome Brunet
2308ff93f28SJerome Brunet /* TDM bit clock sources */
231282420eeSAlexandre Mergnat static const struct clk_parent_data tdm_sclk_parent_data[] = {
2328ff93f28SJerome Brunet { .name = "aud_mst_a_sclk", .index = -1, },
2338ff93f28SJerome Brunet { .name = "aud_mst_b_sclk", .index = -1, },
2348ff93f28SJerome Brunet { .name = "aud_mst_c_sclk", .index = -1, },
2358ff93f28SJerome Brunet { .name = "aud_mst_d_sclk", .index = -1, },
2368ff93f28SJerome Brunet { .name = "aud_mst_e_sclk", .index = -1, },
2378ff93f28SJerome Brunet { .name = "aud_mst_f_sclk", .index = -1, },
238282420eeSAlexandre Mergnat { .fw_name = "slv_sclk0", },
239282420eeSAlexandre Mergnat { .fw_name = "slv_sclk1", },
240282420eeSAlexandre Mergnat { .fw_name = "slv_sclk2", },
241282420eeSAlexandre Mergnat { .fw_name = "slv_sclk3", },
242282420eeSAlexandre Mergnat { .fw_name = "slv_sclk4", },
243282420eeSAlexandre Mergnat { .fw_name = "slv_sclk5", },
244282420eeSAlexandre Mergnat { .fw_name = "slv_sclk6", },
245282420eeSAlexandre Mergnat { .fw_name = "slv_sclk7", },
246282420eeSAlexandre Mergnat { .fw_name = "slv_sclk8", },
247282420eeSAlexandre Mergnat { .fw_name = "slv_sclk9", },
2481cd50181SJerome Brunet };
2491cd50181SJerome Brunet
2508ff93f28SJerome Brunet /* TDM sample clock sources */
251282420eeSAlexandre Mergnat static const struct clk_parent_data tdm_lrclk_parent_data[] = {
2528ff93f28SJerome Brunet { .name = "aud_mst_a_lrclk", .index = -1, },
2538ff93f28SJerome Brunet { .name = "aud_mst_b_lrclk", .index = -1, },
2548ff93f28SJerome Brunet { .name = "aud_mst_c_lrclk", .index = -1, },
2558ff93f28SJerome Brunet { .name = "aud_mst_d_lrclk", .index = -1, },
2568ff93f28SJerome Brunet { .name = "aud_mst_e_lrclk", .index = -1, },
2578ff93f28SJerome Brunet { .name = "aud_mst_f_lrclk", .index = -1, },
258282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk0", },
259282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk1", },
260282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk2", },
261282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk3", },
262282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk4", },
263282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk5", },
264282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk6", },
265282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk7", },
266282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk8", },
267282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk9", },
2681cd50181SJerome Brunet };
2691cd50181SJerome Brunet
2708ff93f28SJerome Brunet #define AUD_TDM_SCLK_MUX(_name, _reg) \
2718ff93f28SJerome Brunet AUD_MUX(tdm##_name##_sclk_sel, _reg, 0xf, 24, \
2728ff93f28SJerome Brunet CLK_MUX_ROUND_CLOSEST, tdm_sclk_parent_data, 0)
2738ff93f28SJerome Brunet #define AUD_TDM_SCLK_PRE_EN(_name, _reg) \
2748ff93f28SJerome Brunet AUD_GATE(tdm##_name##_sclk_pre_en, _reg, 31, \
2758ff93f28SJerome Brunet aud_tdm##_name##_sclk_sel, CLK_SET_RATE_PARENT)
2768ff93f28SJerome Brunet #define AUD_TDM_SCLK_POST_EN(_name, _reg) \
2778ff93f28SJerome Brunet AUD_GATE(tdm##_name##_sclk_post_en, _reg, 30, \
2788ff93f28SJerome Brunet aud_tdm##_name##_sclk_pre_en, CLK_SET_RATE_PARENT)
2798ff93f28SJerome Brunet #define AUD_TDM_SCLK(_name, _reg) \
2808ff93f28SJerome Brunet AUD_PHASE(tdm##_name##_sclk, _reg, 1, 29, \
2818ff93f28SJerome Brunet aud_tdm##_name##_sclk_post_en, \
2828ff93f28SJerome Brunet CLK_DUTY_CYCLE_PARENT | CLK_SET_RATE_PARENT)
2834fd433fdSJerome Brunet #define AUD_TDM_SCLK_WS(_name, _reg) \
2844fd433fdSJerome Brunet AUD_SCLK_WS(tdm##_name##_sclk, _reg, 1, 29, 28, \
2854fd433fdSJerome Brunet aud_tdm##_name##_sclk_post_en, \
2864fd433fdSJerome Brunet CLK_DUTY_CYCLE_PARENT | CLK_SET_RATE_PARENT)
2878ff93f28SJerome Brunet
288b18819c4SJerome Brunet #define AUD_TDM_LRLCK(_name, _reg) \
289b18819c4SJerome Brunet AUD_MUX(tdm##_name##_lrclk, _reg, 0xf, 20, \
2908ff93f28SJerome Brunet CLK_MUX_ROUND_CLOSEST, tdm_lrclk_parent_data, 0)
2911cd50181SJerome Brunet
2928ff93f28SJerome Brunet /* Pad master clock sources */
2938ff93f28SJerome Brunet static const struct clk_parent_data mclk_pad_ctrl_parent_data[] = {
2948ff93f28SJerome Brunet { .name = "aud_mst_a_mclk", .index = -1, },
2958ff93f28SJerome Brunet { .name = "aud_mst_b_mclk", .index = -1, },
2968ff93f28SJerome Brunet { .name = "aud_mst_c_mclk", .index = -1, },
2978ff93f28SJerome Brunet { .name = "aud_mst_d_mclk", .index = -1, },
2988ff93f28SJerome Brunet { .name = "aud_mst_e_mclk", .index = -1, },
2998ff93f28SJerome Brunet { .name = "aud_mst_f_mclk", .index = -1, },
3008ff93f28SJerome Brunet };
3011cd50181SJerome Brunet
3028ff93f28SJerome Brunet /* Pad bit clock sources */
3038ff93f28SJerome Brunet static const struct clk_parent_data sclk_pad_ctrl_parent_data[] = {
3048ff93f28SJerome Brunet { .name = "aud_mst_a_sclk", .index = -1, },
3058ff93f28SJerome Brunet { .name = "aud_mst_b_sclk", .index = -1, },
3068ff93f28SJerome Brunet { .name = "aud_mst_c_sclk", .index = -1, },
3078ff93f28SJerome Brunet { .name = "aud_mst_d_sclk", .index = -1, },
3088ff93f28SJerome Brunet { .name = "aud_mst_e_sclk", .index = -1, },
3098ff93f28SJerome Brunet { .name = "aud_mst_f_sclk", .index = -1, },
3108ff93f28SJerome Brunet };
3118ff93f28SJerome Brunet
3128ff93f28SJerome Brunet /* Pad sample clock sources */
3138ff93f28SJerome Brunet static const struct clk_parent_data lrclk_pad_ctrl_parent_data[] = {
3148ff93f28SJerome Brunet { .name = "aud_mst_a_lrclk", .index = -1, },
3158ff93f28SJerome Brunet { .name = "aud_mst_b_lrclk", .index = -1, },
3168ff93f28SJerome Brunet { .name = "aud_mst_c_lrclk", .index = -1, },
3178ff93f28SJerome Brunet { .name = "aud_mst_d_lrclk", .index = -1, },
3188ff93f28SJerome Brunet { .name = "aud_mst_e_lrclk", .index = -1, },
3198ff93f28SJerome Brunet { .name = "aud_mst_f_lrclk", .index = -1, },
3208ff93f28SJerome Brunet };
3218ff93f28SJerome Brunet
32207500138SMaxime Jourdan #define AUD_TDM_PAD_CTRL(_name, _reg, _shift, _parents) \
323be4fe445SJerome Brunet AUD_MUX(_name, _reg, 0x7, _shift, 0, _parents, \
32407500138SMaxime Jourdan CLK_SET_RATE_NO_REPARENT)
32507500138SMaxime Jourdan
3268ff93f28SJerome Brunet /* Common Clocks */
327be4fe445SJerome Brunet static struct clk_regmap ddr_arb =
328be4fe445SJerome Brunet AUD_PCLK_GATE(ddr_arb, AUDIO_CLK_GATE_EN, 0);
329be4fe445SJerome Brunet static struct clk_regmap pdm =
330be4fe445SJerome Brunet AUD_PCLK_GATE(pdm, AUDIO_CLK_GATE_EN, 1);
331be4fe445SJerome Brunet static struct clk_regmap tdmin_a =
332be4fe445SJerome Brunet AUD_PCLK_GATE(tdmin_a, AUDIO_CLK_GATE_EN, 2);
333be4fe445SJerome Brunet static struct clk_regmap tdmin_b =
334be4fe445SJerome Brunet AUD_PCLK_GATE(tdmin_b, AUDIO_CLK_GATE_EN, 3);
335be4fe445SJerome Brunet static struct clk_regmap tdmin_c =
336be4fe445SJerome Brunet AUD_PCLK_GATE(tdmin_c, AUDIO_CLK_GATE_EN, 4);
337be4fe445SJerome Brunet static struct clk_regmap tdmin_lb =
338be4fe445SJerome Brunet AUD_PCLK_GATE(tdmin_lb, AUDIO_CLK_GATE_EN, 5);
339be4fe445SJerome Brunet static struct clk_regmap tdmout_a =
340be4fe445SJerome Brunet AUD_PCLK_GATE(tdmout_a, AUDIO_CLK_GATE_EN, 6);
341be4fe445SJerome Brunet static struct clk_regmap tdmout_b =
342be4fe445SJerome Brunet AUD_PCLK_GATE(tdmout_b, AUDIO_CLK_GATE_EN, 7);
343be4fe445SJerome Brunet static struct clk_regmap tdmout_c =
344be4fe445SJerome Brunet AUD_PCLK_GATE(tdmout_c, AUDIO_CLK_GATE_EN, 8);
345be4fe445SJerome Brunet static struct clk_regmap frddr_a =
346be4fe445SJerome Brunet AUD_PCLK_GATE(frddr_a, AUDIO_CLK_GATE_EN, 9);
347be4fe445SJerome Brunet static struct clk_regmap frddr_b =
348be4fe445SJerome Brunet AUD_PCLK_GATE(frddr_b, AUDIO_CLK_GATE_EN, 10);
349be4fe445SJerome Brunet static struct clk_regmap frddr_c =
350be4fe445SJerome Brunet AUD_PCLK_GATE(frddr_c, AUDIO_CLK_GATE_EN, 11);
351be4fe445SJerome Brunet static struct clk_regmap toddr_a =
352be4fe445SJerome Brunet AUD_PCLK_GATE(toddr_a, AUDIO_CLK_GATE_EN, 12);
353be4fe445SJerome Brunet static struct clk_regmap toddr_b =
354be4fe445SJerome Brunet AUD_PCLK_GATE(toddr_b, AUDIO_CLK_GATE_EN, 13);
355be4fe445SJerome Brunet static struct clk_regmap toddr_c =
356be4fe445SJerome Brunet AUD_PCLK_GATE(toddr_c, AUDIO_CLK_GATE_EN, 14);
357be4fe445SJerome Brunet static struct clk_regmap loopback =
358be4fe445SJerome Brunet AUD_PCLK_GATE(loopback, AUDIO_CLK_GATE_EN, 15);
359be4fe445SJerome Brunet static struct clk_regmap spdifin =
360be4fe445SJerome Brunet AUD_PCLK_GATE(spdifin, AUDIO_CLK_GATE_EN, 16);
361be4fe445SJerome Brunet static struct clk_regmap spdifout =
362be4fe445SJerome Brunet AUD_PCLK_GATE(spdifout, AUDIO_CLK_GATE_EN, 17);
363be4fe445SJerome Brunet static struct clk_regmap resample =
364be4fe445SJerome Brunet AUD_PCLK_GATE(resample, AUDIO_CLK_GATE_EN, 18);
365be4fe445SJerome Brunet static struct clk_regmap power_detect =
366be4fe445SJerome Brunet AUD_PCLK_GATE(power_detect, AUDIO_CLK_GATE_EN, 19);
36707500138SMaxime Jourdan
3688ff93f28SJerome Brunet static struct clk_regmap spdifout_clk_sel =
3698ff93f28SJerome Brunet AUD_MST_MCLK_MUX(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL);
3708ff93f28SJerome Brunet static struct clk_regmap pdm_dclk_sel =
3718ff93f28SJerome Brunet AUD_MST_MCLK_MUX(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0);
3728ff93f28SJerome Brunet static struct clk_regmap spdifin_clk_sel =
3738ff93f28SJerome Brunet AUD_MST_SYS_MUX(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL);
3748ff93f28SJerome Brunet static struct clk_regmap pdm_sysclk_sel =
3758ff93f28SJerome Brunet AUD_MST_SYS_MUX(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1);
3768ff93f28SJerome Brunet static struct clk_regmap spdifout_b_clk_sel =
3778ff93f28SJerome Brunet AUD_MST_MCLK_MUX(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL);
37807500138SMaxime Jourdan
3798ff93f28SJerome Brunet static struct clk_regmap spdifout_clk_div =
3808ff93f28SJerome Brunet AUD_MST_MCLK_DIV(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL);
3818ff93f28SJerome Brunet static struct clk_regmap pdm_dclk_div =
3828ff93f28SJerome Brunet AUD_MST_MCLK_DIV(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0);
3838ff93f28SJerome Brunet static struct clk_regmap spdifin_clk_div =
3848ff93f28SJerome Brunet AUD_MST_SYS_DIV(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL);
3858ff93f28SJerome Brunet static struct clk_regmap pdm_sysclk_div =
3868ff93f28SJerome Brunet AUD_MST_SYS_DIV(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1);
3878ff93f28SJerome Brunet static struct clk_regmap spdifout_b_clk_div =
3888ff93f28SJerome Brunet AUD_MST_MCLK_DIV(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL);
38907500138SMaxime Jourdan
3908ff93f28SJerome Brunet static struct clk_regmap spdifout_clk =
3918ff93f28SJerome Brunet AUD_MST_MCLK_GATE(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL);
3928ff93f28SJerome Brunet static struct clk_regmap spdifin_clk =
3938ff93f28SJerome Brunet AUD_MST_MCLK_GATE(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL);
3948ff93f28SJerome Brunet static struct clk_regmap pdm_dclk =
3958ff93f28SJerome Brunet AUD_MST_MCLK_GATE(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0);
3968ff93f28SJerome Brunet static struct clk_regmap pdm_sysclk =
3978ff93f28SJerome Brunet AUD_MST_MCLK_GATE(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1);
3988ff93f28SJerome Brunet static struct clk_regmap spdifout_b_clk =
3998ff93f28SJerome Brunet AUD_MST_MCLK_GATE(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL);
40007500138SMaxime Jourdan
4018ff93f28SJerome Brunet static struct clk_regmap mst_a_sclk_pre_en =
4028ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(a, AUDIO_MST_A_SCLK_CTRL0);
4038ff93f28SJerome Brunet static struct clk_regmap mst_b_sclk_pre_en =
4048ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(b, AUDIO_MST_B_SCLK_CTRL0);
4058ff93f28SJerome Brunet static struct clk_regmap mst_c_sclk_pre_en =
4068ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(c, AUDIO_MST_C_SCLK_CTRL0);
4078ff93f28SJerome Brunet static struct clk_regmap mst_d_sclk_pre_en =
4088ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(d, AUDIO_MST_D_SCLK_CTRL0);
4098ff93f28SJerome Brunet static struct clk_regmap mst_e_sclk_pre_en =
4108ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(e, AUDIO_MST_E_SCLK_CTRL0);
4118ff93f28SJerome Brunet static struct clk_regmap mst_f_sclk_pre_en =
4128ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(f, AUDIO_MST_F_SCLK_CTRL0);
41307500138SMaxime Jourdan
4148ff93f28SJerome Brunet static struct clk_regmap mst_a_sclk_div =
4158ff93f28SJerome Brunet AUD_MST_SCLK_DIV(a, AUDIO_MST_A_SCLK_CTRL0);
4168ff93f28SJerome Brunet static struct clk_regmap mst_b_sclk_div =
4178ff93f28SJerome Brunet AUD_MST_SCLK_DIV(b, AUDIO_MST_B_SCLK_CTRL0);
4188ff93f28SJerome Brunet static struct clk_regmap mst_c_sclk_div =
4198ff93f28SJerome Brunet AUD_MST_SCLK_DIV(c, AUDIO_MST_C_SCLK_CTRL0);
4208ff93f28SJerome Brunet static struct clk_regmap mst_d_sclk_div =
4218ff93f28SJerome Brunet AUD_MST_SCLK_DIV(d, AUDIO_MST_D_SCLK_CTRL0);
4228ff93f28SJerome Brunet static struct clk_regmap mst_e_sclk_div =
4238ff93f28SJerome Brunet AUD_MST_SCLK_DIV(e, AUDIO_MST_E_SCLK_CTRL0);
4248ff93f28SJerome Brunet static struct clk_regmap mst_f_sclk_div =
4258ff93f28SJerome Brunet AUD_MST_SCLK_DIV(f, AUDIO_MST_F_SCLK_CTRL0);
4268ff93f28SJerome Brunet
4278ff93f28SJerome Brunet static struct clk_regmap mst_a_sclk_post_en =
4288ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(a, AUDIO_MST_A_SCLK_CTRL0);
4298ff93f28SJerome Brunet static struct clk_regmap mst_b_sclk_post_en =
4308ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(b, AUDIO_MST_B_SCLK_CTRL0);
4318ff93f28SJerome Brunet static struct clk_regmap mst_c_sclk_post_en =
4328ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(c, AUDIO_MST_C_SCLK_CTRL0);
4338ff93f28SJerome Brunet static struct clk_regmap mst_d_sclk_post_en =
4348ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(d, AUDIO_MST_D_SCLK_CTRL0);
4358ff93f28SJerome Brunet static struct clk_regmap mst_e_sclk_post_en =
4368ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(e, AUDIO_MST_E_SCLK_CTRL0);
4378ff93f28SJerome Brunet static struct clk_regmap mst_f_sclk_post_en =
4388ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(f, AUDIO_MST_F_SCLK_CTRL0);
4398ff93f28SJerome Brunet
4408ff93f28SJerome Brunet static struct clk_regmap mst_a_sclk =
4418ff93f28SJerome Brunet AUD_MST_SCLK(a, AUDIO_MST_A_SCLK_CTRL1);
4428ff93f28SJerome Brunet static struct clk_regmap mst_b_sclk =
4438ff93f28SJerome Brunet AUD_MST_SCLK(b, AUDIO_MST_B_SCLK_CTRL1);
4448ff93f28SJerome Brunet static struct clk_regmap mst_c_sclk =
4458ff93f28SJerome Brunet AUD_MST_SCLK(c, AUDIO_MST_C_SCLK_CTRL1);
4468ff93f28SJerome Brunet static struct clk_regmap mst_d_sclk =
4478ff93f28SJerome Brunet AUD_MST_SCLK(d, AUDIO_MST_D_SCLK_CTRL1);
4488ff93f28SJerome Brunet static struct clk_regmap mst_e_sclk =
4498ff93f28SJerome Brunet AUD_MST_SCLK(e, AUDIO_MST_E_SCLK_CTRL1);
4508ff93f28SJerome Brunet static struct clk_regmap mst_f_sclk =
4518ff93f28SJerome Brunet AUD_MST_SCLK(f, AUDIO_MST_F_SCLK_CTRL1);
4528ff93f28SJerome Brunet
4538ff93f28SJerome Brunet static struct clk_regmap mst_a_lrclk_div =
4548ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(a, AUDIO_MST_A_SCLK_CTRL0);
4558ff93f28SJerome Brunet static struct clk_regmap mst_b_lrclk_div =
4568ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(b, AUDIO_MST_B_SCLK_CTRL0);
4578ff93f28SJerome Brunet static struct clk_regmap mst_c_lrclk_div =
4588ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(c, AUDIO_MST_C_SCLK_CTRL0);
4598ff93f28SJerome Brunet static struct clk_regmap mst_d_lrclk_div =
4608ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(d, AUDIO_MST_D_SCLK_CTRL0);
4618ff93f28SJerome Brunet static struct clk_regmap mst_e_lrclk_div =
4628ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(e, AUDIO_MST_E_SCLK_CTRL0);
4638ff93f28SJerome Brunet static struct clk_regmap mst_f_lrclk_div =
4648ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(f, AUDIO_MST_F_SCLK_CTRL0);
4658ff93f28SJerome Brunet
4668ff93f28SJerome Brunet static struct clk_regmap mst_a_lrclk =
4678ff93f28SJerome Brunet AUD_MST_LRCLK(a, AUDIO_MST_A_SCLK_CTRL1);
4688ff93f28SJerome Brunet static struct clk_regmap mst_b_lrclk =
4698ff93f28SJerome Brunet AUD_MST_LRCLK(b, AUDIO_MST_B_SCLK_CTRL1);
4708ff93f28SJerome Brunet static struct clk_regmap mst_c_lrclk =
4718ff93f28SJerome Brunet AUD_MST_LRCLK(c, AUDIO_MST_C_SCLK_CTRL1);
4728ff93f28SJerome Brunet static struct clk_regmap mst_d_lrclk =
4738ff93f28SJerome Brunet AUD_MST_LRCLK(d, AUDIO_MST_D_SCLK_CTRL1);
4748ff93f28SJerome Brunet static struct clk_regmap mst_e_lrclk =
4758ff93f28SJerome Brunet AUD_MST_LRCLK(e, AUDIO_MST_E_SCLK_CTRL1);
4768ff93f28SJerome Brunet static struct clk_regmap mst_f_lrclk =
4778ff93f28SJerome Brunet AUD_MST_LRCLK(f, AUDIO_MST_F_SCLK_CTRL1);
4788ff93f28SJerome Brunet
4798ff93f28SJerome Brunet static struct clk_regmap tdmin_a_sclk_sel =
4808ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(in_a, AUDIO_CLK_TDMIN_A_CTRL);
4818ff93f28SJerome Brunet static struct clk_regmap tdmin_b_sclk_sel =
4828ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(in_b, AUDIO_CLK_TDMIN_B_CTRL);
4838ff93f28SJerome Brunet static struct clk_regmap tdmin_c_sclk_sel =
4848ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(in_c, AUDIO_CLK_TDMIN_C_CTRL);
4858ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_sclk_sel =
4868ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(in_lb, AUDIO_CLK_TDMIN_LB_CTRL);
4878ff93f28SJerome Brunet static struct clk_regmap tdmout_a_sclk_sel =
4888ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(out_a, AUDIO_CLK_TDMOUT_A_CTRL);
4898ff93f28SJerome Brunet static struct clk_regmap tdmout_b_sclk_sel =
4908ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(out_b, AUDIO_CLK_TDMOUT_B_CTRL);
4918ff93f28SJerome Brunet static struct clk_regmap tdmout_c_sclk_sel =
4928ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(out_c, AUDIO_CLK_TDMOUT_C_CTRL);
4938ff93f28SJerome Brunet
4948ff93f28SJerome Brunet static struct clk_regmap tdmin_a_sclk_pre_en =
4958ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(in_a, AUDIO_CLK_TDMIN_A_CTRL);
4968ff93f28SJerome Brunet static struct clk_regmap tdmin_b_sclk_pre_en =
4978ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(in_b, AUDIO_CLK_TDMIN_B_CTRL);
4988ff93f28SJerome Brunet static struct clk_regmap tdmin_c_sclk_pre_en =
4998ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(in_c, AUDIO_CLK_TDMIN_C_CTRL);
5008ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_sclk_pre_en =
5018ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(in_lb, AUDIO_CLK_TDMIN_LB_CTRL);
5028ff93f28SJerome Brunet static struct clk_regmap tdmout_a_sclk_pre_en =
5038ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(out_a, AUDIO_CLK_TDMOUT_A_CTRL);
5048ff93f28SJerome Brunet static struct clk_regmap tdmout_b_sclk_pre_en =
5058ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(out_b, AUDIO_CLK_TDMOUT_B_CTRL);
5068ff93f28SJerome Brunet static struct clk_regmap tdmout_c_sclk_pre_en =
5078ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(out_c, AUDIO_CLK_TDMOUT_C_CTRL);
5088ff93f28SJerome Brunet
5098ff93f28SJerome Brunet static struct clk_regmap tdmin_a_sclk_post_en =
5108ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(in_a, AUDIO_CLK_TDMIN_A_CTRL);
5118ff93f28SJerome Brunet static struct clk_regmap tdmin_b_sclk_post_en =
5128ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(in_b, AUDIO_CLK_TDMIN_B_CTRL);
5138ff93f28SJerome Brunet static struct clk_regmap tdmin_c_sclk_post_en =
5148ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(in_c, AUDIO_CLK_TDMIN_C_CTRL);
5158ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_sclk_post_en =
5168ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(in_lb, AUDIO_CLK_TDMIN_LB_CTRL);
5178ff93f28SJerome Brunet static struct clk_regmap tdmout_a_sclk_post_en =
5188ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(out_a, AUDIO_CLK_TDMOUT_A_CTRL);
5198ff93f28SJerome Brunet static struct clk_regmap tdmout_b_sclk_post_en =
5208ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(out_b, AUDIO_CLK_TDMOUT_B_CTRL);
5218ff93f28SJerome Brunet static struct clk_regmap tdmout_c_sclk_post_en =
5228ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(out_c, AUDIO_CLK_TDMOUT_C_CTRL);
5238ff93f28SJerome Brunet
5248ff93f28SJerome Brunet static struct clk_regmap tdmin_a_sclk =
5258ff93f28SJerome Brunet AUD_TDM_SCLK(in_a, AUDIO_CLK_TDMIN_A_CTRL);
5268ff93f28SJerome Brunet static struct clk_regmap tdmin_b_sclk =
5278ff93f28SJerome Brunet AUD_TDM_SCLK(in_b, AUDIO_CLK_TDMIN_B_CTRL);
5288ff93f28SJerome Brunet static struct clk_regmap tdmin_c_sclk =
5298ff93f28SJerome Brunet AUD_TDM_SCLK(in_c, AUDIO_CLK_TDMIN_C_CTRL);
5308ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_sclk =
5318ff93f28SJerome Brunet AUD_TDM_SCLK(in_lb, AUDIO_CLK_TDMIN_LB_CTRL);
5328ff93f28SJerome Brunet
5338ff93f28SJerome Brunet static struct clk_regmap tdmin_a_lrclk =
5348ff93f28SJerome Brunet AUD_TDM_LRLCK(in_a, AUDIO_CLK_TDMIN_A_CTRL);
5358ff93f28SJerome Brunet static struct clk_regmap tdmin_b_lrclk =
5368ff93f28SJerome Brunet AUD_TDM_LRLCK(in_b, AUDIO_CLK_TDMIN_B_CTRL);
5378ff93f28SJerome Brunet static struct clk_regmap tdmin_c_lrclk =
5388ff93f28SJerome Brunet AUD_TDM_LRLCK(in_c, AUDIO_CLK_TDMIN_C_CTRL);
5398ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_lrclk =
5408ff93f28SJerome Brunet AUD_TDM_LRLCK(in_lb, AUDIO_CLK_TDMIN_LB_CTRL);
5418ff93f28SJerome Brunet static struct clk_regmap tdmout_a_lrclk =
5428ff93f28SJerome Brunet AUD_TDM_LRLCK(out_a, AUDIO_CLK_TDMOUT_A_CTRL);
5438ff93f28SJerome Brunet static struct clk_regmap tdmout_b_lrclk =
5448ff93f28SJerome Brunet AUD_TDM_LRLCK(out_b, AUDIO_CLK_TDMOUT_B_CTRL);
5458ff93f28SJerome Brunet static struct clk_regmap tdmout_c_lrclk =
5468ff93f28SJerome Brunet AUD_TDM_LRLCK(out_c, AUDIO_CLK_TDMOUT_C_CTRL);
5478ff93f28SJerome Brunet
5484fd433fdSJerome Brunet /* AXG Clocks */
5494fd433fdSJerome Brunet static struct clk_regmap axg_tdmout_a_sclk =
5504fd433fdSJerome Brunet AUD_TDM_SCLK(out_a, AUDIO_CLK_TDMOUT_A_CTRL);
5514fd433fdSJerome Brunet static struct clk_regmap axg_tdmout_b_sclk =
5524fd433fdSJerome Brunet AUD_TDM_SCLK(out_b, AUDIO_CLK_TDMOUT_B_CTRL);
5534fd433fdSJerome Brunet static struct clk_regmap axg_tdmout_c_sclk =
5544fd433fdSJerome Brunet AUD_TDM_SCLK(out_c, AUDIO_CLK_TDMOUT_C_CTRL);
5554fd433fdSJerome Brunet
5568ff93f28SJerome Brunet /* AXG/G12A Clocks */
557cf52db45SJerome Brunet static struct clk_hw axg_aud_top = {
558cf52db45SJerome Brunet .init = &(struct clk_init_data) {
559cf52db45SJerome Brunet /* Provide aud_top signal name on axg and g12a */
560cf52db45SJerome Brunet .name = "aud_top",
561cf52db45SJerome Brunet .ops = &(const struct clk_ops) {},
562cf52db45SJerome Brunet .parent_data = &(const struct clk_parent_data) {
563cf52db45SJerome Brunet .fw_name = "pclk",
564cf52db45SJerome Brunet },
565cf52db45SJerome Brunet .num_parents = 1,
566cf52db45SJerome Brunet },
567cf52db45SJerome Brunet };
568cf52db45SJerome Brunet
5698ff93f28SJerome Brunet static struct clk_regmap mst_a_mclk_sel =
5708ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_a_mclk, AUDIO_MCLK_A_CTRL);
5718ff93f28SJerome Brunet static struct clk_regmap mst_b_mclk_sel =
5728ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_b_mclk, AUDIO_MCLK_B_CTRL);
5738ff93f28SJerome Brunet static struct clk_regmap mst_c_mclk_sel =
5748ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_c_mclk, AUDIO_MCLK_C_CTRL);
5758ff93f28SJerome Brunet static struct clk_regmap mst_d_mclk_sel =
5768ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_d_mclk, AUDIO_MCLK_D_CTRL);
5778ff93f28SJerome Brunet static struct clk_regmap mst_e_mclk_sel =
5788ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_e_mclk, AUDIO_MCLK_E_CTRL);
5798ff93f28SJerome Brunet static struct clk_regmap mst_f_mclk_sel =
5808ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_f_mclk, AUDIO_MCLK_F_CTRL);
5818ff93f28SJerome Brunet
5828ff93f28SJerome Brunet static struct clk_regmap mst_a_mclk_div =
5838ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_a_mclk, AUDIO_MCLK_A_CTRL);
5848ff93f28SJerome Brunet static struct clk_regmap mst_b_mclk_div =
5858ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_b_mclk, AUDIO_MCLK_B_CTRL);
5868ff93f28SJerome Brunet static struct clk_regmap mst_c_mclk_div =
5878ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_c_mclk, AUDIO_MCLK_C_CTRL);
5888ff93f28SJerome Brunet static struct clk_regmap mst_d_mclk_div =
5898ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_d_mclk, AUDIO_MCLK_D_CTRL);
5908ff93f28SJerome Brunet static struct clk_regmap mst_e_mclk_div =
5918ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_e_mclk, AUDIO_MCLK_E_CTRL);
5928ff93f28SJerome Brunet static struct clk_regmap mst_f_mclk_div =
5938ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_f_mclk, AUDIO_MCLK_F_CTRL);
5948ff93f28SJerome Brunet
5958ff93f28SJerome Brunet static struct clk_regmap mst_a_mclk =
5968ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_a_mclk, AUDIO_MCLK_A_CTRL);
5978ff93f28SJerome Brunet static struct clk_regmap mst_b_mclk =
5988ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_b_mclk, AUDIO_MCLK_B_CTRL);
5998ff93f28SJerome Brunet static struct clk_regmap mst_c_mclk =
6008ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_c_mclk, AUDIO_MCLK_C_CTRL);
6018ff93f28SJerome Brunet static struct clk_regmap mst_d_mclk =
6028ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_d_mclk, AUDIO_MCLK_D_CTRL);
6038ff93f28SJerome Brunet static struct clk_regmap mst_e_mclk =
6048ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_e_mclk, AUDIO_MCLK_E_CTRL);
6058ff93f28SJerome Brunet static struct clk_regmap mst_f_mclk =
6068ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_f_mclk, AUDIO_MCLK_F_CTRL);
6078ff93f28SJerome Brunet
6088ff93f28SJerome Brunet /* G12a clocks */
6098ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_mclk_pad_0 = AUD_TDM_PAD_CTRL(
6108ff93f28SJerome Brunet mclk_pad_0, AUDIO_MST_PAD_CTRL0, 0, mclk_pad_ctrl_parent_data);
6118ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_mclk_pad_1 = AUD_TDM_PAD_CTRL(
6128ff93f28SJerome Brunet mclk_pad_1, AUDIO_MST_PAD_CTRL0, 4, mclk_pad_ctrl_parent_data);
6138ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_lrclk_pad_0 = AUD_TDM_PAD_CTRL(
6148ff93f28SJerome Brunet lrclk_pad_0, AUDIO_MST_PAD_CTRL1, 16, lrclk_pad_ctrl_parent_data);
6158ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_lrclk_pad_1 = AUD_TDM_PAD_CTRL(
6168ff93f28SJerome Brunet lrclk_pad_1, AUDIO_MST_PAD_CTRL1, 20, lrclk_pad_ctrl_parent_data);
6178ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_lrclk_pad_2 = AUD_TDM_PAD_CTRL(
6188ff93f28SJerome Brunet lrclk_pad_2, AUDIO_MST_PAD_CTRL1, 24, lrclk_pad_ctrl_parent_data);
6198ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_sclk_pad_0 = AUD_TDM_PAD_CTRL(
6208ff93f28SJerome Brunet sclk_pad_0, AUDIO_MST_PAD_CTRL1, 0, sclk_pad_ctrl_parent_data);
6218ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_sclk_pad_1 = AUD_TDM_PAD_CTRL(
6228ff93f28SJerome Brunet sclk_pad_1, AUDIO_MST_PAD_CTRL1, 4, sclk_pad_ctrl_parent_data);
6238ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_sclk_pad_2 = AUD_TDM_PAD_CTRL(
6248ff93f28SJerome Brunet sclk_pad_2, AUDIO_MST_PAD_CTRL1, 8, sclk_pad_ctrl_parent_data);
6258ff93f28SJerome Brunet
6264fd433fdSJerome Brunet static struct clk_regmap g12a_tdmout_a_sclk =
6274fd433fdSJerome Brunet AUD_TDM_SCLK_WS(out_a, AUDIO_CLK_TDMOUT_A_CTRL);
6284fd433fdSJerome Brunet static struct clk_regmap g12a_tdmout_b_sclk =
6294fd433fdSJerome Brunet AUD_TDM_SCLK_WS(out_b, AUDIO_CLK_TDMOUT_B_CTRL);
6304fd433fdSJerome Brunet static struct clk_regmap g12a_tdmout_c_sclk =
6314fd433fdSJerome Brunet AUD_TDM_SCLK_WS(out_c, AUDIO_CLK_TDMOUT_C_CTRL);
6324fd433fdSJerome Brunet
633be4fe445SJerome Brunet static struct clk_regmap toram =
634be4fe445SJerome Brunet AUD_PCLK_GATE(toram, AUDIO_CLK_GATE_EN, 20);
635be4fe445SJerome Brunet static struct clk_regmap spdifout_b =
636be4fe445SJerome Brunet AUD_PCLK_GATE(spdifout_b, AUDIO_CLK_GATE_EN, 21);
637be4fe445SJerome Brunet static struct clk_regmap eqdrc =
638be4fe445SJerome Brunet AUD_PCLK_GATE(eqdrc, AUDIO_CLK_GATE_EN, 22);
639be4fe445SJerome Brunet
640be4fe445SJerome Brunet /* SM1 Clocks */
641be4fe445SJerome Brunet static struct clk_regmap sm1_clk81_en = {
642be4fe445SJerome Brunet .data = &(struct clk_regmap_gate_data){
643be4fe445SJerome Brunet .offset = AUDIO_CLK81_EN,
644be4fe445SJerome Brunet .bit_idx = 31,
645be4fe445SJerome Brunet },
646be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) {
647be4fe445SJerome Brunet .name = "aud_clk81_en",
648be4fe445SJerome Brunet .ops = &clk_regmap_gate_ops,
649be4fe445SJerome Brunet .parent_data = &(const struct clk_parent_data) {
650be4fe445SJerome Brunet .fw_name = "pclk",
651be4fe445SJerome Brunet },
652be4fe445SJerome Brunet .num_parents = 1,
653be4fe445SJerome Brunet },
654be4fe445SJerome Brunet };
655be4fe445SJerome Brunet
656be4fe445SJerome Brunet static struct clk_regmap sm1_sysclk_a_div = {
657be4fe445SJerome Brunet .data = &(struct clk_regmap_div_data){
658be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL,
659be4fe445SJerome Brunet .shift = 0,
660be4fe445SJerome Brunet .width = 8,
661be4fe445SJerome Brunet },
662be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) {
663be4fe445SJerome Brunet .name = "aud_sysclk_a_div",
664be4fe445SJerome Brunet .ops = &clk_regmap_divider_ops,
665be4fe445SJerome Brunet .parent_hws = (const struct clk_hw *[]) {
666be4fe445SJerome Brunet &sm1_clk81_en.hw,
667be4fe445SJerome Brunet },
668be4fe445SJerome Brunet .num_parents = 1,
669be4fe445SJerome Brunet .flags = CLK_SET_RATE_PARENT,
670be4fe445SJerome Brunet },
671be4fe445SJerome Brunet };
672be4fe445SJerome Brunet
673be4fe445SJerome Brunet static struct clk_regmap sm1_sysclk_a_en = {
674be4fe445SJerome Brunet .data = &(struct clk_regmap_gate_data){
675be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL,
676be4fe445SJerome Brunet .bit_idx = 8,
677be4fe445SJerome Brunet },
678be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) {
679be4fe445SJerome Brunet .name = "aud_sysclk_a_en",
680be4fe445SJerome Brunet .ops = &clk_regmap_gate_ops,
681be4fe445SJerome Brunet .parent_hws = (const struct clk_hw *[]) {
682be4fe445SJerome Brunet &sm1_sysclk_a_div.hw,
683be4fe445SJerome Brunet },
684be4fe445SJerome Brunet .num_parents = 1,
685be4fe445SJerome Brunet .flags = CLK_SET_RATE_PARENT,
686be4fe445SJerome Brunet },
687be4fe445SJerome Brunet };
688be4fe445SJerome Brunet
689be4fe445SJerome Brunet static struct clk_regmap sm1_sysclk_b_div = {
690be4fe445SJerome Brunet .data = &(struct clk_regmap_div_data){
691be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL,
692be4fe445SJerome Brunet .shift = 16,
693be4fe445SJerome Brunet .width = 8,
694be4fe445SJerome Brunet },
695be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) {
696be4fe445SJerome Brunet .name = "aud_sysclk_b_div",
697be4fe445SJerome Brunet .ops = &clk_regmap_divider_ops,
698be4fe445SJerome Brunet .parent_hws = (const struct clk_hw *[]) {
699be4fe445SJerome Brunet &sm1_clk81_en.hw,
700be4fe445SJerome Brunet },
701be4fe445SJerome Brunet .num_parents = 1,
702be4fe445SJerome Brunet .flags = CLK_SET_RATE_PARENT,
703be4fe445SJerome Brunet },
704be4fe445SJerome Brunet };
705be4fe445SJerome Brunet
706be4fe445SJerome Brunet static struct clk_regmap sm1_sysclk_b_en = {
707be4fe445SJerome Brunet .data = &(struct clk_regmap_gate_data){
708be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL,
709be4fe445SJerome Brunet .bit_idx = 24,
710be4fe445SJerome Brunet },
711be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) {
712be4fe445SJerome Brunet .name = "aud_sysclk_b_en",
713be4fe445SJerome Brunet .ops = &clk_regmap_gate_ops,
714be4fe445SJerome Brunet .parent_hws = (const struct clk_hw *[]) {
715be4fe445SJerome Brunet &sm1_sysclk_b_div.hw,
716be4fe445SJerome Brunet },
717be4fe445SJerome Brunet .num_parents = 1,
718be4fe445SJerome Brunet .flags = CLK_SET_RATE_PARENT,
719be4fe445SJerome Brunet },
720be4fe445SJerome Brunet };
721be4fe445SJerome Brunet
722be4fe445SJerome Brunet static const struct clk_hw *sm1_aud_top_parents[] = {
723be4fe445SJerome Brunet &sm1_sysclk_a_en.hw,
724be4fe445SJerome Brunet &sm1_sysclk_b_en.hw,
725be4fe445SJerome Brunet };
726be4fe445SJerome Brunet
727be4fe445SJerome Brunet static struct clk_regmap sm1_aud_top = {
728be4fe445SJerome Brunet .data = &(struct clk_regmap_mux_data){
729be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL,
730be4fe445SJerome Brunet .mask = 0x1,
731be4fe445SJerome Brunet .shift = 31,
732be4fe445SJerome Brunet },
733be4fe445SJerome Brunet .hw.init = &(struct clk_init_data){
734be4fe445SJerome Brunet .name = "aud_top",
735be4fe445SJerome Brunet .ops = &clk_regmap_mux_ops,
736be4fe445SJerome Brunet .parent_hws = sm1_aud_top_parents,
737be4fe445SJerome Brunet .num_parents = ARRAY_SIZE(sm1_aud_top_parents),
738be4fe445SJerome Brunet .flags = CLK_SET_RATE_NO_REPARENT,
739be4fe445SJerome Brunet },
740be4fe445SJerome Brunet };
741be4fe445SJerome Brunet
742be4fe445SJerome Brunet static struct clk_regmap resample_b =
743be4fe445SJerome Brunet AUD_PCLK_GATE(resample_b, AUDIO_CLK_GATE_EN, 26);
744be4fe445SJerome Brunet static struct clk_regmap tovad =
745be4fe445SJerome Brunet AUD_PCLK_GATE(tovad, AUDIO_CLK_GATE_EN, 27);
746be4fe445SJerome Brunet static struct clk_regmap locker =
747be4fe445SJerome Brunet AUD_PCLK_GATE(locker, AUDIO_CLK_GATE_EN, 28);
748be4fe445SJerome Brunet static struct clk_regmap spdifin_lb =
749be4fe445SJerome Brunet AUD_PCLK_GATE(spdifin_lb, AUDIO_CLK_GATE_EN, 29);
750be4fe445SJerome Brunet static struct clk_regmap frddr_d =
751be4fe445SJerome Brunet AUD_PCLK_GATE(frddr_d, AUDIO_CLK_GATE_EN1, 0);
752be4fe445SJerome Brunet static struct clk_regmap toddr_d =
753be4fe445SJerome Brunet AUD_PCLK_GATE(toddr_d, AUDIO_CLK_GATE_EN1, 1);
754be4fe445SJerome Brunet static struct clk_regmap loopback_b =
755be4fe445SJerome Brunet AUD_PCLK_GATE(loopback_b, AUDIO_CLK_GATE_EN1, 2);
7564cb83470SJerome Brunet static struct clk_regmap earcrx =
7574cb83470SJerome Brunet AUD_PCLK_GATE(earcrx, AUDIO_CLK_GATE_EN1, 6);
7584cb83470SJerome Brunet
759be4fe445SJerome Brunet
760be4fe445SJerome Brunet static struct clk_regmap sm1_mst_a_mclk_sel =
761be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL);
762be4fe445SJerome Brunet static struct clk_regmap sm1_mst_b_mclk_sel =
763be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL);
764be4fe445SJerome Brunet static struct clk_regmap sm1_mst_c_mclk_sel =
765be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL);
766be4fe445SJerome Brunet static struct clk_regmap sm1_mst_d_mclk_sel =
767be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL);
768be4fe445SJerome Brunet static struct clk_regmap sm1_mst_e_mclk_sel =
769be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL);
770be4fe445SJerome Brunet static struct clk_regmap sm1_mst_f_mclk_sel =
771be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL);
7724cb83470SJerome Brunet static struct clk_regmap sm1_earcrx_cmdc_clk_sel =
7734cb83470SJerome Brunet AUD_MST_MCLK_MUX(earcrx_cmdc_clk, AUDIO_EARCRX_CMDC_CLK_CTRL);
7744cb83470SJerome Brunet static struct clk_regmap sm1_earcrx_dmac_clk_sel =
7754cb83470SJerome Brunet AUD_MST_MCLK_MUX(earcrx_dmac_clk, AUDIO_EARCRX_DMAC_CLK_CTRL);
776be4fe445SJerome Brunet
777be4fe445SJerome Brunet static struct clk_regmap sm1_mst_a_mclk_div =
778be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL);
779be4fe445SJerome Brunet static struct clk_regmap sm1_mst_b_mclk_div =
780be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL);
781be4fe445SJerome Brunet static struct clk_regmap sm1_mst_c_mclk_div =
782be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL);
783be4fe445SJerome Brunet static struct clk_regmap sm1_mst_d_mclk_div =
784be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL);
785be4fe445SJerome Brunet static struct clk_regmap sm1_mst_e_mclk_div =
786be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL);
787be4fe445SJerome Brunet static struct clk_regmap sm1_mst_f_mclk_div =
788be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL);
7894cb83470SJerome Brunet static struct clk_regmap sm1_earcrx_cmdc_clk_div =
7904cb83470SJerome Brunet AUD_MST_MCLK_DIV(earcrx_cmdc_clk, AUDIO_EARCRX_CMDC_CLK_CTRL);
7914cb83470SJerome Brunet static struct clk_regmap sm1_earcrx_dmac_clk_div =
7924cb83470SJerome Brunet AUD_MST_MCLK_DIV(earcrx_dmac_clk, AUDIO_EARCRX_DMAC_CLK_CTRL);
7934cb83470SJerome Brunet
794be4fe445SJerome Brunet
795be4fe445SJerome Brunet static struct clk_regmap sm1_mst_a_mclk =
796be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL);
797be4fe445SJerome Brunet static struct clk_regmap sm1_mst_b_mclk =
798be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL);
799be4fe445SJerome Brunet static struct clk_regmap sm1_mst_c_mclk =
800be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL);
801be4fe445SJerome Brunet static struct clk_regmap sm1_mst_d_mclk =
802be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL);
803be4fe445SJerome Brunet static struct clk_regmap sm1_mst_e_mclk =
804be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL);
805be4fe445SJerome Brunet static struct clk_regmap sm1_mst_f_mclk =
806be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL);
8074cb83470SJerome Brunet static struct clk_regmap sm1_earcrx_cmdc_clk =
8084cb83470SJerome Brunet AUD_MST_MCLK_GATE(earcrx_cmdc_clk, AUDIO_EARCRX_CMDC_CLK_CTRL);
8094cb83470SJerome Brunet static struct clk_regmap sm1_earcrx_dmac_clk =
8104cb83470SJerome Brunet AUD_MST_MCLK_GATE(earcrx_dmac_clk, AUDIO_EARCRX_DMAC_CLK_CTRL);
811be4fe445SJerome Brunet
812be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_mclk_pad_0 = AUD_TDM_PAD_CTRL(
813be4fe445SJerome Brunet tdm_mclk_pad_0, AUDIO_SM1_MST_PAD_CTRL0, 0, mclk_pad_ctrl_parent_data);
814be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_mclk_pad_1 = AUD_TDM_PAD_CTRL(
815be4fe445SJerome Brunet tdm_mclk_pad_1, AUDIO_SM1_MST_PAD_CTRL0, 4, mclk_pad_ctrl_parent_data);
816be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_lrclk_pad_0 = AUD_TDM_PAD_CTRL(
817be4fe445SJerome Brunet tdm_lrclk_pad_0, AUDIO_SM1_MST_PAD_CTRL1, 16, lrclk_pad_ctrl_parent_data);
818be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_lrclk_pad_1 = AUD_TDM_PAD_CTRL(
819be4fe445SJerome Brunet tdm_lrclk_pad_1, AUDIO_SM1_MST_PAD_CTRL1, 20, lrclk_pad_ctrl_parent_data);
820be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_lrclk_pad_2 = AUD_TDM_PAD_CTRL(
821be4fe445SJerome Brunet tdm_lrclk_pad_2, AUDIO_SM1_MST_PAD_CTRL1, 24, lrclk_pad_ctrl_parent_data);
822be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_sclk_pad_0 = AUD_TDM_PAD_CTRL(
823be4fe445SJerome Brunet tdm_sclk_pad_0, AUDIO_SM1_MST_PAD_CTRL1, 0, sclk_pad_ctrl_parent_data);
824be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_sclk_pad_1 = AUD_TDM_PAD_CTRL(
825be4fe445SJerome Brunet tdm_sclk_pad_1, AUDIO_SM1_MST_PAD_CTRL1, 4, sclk_pad_ctrl_parent_data);
826be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_sclk_pad_2 = AUD_TDM_PAD_CTRL(
827be4fe445SJerome Brunet tdm_sclk_pad_2, AUDIO_SM1_MST_PAD_CTRL1, 8, sclk_pad_ctrl_parent_data);
82807500138SMaxime Jourdan
8291cd50181SJerome Brunet /*
8301cd50181SJerome Brunet * Array of all clocks provided by this provider
8311cd50181SJerome Brunet * The input clocks of the controller will be populated at runtime
8321cd50181SJerome Brunet */
83305d3b7c6SNeil Armstrong static struct clk_hw *axg_audio_hw_clks[] = {
8348ff93f28SJerome Brunet [AUD_CLKID_DDR_ARB] = &ddr_arb.hw,
8358ff93f28SJerome Brunet [AUD_CLKID_PDM] = &pdm.hw,
8368ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A] = &tdmin_a.hw,
8378ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B] = &tdmin_b.hw,
8388ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C] = &tdmin_c.hw,
8398ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw,
8408ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw,
8418ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw,
8428ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw,
8438ff93f28SJerome Brunet [AUD_CLKID_FRDDR_A] = &frddr_a.hw,
8448ff93f28SJerome Brunet [AUD_CLKID_FRDDR_B] = &frddr_b.hw,
8458ff93f28SJerome Brunet [AUD_CLKID_FRDDR_C] = &frddr_c.hw,
8468ff93f28SJerome Brunet [AUD_CLKID_TODDR_A] = &toddr_a.hw,
8478ff93f28SJerome Brunet [AUD_CLKID_TODDR_B] = &toddr_b.hw,
8488ff93f28SJerome Brunet [AUD_CLKID_TODDR_C] = &toddr_c.hw,
8498ff93f28SJerome Brunet [AUD_CLKID_LOOPBACK] = &loopback.hw,
8508ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN] = &spdifin.hw,
8518ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT] = &spdifout.hw,
8528ff93f28SJerome Brunet [AUD_CLKID_RESAMPLE] = &resample.hw,
8538ff93f28SJerome Brunet [AUD_CLKID_POWER_DETECT] = &power_detect.hw,
8548ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK_SEL] = &mst_a_mclk_sel.hw,
8558ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK_SEL] = &mst_b_mclk_sel.hw,
8568ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK_SEL] = &mst_c_mclk_sel.hw,
8578ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK_SEL] = &mst_d_mclk_sel.hw,
8588ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK_SEL] = &mst_e_mclk_sel.hw,
8598ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK_SEL] = &mst_f_mclk_sel.hw,
8608ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK_DIV] = &mst_a_mclk_div.hw,
8618ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK_DIV] = &mst_b_mclk_div.hw,
8628ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK_DIV] = &mst_c_mclk_div.hw,
8638ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK_DIV] = &mst_d_mclk_div.hw,
8648ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK_DIV] = &mst_e_mclk_div.hw,
8658ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK_DIV] = &mst_f_mclk_div.hw,
8668ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK] = &mst_a_mclk.hw,
8678ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK] = &mst_b_mclk.hw,
8688ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK] = &mst_c_mclk.hw,
8698ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK] = &mst_d_mclk.hw,
8708ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK] = &mst_e_mclk.hw,
8718ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK] = &mst_f_mclk.hw,
8728ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw,
8738ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw,
8748ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw,
8758ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw,
8768ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw,
8778ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw,
8788ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw,
8798ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw,
8808ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw,
8818ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw,
8828ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw,
8838ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw,
8848ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw,
8858ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw,
8868ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw,
8878ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw,
8888ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw,
8898ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw,
8908ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw,
8918ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw,
8928ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw,
8938ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw,
8948ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw,
8958ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw,
8968ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw,
8978ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw,
8988ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw,
8998ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw,
9008ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw,
9018ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw,
9028ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw,
9038ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw,
9048ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw,
9058ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw,
9068ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw,
9078ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw,
9088ff93f28SJerome Brunet [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw,
9098ff93f28SJerome Brunet [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw,
9108ff93f28SJerome Brunet [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw,
9118ff93f28SJerome Brunet [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw,
9128ff93f28SJerome Brunet [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw,
9138ff93f28SJerome Brunet [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw,
9148ff93f28SJerome Brunet [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw,
9158ff93f28SJerome Brunet [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw,
9168ff93f28SJerome Brunet [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw,
9178ff93f28SJerome Brunet [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw,
9188ff93f28SJerome Brunet [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw,
9198ff93f28SJerome Brunet [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw,
9208ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw,
9218ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw,
9228ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw,
9238ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw,
9248ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw,
9258ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw,
9268ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw,
9278ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw,
9288ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw,
9298ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw,
9308ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw,
9318ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw,
9328ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw,
9338ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw,
9348ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw,
9358ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw,
9368ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw,
9378ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw,
9388ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw,
9398ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw,
9408ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw,
9418ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw,
9428ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw,
9438ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw,
9448ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw,
9454fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK] = &axg_tdmout_a_sclk.hw,
9464fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK] = &axg_tdmout_b_sclk.hw,
9474fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK] = &axg_tdmout_c_sclk.hw,
9488ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw,
9498ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw,
9508ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw,
9518ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw,
9528ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw,
9538ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw,
9548ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw,
955cf52db45SJerome Brunet [AUD_CLKID_TOP] = &axg_aud_top,
9561cd50181SJerome Brunet };
9571cd50181SJerome Brunet
95807500138SMaxime Jourdan /*
95907500138SMaxime Jourdan * Array of all G12A clocks provided by this provider
96007500138SMaxime Jourdan * The input clocks of the controller will be populated at runtime
96107500138SMaxime Jourdan */
96205d3b7c6SNeil Armstrong static struct clk_hw *g12a_audio_hw_clks[] = {
9638ff93f28SJerome Brunet [AUD_CLKID_DDR_ARB] = &ddr_arb.hw,
9648ff93f28SJerome Brunet [AUD_CLKID_PDM] = &pdm.hw,
9658ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A] = &tdmin_a.hw,
9668ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B] = &tdmin_b.hw,
9678ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C] = &tdmin_c.hw,
9688ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw,
9698ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw,
9708ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw,
9718ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw,
9728ff93f28SJerome Brunet [AUD_CLKID_FRDDR_A] = &frddr_a.hw,
9738ff93f28SJerome Brunet [AUD_CLKID_FRDDR_B] = &frddr_b.hw,
9748ff93f28SJerome Brunet [AUD_CLKID_FRDDR_C] = &frddr_c.hw,
9758ff93f28SJerome Brunet [AUD_CLKID_TODDR_A] = &toddr_a.hw,
9768ff93f28SJerome Brunet [AUD_CLKID_TODDR_B] = &toddr_b.hw,
9778ff93f28SJerome Brunet [AUD_CLKID_TODDR_C] = &toddr_c.hw,
9788ff93f28SJerome Brunet [AUD_CLKID_LOOPBACK] = &loopback.hw,
9798ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN] = &spdifin.hw,
9808ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT] = &spdifout.hw,
9818ff93f28SJerome Brunet [AUD_CLKID_RESAMPLE] = &resample.hw,
9828ff93f28SJerome Brunet [AUD_CLKID_POWER_DETECT] = &power_detect.hw,
9838ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_B] = &spdifout_b.hw,
9848ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK_SEL] = &mst_a_mclk_sel.hw,
9858ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK_SEL] = &mst_b_mclk_sel.hw,
9868ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK_SEL] = &mst_c_mclk_sel.hw,
9878ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK_SEL] = &mst_d_mclk_sel.hw,
9888ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK_SEL] = &mst_e_mclk_sel.hw,
9898ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK_SEL] = &mst_f_mclk_sel.hw,
9908ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK_DIV] = &mst_a_mclk_div.hw,
9918ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK_DIV] = &mst_b_mclk_div.hw,
9928ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK_DIV] = &mst_c_mclk_div.hw,
9938ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK_DIV] = &mst_d_mclk_div.hw,
9948ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK_DIV] = &mst_e_mclk_div.hw,
9958ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK_DIV] = &mst_f_mclk_div.hw,
9968ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK] = &mst_a_mclk.hw,
9978ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK] = &mst_b_mclk.hw,
9988ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK] = &mst_c_mclk.hw,
9998ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK] = &mst_d_mclk.hw,
10008ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK] = &mst_e_mclk.hw,
10018ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK] = &mst_f_mclk.hw,
10028ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw,
10038ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw,
10048ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw,
10058ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK_SEL] = &spdifout_b_clk_sel.hw,
10068ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK_DIV] = &spdifout_b_clk_div.hw,
10078ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK] = &spdifout_b_clk.hw,
10088ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw,
10098ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw,
10108ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw,
10118ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw,
10128ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw,
10138ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw,
10148ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw,
10158ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw,
10168ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw,
10178ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw,
10188ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw,
10198ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw,
10208ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw,
10218ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw,
10228ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw,
10238ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw,
10248ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw,
10258ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw,
10268ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw,
10278ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw,
10288ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw,
10298ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw,
10308ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw,
10318ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw,
10328ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw,
10338ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw,
10348ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw,
10358ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw,
10368ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw,
10378ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw,
10388ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw,
10398ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw,
10408ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw,
10418ff93f28SJerome Brunet [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw,
10428ff93f28SJerome Brunet [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw,
10438ff93f28SJerome Brunet [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw,
10448ff93f28SJerome Brunet [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw,
10458ff93f28SJerome Brunet [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw,
10468ff93f28SJerome Brunet [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw,
10478ff93f28SJerome Brunet [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw,
10488ff93f28SJerome Brunet [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw,
10498ff93f28SJerome Brunet [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw,
10508ff93f28SJerome Brunet [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw,
10518ff93f28SJerome Brunet [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw,
10528ff93f28SJerome Brunet [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw,
10538ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw,
10548ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw,
10558ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw,
10568ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw,
10578ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw,
10588ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw,
10598ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw,
10608ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw,
10618ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw,
10628ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw,
10638ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw,
10648ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw,
10658ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw,
10668ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw,
10678ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw,
10688ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw,
10698ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw,
10708ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw,
10718ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw,
10728ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw,
10738ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw,
10748ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw,
10758ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw,
10768ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw,
10778ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw,
10784fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK] = &g12a_tdmout_a_sclk.hw,
10794fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK] = &g12a_tdmout_b_sclk.hw,
10804fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK] = &g12a_tdmout_c_sclk.hw,
10818ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw,
10828ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw,
10838ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw,
10848ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw,
10858ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw,
10868ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw,
10878ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw,
10888ff93f28SJerome Brunet [AUD_CLKID_TDM_MCLK_PAD0] = &g12a_tdm_mclk_pad_0.hw,
10898ff93f28SJerome Brunet [AUD_CLKID_TDM_MCLK_PAD1] = &g12a_tdm_mclk_pad_1.hw,
10908ff93f28SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD0] = &g12a_tdm_lrclk_pad_0.hw,
10918ff93f28SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD1] = &g12a_tdm_lrclk_pad_1.hw,
10928ff93f28SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD2] = &g12a_tdm_lrclk_pad_2.hw,
10938ff93f28SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD0] = &g12a_tdm_sclk_pad_0.hw,
10948ff93f28SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD1] = &g12a_tdm_sclk_pad_1.hw,
10958ff93f28SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD2] = &g12a_tdm_sclk_pad_2.hw,
1096cf52db45SJerome Brunet [AUD_CLKID_TOP] = &axg_aud_top,
109707500138SMaxime Jourdan };
109807500138SMaxime Jourdan
1099be4fe445SJerome Brunet /*
1100be4fe445SJerome Brunet * Array of all SM1 clocks provided by this provider
1101be4fe445SJerome Brunet * The input clocks of the controller will be populated at runtime
1102be4fe445SJerome Brunet */
110305d3b7c6SNeil Armstrong static struct clk_hw *sm1_audio_hw_clks[] = {
1104be4fe445SJerome Brunet [AUD_CLKID_DDR_ARB] = &ddr_arb.hw,
1105be4fe445SJerome Brunet [AUD_CLKID_PDM] = &pdm.hw,
1106be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A] = &tdmin_a.hw,
1107be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B] = &tdmin_b.hw,
1108be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C] = &tdmin_c.hw,
1109be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw,
1110be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw,
1111be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw,
1112be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw,
1113be4fe445SJerome Brunet [AUD_CLKID_FRDDR_A] = &frddr_a.hw,
1114be4fe445SJerome Brunet [AUD_CLKID_FRDDR_B] = &frddr_b.hw,
1115be4fe445SJerome Brunet [AUD_CLKID_FRDDR_C] = &frddr_c.hw,
1116be4fe445SJerome Brunet [AUD_CLKID_TODDR_A] = &toddr_a.hw,
1117be4fe445SJerome Brunet [AUD_CLKID_TODDR_B] = &toddr_b.hw,
1118be4fe445SJerome Brunet [AUD_CLKID_TODDR_C] = &toddr_c.hw,
1119be4fe445SJerome Brunet [AUD_CLKID_LOOPBACK] = &loopback.hw,
1120be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN] = &spdifin.hw,
1121be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT] = &spdifout.hw,
1122be4fe445SJerome Brunet [AUD_CLKID_RESAMPLE] = &resample.hw,
1123be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_B] = &spdifout_b.hw,
1124be4fe445SJerome Brunet [AUD_CLKID_MST_A_MCLK_SEL] = &sm1_mst_a_mclk_sel.hw,
1125be4fe445SJerome Brunet [AUD_CLKID_MST_B_MCLK_SEL] = &sm1_mst_b_mclk_sel.hw,
1126be4fe445SJerome Brunet [AUD_CLKID_MST_C_MCLK_SEL] = &sm1_mst_c_mclk_sel.hw,
1127be4fe445SJerome Brunet [AUD_CLKID_MST_D_MCLK_SEL] = &sm1_mst_d_mclk_sel.hw,
1128be4fe445SJerome Brunet [AUD_CLKID_MST_E_MCLK_SEL] = &sm1_mst_e_mclk_sel.hw,
1129be4fe445SJerome Brunet [AUD_CLKID_MST_F_MCLK_SEL] = &sm1_mst_f_mclk_sel.hw,
1130be4fe445SJerome Brunet [AUD_CLKID_MST_A_MCLK_DIV] = &sm1_mst_a_mclk_div.hw,
1131be4fe445SJerome Brunet [AUD_CLKID_MST_B_MCLK_DIV] = &sm1_mst_b_mclk_div.hw,
1132be4fe445SJerome Brunet [AUD_CLKID_MST_C_MCLK_DIV] = &sm1_mst_c_mclk_div.hw,
1133be4fe445SJerome Brunet [AUD_CLKID_MST_D_MCLK_DIV] = &sm1_mst_d_mclk_div.hw,
1134be4fe445SJerome Brunet [AUD_CLKID_MST_E_MCLK_DIV] = &sm1_mst_e_mclk_div.hw,
1135be4fe445SJerome Brunet [AUD_CLKID_MST_F_MCLK_DIV] = &sm1_mst_f_mclk_div.hw,
1136be4fe445SJerome Brunet [AUD_CLKID_MST_A_MCLK] = &sm1_mst_a_mclk.hw,
1137be4fe445SJerome Brunet [AUD_CLKID_MST_B_MCLK] = &sm1_mst_b_mclk.hw,
1138be4fe445SJerome Brunet [AUD_CLKID_MST_C_MCLK] = &sm1_mst_c_mclk.hw,
1139be4fe445SJerome Brunet [AUD_CLKID_MST_D_MCLK] = &sm1_mst_d_mclk.hw,
1140be4fe445SJerome Brunet [AUD_CLKID_MST_E_MCLK] = &sm1_mst_e_mclk.hw,
1141be4fe445SJerome Brunet [AUD_CLKID_MST_F_MCLK] = &sm1_mst_f_mclk.hw,
1142be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw,
1143be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw,
1144be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw,
1145be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK_SEL] = &spdifout_b_clk_sel.hw,
1146be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK_DIV] = &spdifout_b_clk_div.hw,
1147be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK] = &spdifout_b_clk.hw,
1148be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw,
1149be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw,
1150be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw,
1151be4fe445SJerome Brunet [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw,
1152be4fe445SJerome Brunet [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw,
1153be4fe445SJerome Brunet [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw,
1154be4fe445SJerome Brunet [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw,
1155be4fe445SJerome Brunet [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw,
1156be4fe445SJerome Brunet [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw,
1157be4fe445SJerome Brunet [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw,
1158be4fe445SJerome Brunet [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw,
1159be4fe445SJerome Brunet [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw,
1160be4fe445SJerome Brunet [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw,
1161be4fe445SJerome Brunet [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw,
1162be4fe445SJerome Brunet [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw,
1163be4fe445SJerome Brunet [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw,
1164be4fe445SJerome Brunet [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw,
1165be4fe445SJerome Brunet [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw,
1166be4fe445SJerome Brunet [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw,
1167be4fe445SJerome Brunet [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw,
1168be4fe445SJerome Brunet [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw,
1169be4fe445SJerome Brunet [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw,
1170be4fe445SJerome Brunet [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw,
1171be4fe445SJerome Brunet [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw,
1172be4fe445SJerome Brunet [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw,
1173be4fe445SJerome Brunet [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw,
1174be4fe445SJerome Brunet [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw,
1175be4fe445SJerome Brunet [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw,
1176be4fe445SJerome Brunet [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw,
1177be4fe445SJerome Brunet [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw,
1178be4fe445SJerome Brunet [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw,
1179be4fe445SJerome Brunet [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw,
1180be4fe445SJerome Brunet [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw,
1181be4fe445SJerome Brunet [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw,
1182be4fe445SJerome Brunet [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw,
1183be4fe445SJerome Brunet [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw,
1184be4fe445SJerome Brunet [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw,
1185be4fe445SJerome Brunet [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw,
1186be4fe445SJerome Brunet [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw,
1187be4fe445SJerome Brunet [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw,
1188be4fe445SJerome Brunet [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw,
1189be4fe445SJerome Brunet [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw,
1190be4fe445SJerome Brunet [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw,
1191be4fe445SJerome Brunet [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw,
1192be4fe445SJerome Brunet [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw,
1193be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw,
1194be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw,
1195be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw,
1196be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw,
1197be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw,
1198be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw,
1199be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw,
1200be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw,
1201be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw,
1202be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw,
1203be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw,
1204be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw,
1205be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw,
1206be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw,
1207be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw,
1208be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw,
1209be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw,
1210be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw,
1211be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw,
1212be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw,
1213be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw,
1214be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw,
1215be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw,
1216be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw,
1217be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw,
12184fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK] = &g12a_tdmout_a_sclk.hw,
12194fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK] = &g12a_tdmout_b_sclk.hw,
12204fd433fdSJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK] = &g12a_tdmout_c_sclk.hw,
1221be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw,
1222be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw,
1223be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw,
1224be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw,
1225be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw,
1226be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw,
1227be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw,
1228be4fe445SJerome Brunet [AUD_CLKID_TDM_MCLK_PAD0] = &sm1_tdm_mclk_pad_0.hw,
1229be4fe445SJerome Brunet [AUD_CLKID_TDM_MCLK_PAD1] = &sm1_tdm_mclk_pad_1.hw,
1230be4fe445SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD0] = &sm1_tdm_lrclk_pad_0.hw,
1231be4fe445SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD1] = &sm1_tdm_lrclk_pad_1.hw,
1232be4fe445SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD2] = &sm1_tdm_lrclk_pad_2.hw,
1233be4fe445SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD0] = &sm1_tdm_sclk_pad_0.hw,
1234be4fe445SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD1] = &sm1_tdm_sclk_pad_1.hw,
1235be4fe445SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD2] = &sm1_tdm_sclk_pad_2.hw,
1236be4fe445SJerome Brunet [AUD_CLKID_TOP] = &sm1_aud_top.hw,
1237be4fe445SJerome Brunet [AUD_CLKID_TORAM] = &toram.hw,
1238be4fe445SJerome Brunet [AUD_CLKID_EQDRC] = &eqdrc.hw,
1239be4fe445SJerome Brunet [AUD_CLKID_RESAMPLE_B] = &resample_b.hw,
1240be4fe445SJerome Brunet [AUD_CLKID_TOVAD] = &tovad.hw,
1241be4fe445SJerome Brunet [AUD_CLKID_LOCKER] = &locker.hw,
1242be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN_LB] = &spdifin_lb.hw,
1243be4fe445SJerome Brunet [AUD_CLKID_FRDDR_D] = &frddr_d.hw,
1244be4fe445SJerome Brunet [AUD_CLKID_TODDR_D] = &toddr_d.hw,
1245be4fe445SJerome Brunet [AUD_CLKID_LOOPBACK_B] = &loopback_b.hw,
1246be4fe445SJerome Brunet [AUD_CLKID_CLK81_EN] = &sm1_clk81_en.hw,
1247be4fe445SJerome Brunet [AUD_CLKID_SYSCLK_A_DIV] = &sm1_sysclk_a_div.hw,
1248be4fe445SJerome Brunet [AUD_CLKID_SYSCLK_A_EN] = &sm1_sysclk_a_en.hw,
1249be4fe445SJerome Brunet [AUD_CLKID_SYSCLK_B_DIV] = &sm1_sysclk_b_div.hw,
1250be4fe445SJerome Brunet [AUD_CLKID_SYSCLK_B_EN] = &sm1_sysclk_b_en.hw,
12514cb83470SJerome Brunet [AUD_CLKID_EARCRX] = &earcrx.hw,
12524cb83470SJerome Brunet [AUD_CLKID_EARCRX_CMDC_SEL] = &sm1_earcrx_cmdc_clk_sel.hw,
12534cb83470SJerome Brunet [AUD_CLKID_EARCRX_CMDC_DIV] = &sm1_earcrx_cmdc_clk_div.hw,
12544cb83470SJerome Brunet [AUD_CLKID_EARCRX_CMDC] = &sm1_earcrx_cmdc_clk.hw,
12554cb83470SJerome Brunet [AUD_CLKID_EARCRX_DMAC_SEL] = &sm1_earcrx_dmac_clk_sel.hw,
12564cb83470SJerome Brunet [AUD_CLKID_EARCRX_DMAC_DIV] = &sm1_earcrx_dmac_clk_div.hw,
12574cb83470SJerome Brunet [AUD_CLKID_EARCRX_DMAC] = &sm1_earcrx_dmac_clk.hw,
1258be4fe445SJerome Brunet };
1259be4fe445SJerome Brunet
1260be4fe445SJerome Brunet
1261cdabb1ffSJerome Brunet /* Convenience table to populate regmap in .probe(). */
1262be4fe445SJerome Brunet static struct clk_regmap *const axg_clk_regmaps[] = {
12638ff93f28SJerome Brunet &ddr_arb,
12648ff93f28SJerome Brunet &pdm,
12658ff93f28SJerome Brunet &tdmin_a,
12668ff93f28SJerome Brunet &tdmin_b,
12678ff93f28SJerome Brunet &tdmin_c,
12688ff93f28SJerome Brunet &tdmin_lb,
12698ff93f28SJerome Brunet &tdmout_a,
12708ff93f28SJerome Brunet &tdmout_b,
12718ff93f28SJerome Brunet &tdmout_c,
12728ff93f28SJerome Brunet &frddr_a,
12738ff93f28SJerome Brunet &frddr_b,
12748ff93f28SJerome Brunet &frddr_c,
12758ff93f28SJerome Brunet &toddr_a,
12768ff93f28SJerome Brunet &toddr_b,
12778ff93f28SJerome Brunet &toddr_c,
12788ff93f28SJerome Brunet &loopback,
12798ff93f28SJerome Brunet &spdifin,
12808ff93f28SJerome Brunet &spdifout,
12818ff93f28SJerome Brunet &resample,
12828ff93f28SJerome Brunet &power_detect,
1283cdabb1ffSJerome Brunet &mst_a_mclk_sel,
1284cdabb1ffSJerome Brunet &mst_b_mclk_sel,
1285cdabb1ffSJerome Brunet &mst_c_mclk_sel,
1286cdabb1ffSJerome Brunet &mst_d_mclk_sel,
1287cdabb1ffSJerome Brunet &mst_e_mclk_sel,
1288cdabb1ffSJerome Brunet &mst_f_mclk_sel,
1289cdabb1ffSJerome Brunet &mst_a_mclk_div,
1290cdabb1ffSJerome Brunet &mst_b_mclk_div,
1291cdabb1ffSJerome Brunet &mst_c_mclk_div,
1292cdabb1ffSJerome Brunet &mst_d_mclk_div,
1293cdabb1ffSJerome Brunet &mst_e_mclk_div,
1294cdabb1ffSJerome Brunet &mst_f_mclk_div,
1295cdabb1ffSJerome Brunet &mst_a_mclk,
1296cdabb1ffSJerome Brunet &mst_b_mclk,
1297cdabb1ffSJerome Brunet &mst_c_mclk,
1298cdabb1ffSJerome Brunet &mst_d_mclk,
1299cdabb1ffSJerome Brunet &mst_e_mclk,
1300cdabb1ffSJerome Brunet &mst_f_mclk,
1301cdabb1ffSJerome Brunet &spdifout_clk_sel,
1302cdabb1ffSJerome Brunet &spdifout_clk_div,
1303cdabb1ffSJerome Brunet &spdifout_clk,
1304cdabb1ffSJerome Brunet &spdifin_clk_sel,
1305cdabb1ffSJerome Brunet &spdifin_clk_div,
1306cdabb1ffSJerome Brunet &spdifin_clk,
1307cdabb1ffSJerome Brunet &pdm_dclk_sel,
1308cdabb1ffSJerome Brunet &pdm_dclk_div,
1309cdabb1ffSJerome Brunet &pdm_dclk,
1310cdabb1ffSJerome Brunet &pdm_sysclk_sel,
1311cdabb1ffSJerome Brunet &pdm_sysclk_div,
1312cdabb1ffSJerome Brunet &pdm_sysclk,
1313cdabb1ffSJerome Brunet &mst_a_sclk_pre_en,
1314cdabb1ffSJerome Brunet &mst_b_sclk_pre_en,
1315cdabb1ffSJerome Brunet &mst_c_sclk_pre_en,
1316cdabb1ffSJerome Brunet &mst_d_sclk_pre_en,
1317cdabb1ffSJerome Brunet &mst_e_sclk_pre_en,
1318cdabb1ffSJerome Brunet &mst_f_sclk_pre_en,
1319cdabb1ffSJerome Brunet &mst_a_sclk_div,
1320cdabb1ffSJerome Brunet &mst_b_sclk_div,
1321cdabb1ffSJerome Brunet &mst_c_sclk_div,
1322cdabb1ffSJerome Brunet &mst_d_sclk_div,
1323cdabb1ffSJerome Brunet &mst_e_sclk_div,
1324cdabb1ffSJerome Brunet &mst_f_sclk_div,
1325cdabb1ffSJerome Brunet &mst_a_sclk_post_en,
1326cdabb1ffSJerome Brunet &mst_b_sclk_post_en,
1327cdabb1ffSJerome Brunet &mst_c_sclk_post_en,
1328cdabb1ffSJerome Brunet &mst_d_sclk_post_en,
1329cdabb1ffSJerome Brunet &mst_e_sclk_post_en,
1330cdabb1ffSJerome Brunet &mst_f_sclk_post_en,
1331cdabb1ffSJerome Brunet &mst_a_sclk,
1332cdabb1ffSJerome Brunet &mst_b_sclk,
1333cdabb1ffSJerome Brunet &mst_c_sclk,
1334cdabb1ffSJerome Brunet &mst_d_sclk,
1335cdabb1ffSJerome Brunet &mst_e_sclk,
1336cdabb1ffSJerome Brunet &mst_f_sclk,
1337cdabb1ffSJerome Brunet &mst_a_lrclk_div,
1338cdabb1ffSJerome Brunet &mst_b_lrclk_div,
1339cdabb1ffSJerome Brunet &mst_c_lrclk_div,
1340cdabb1ffSJerome Brunet &mst_d_lrclk_div,
1341cdabb1ffSJerome Brunet &mst_e_lrclk_div,
1342cdabb1ffSJerome Brunet &mst_f_lrclk_div,
1343cdabb1ffSJerome Brunet &mst_a_lrclk,
1344cdabb1ffSJerome Brunet &mst_b_lrclk,
1345cdabb1ffSJerome Brunet &mst_c_lrclk,
1346cdabb1ffSJerome Brunet &mst_d_lrclk,
1347cdabb1ffSJerome Brunet &mst_e_lrclk,
1348cdabb1ffSJerome Brunet &mst_f_lrclk,
1349cdabb1ffSJerome Brunet &tdmin_a_sclk_sel,
1350cdabb1ffSJerome Brunet &tdmin_b_sclk_sel,
1351cdabb1ffSJerome Brunet &tdmin_c_sclk_sel,
1352cdabb1ffSJerome Brunet &tdmin_lb_sclk_sel,
1353cdabb1ffSJerome Brunet &tdmout_a_sclk_sel,
1354cdabb1ffSJerome Brunet &tdmout_b_sclk_sel,
1355cdabb1ffSJerome Brunet &tdmout_c_sclk_sel,
1356cdabb1ffSJerome Brunet &tdmin_a_sclk_pre_en,
1357cdabb1ffSJerome Brunet &tdmin_b_sclk_pre_en,
1358cdabb1ffSJerome Brunet &tdmin_c_sclk_pre_en,
1359cdabb1ffSJerome Brunet &tdmin_lb_sclk_pre_en,
1360cdabb1ffSJerome Brunet &tdmout_a_sclk_pre_en,
1361cdabb1ffSJerome Brunet &tdmout_b_sclk_pre_en,
1362cdabb1ffSJerome Brunet &tdmout_c_sclk_pre_en,
1363cdabb1ffSJerome Brunet &tdmin_a_sclk_post_en,
1364cdabb1ffSJerome Brunet &tdmin_b_sclk_post_en,
1365cdabb1ffSJerome Brunet &tdmin_c_sclk_post_en,
1366cdabb1ffSJerome Brunet &tdmin_lb_sclk_post_en,
1367cdabb1ffSJerome Brunet &tdmout_a_sclk_post_en,
1368cdabb1ffSJerome Brunet &tdmout_b_sclk_post_en,
1369cdabb1ffSJerome Brunet &tdmout_c_sclk_post_en,
1370cdabb1ffSJerome Brunet &tdmin_a_sclk,
1371cdabb1ffSJerome Brunet &tdmin_b_sclk,
1372cdabb1ffSJerome Brunet &tdmin_c_sclk,
1373cdabb1ffSJerome Brunet &tdmin_lb_sclk,
13744fd433fdSJerome Brunet &axg_tdmout_a_sclk,
13754fd433fdSJerome Brunet &axg_tdmout_b_sclk,
13764fd433fdSJerome Brunet &axg_tdmout_c_sclk,
1377cdabb1ffSJerome Brunet &tdmin_a_lrclk,
1378cdabb1ffSJerome Brunet &tdmin_b_lrclk,
1379cdabb1ffSJerome Brunet &tdmin_c_lrclk,
1380cdabb1ffSJerome Brunet &tdmin_lb_lrclk,
1381cdabb1ffSJerome Brunet &tdmout_a_lrclk,
1382cdabb1ffSJerome Brunet &tdmout_b_lrclk,
1383cdabb1ffSJerome Brunet &tdmout_c_lrclk,
1384cdabb1ffSJerome Brunet };
1385cdabb1ffSJerome Brunet
1386cdabb1ffSJerome Brunet static struct clk_regmap *const g12a_clk_regmaps[] = {
1387cdabb1ffSJerome Brunet &ddr_arb,
1388cdabb1ffSJerome Brunet &pdm,
1389cdabb1ffSJerome Brunet &tdmin_a,
1390cdabb1ffSJerome Brunet &tdmin_b,
1391cdabb1ffSJerome Brunet &tdmin_c,
1392cdabb1ffSJerome Brunet &tdmin_lb,
1393cdabb1ffSJerome Brunet &tdmout_a,
1394cdabb1ffSJerome Brunet &tdmout_b,
1395cdabb1ffSJerome Brunet &tdmout_c,
1396cdabb1ffSJerome Brunet &frddr_a,
1397cdabb1ffSJerome Brunet &frddr_b,
1398cdabb1ffSJerome Brunet &frddr_c,
1399cdabb1ffSJerome Brunet &toddr_a,
1400cdabb1ffSJerome Brunet &toddr_b,
1401cdabb1ffSJerome Brunet &toddr_c,
1402cdabb1ffSJerome Brunet &loopback,
1403cdabb1ffSJerome Brunet &spdifin,
1404cdabb1ffSJerome Brunet &spdifout,
1405cdabb1ffSJerome Brunet &resample,
1406cdabb1ffSJerome Brunet &power_detect,
14078ff93f28SJerome Brunet &spdifout_b,
14088ff93f28SJerome Brunet &mst_a_mclk_sel,
14098ff93f28SJerome Brunet &mst_b_mclk_sel,
14108ff93f28SJerome Brunet &mst_c_mclk_sel,
14118ff93f28SJerome Brunet &mst_d_mclk_sel,
14128ff93f28SJerome Brunet &mst_e_mclk_sel,
14138ff93f28SJerome Brunet &mst_f_mclk_sel,
14148ff93f28SJerome Brunet &mst_a_mclk_div,
14158ff93f28SJerome Brunet &mst_b_mclk_div,
14168ff93f28SJerome Brunet &mst_c_mclk_div,
14178ff93f28SJerome Brunet &mst_d_mclk_div,
14188ff93f28SJerome Brunet &mst_e_mclk_div,
14198ff93f28SJerome Brunet &mst_f_mclk_div,
14208ff93f28SJerome Brunet &mst_a_mclk,
14218ff93f28SJerome Brunet &mst_b_mclk,
14228ff93f28SJerome Brunet &mst_c_mclk,
14238ff93f28SJerome Brunet &mst_d_mclk,
14248ff93f28SJerome Brunet &mst_e_mclk,
14258ff93f28SJerome Brunet &mst_f_mclk,
14268ff93f28SJerome Brunet &spdifout_clk_sel,
14278ff93f28SJerome Brunet &spdifout_clk_div,
14288ff93f28SJerome Brunet &spdifout_clk,
14298ff93f28SJerome Brunet &spdifin_clk_sel,
14308ff93f28SJerome Brunet &spdifin_clk_div,
14318ff93f28SJerome Brunet &spdifin_clk,
14328ff93f28SJerome Brunet &pdm_dclk_sel,
14338ff93f28SJerome Brunet &pdm_dclk_div,
14348ff93f28SJerome Brunet &pdm_dclk,
14358ff93f28SJerome Brunet &pdm_sysclk_sel,
14368ff93f28SJerome Brunet &pdm_sysclk_div,
14378ff93f28SJerome Brunet &pdm_sysclk,
14388ff93f28SJerome Brunet &mst_a_sclk_pre_en,
14398ff93f28SJerome Brunet &mst_b_sclk_pre_en,
14408ff93f28SJerome Brunet &mst_c_sclk_pre_en,
14418ff93f28SJerome Brunet &mst_d_sclk_pre_en,
14428ff93f28SJerome Brunet &mst_e_sclk_pre_en,
14438ff93f28SJerome Brunet &mst_f_sclk_pre_en,
14448ff93f28SJerome Brunet &mst_a_sclk_div,
14458ff93f28SJerome Brunet &mst_b_sclk_div,
14468ff93f28SJerome Brunet &mst_c_sclk_div,
14478ff93f28SJerome Brunet &mst_d_sclk_div,
14488ff93f28SJerome Brunet &mst_e_sclk_div,
14498ff93f28SJerome Brunet &mst_f_sclk_div,
14508ff93f28SJerome Brunet &mst_a_sclk_post_en,
14518ff93f28SJerome Brunet &mst_b_sclk_post_en,
14528ff93f28SJerome Brunet &mst_c_sclk_post_en,
14538ff93f28SJerome Brunet &mst_d_sclk_post_en,
14548ff93f28SJerome Brunet &mst_e_sclk_post_en,
14558ff93f28SJerome Brunet &mst_f_sclk_post_en,
14568ff93f28SJerome Brunet &mst_a_sclk,
14578ff93f28SJerome Brunet &mst_b_sclk,
14588ff93f28SJerome Brunet &mst_c_sclk,
14598ff93f28SJerome Brunet &mst_d_sclk,
14608ff93f28SJerome Brunet &mst_e_sclk,
14618ff93f28SJerome Brunet &mst_f_sclk,
14628ff93f28SJerome Brunet &mst_a_lrclk_div,
14638ff93f28SJerome Brunet &mst_b_lrclk_div,
14648ff93f28SJerome Brunet &mst_c_lrclk_div,
14658ff93f28SJerome Brunet &mst_d_lrclk_div,
14668ff93f28SJerome Brunet &mst_e_lrclk_div,
14678ff93f28SJerome Brunet &mst_f_lrclk_div,
14688ff93f28SJerome Brunet &mst_a_lrclk,
14698ff93f28SJerome Brunet &mst_b_lrclk,
14708ff93f28SJerome Brunet &mst_c_lrclk,
14718ff93f28SJerome Brunet &mst_d_lrclk,
14728ff93f28SJerome Brunet &mst_e_lrclk,
14738ff93f28SJerome Brunet &mst_f_lrclk,
14748ff93f28SJerome Brunet &tdmin_a_sclk_sel,
14758ff93f28SJerome Brunet &tdmin_b_sclk_sel,
14768ff93f28SJerome Brunet &tdmin_c_sclk_sel,
14778ff93f28SJerome Brunet &tdmin_lb_sclk_sel,
14788ff93f28SJerome Brunet &tdmout_a_sclk_sel,
14798ff93f28SJerome Brunet &tdmout_b_sclk_sel,
14808ff93f28SJerome Brunet &tdmout_c_sclk_sel,
14818ff93f28SJerome Brunet &tdmin_a_sclk_pre_en,
14828ff93f28SJerome Brunet &tdmin_b_sclk_pre_en,
14838ff93f28SJerome Brunet &tdmin_c_sclk_pre_en,
14848ff93f28SJerome Brunet &tdmin_lb_sclk_pre_en,
14858ff93f28SJerome Brunet &tdmout_a_sclk_pre_en,
14868ff93f28SJerome Brunet &tdmout_b_sclk_pre_en,
14878ff93f28SJerome Brunet &tdmout_c_sclk_pre_en,
14888ff93f28SJerome Brunet &tdmin_a_sclk_post_en,
14898ff93f28SJerome Brunet &tdmin_b_sclk_post_en,
14908ff93f28SJerome Brunet &tdmin_c_sclk_post_en,
14918ff93f28SJerome Brunet &tdmin_lb_sclk_post_en,
14928ff93f28SJerome Brunet &tdmout_a_sclk_post_en,
14938ff93f28SJerome Brunet &tdmout_b_sclk_post_en,
14948ff93f28SJerome Brunet &tdmout_c_sclk_post_en,
14958ff93f28SJerome Brunet &tdmin_a_sclk,
14968ff93f28SJerome Brunet &tdmin_b_sclk,
14978ff93f28SJerome Brunet &tdmin_c_sclk,
14988ff93f28SJerome Brunet &tdmin_lb_sclk,
14994fd433fdSJerome Brunet &g12a_tdmout_a_sclk,
15004fd433fdSJerome Brunet &g12a_tdmout_b_sclk,
15014fd433fdSJerome Brunet &g12a_tdmout_c_sclk,
15028ff93f28SJerome Brunet &tdmin_a_lrclk,
15038ff93f28SJerome Brunet &tdmin_b_lrclk,
15048ff93f28SJerome Brunet &tdmin_c_lrclk,
15058ff93f28SJerome Brunet &tdmin_lb_lrclk,
15068ff93f28SJerome Brunet &tdmout_a_lrclk,
15078ff93f28SJerome Brunet &tdmout_b_lrclk,
15088ff93f28SJerome Brunet &tdmout_c_lrclk,
15098ff93f28SJerome Brunet &spdifout_b_clk_sel,
15108ff93f28SJerome Brunet &spdifout_b_clk_div,
15118ff93f28SJerome Brunet &spdifout_b_clk,
15128ff93f28SJerome Brunet &g12a_tdm_mclk_pad_0,
15138ff93f28SJerome Brunet &g12a_tdm_mclk_pad_1,
15148ff93f28SJerome Brunet &g12a_tdm_lrclk_pad_0,
15158ff93f28SJerome Brunet &g12a_tdm_lrclk_pad_1,
15168ff93f28SJerome Brunet &g12a_tdm_lrclk_pad_2,
15178ff93f28SJerome Brunet &g12a_tdm_sclk_pad_0,
15188ff93f28SJerome Brunet &g12a_tdm_sclk_pad_1,
15198ff93f28SJerome Brunet &g12a_tdm_sclk_pad_2,
1520be4fe445SJerome Brunet &toram,
1521be4fe445SJerome Brunet &eqdrc,
1522be4fe445SJerome Brunet };
1523be4fe445SJerome Brunet
1524be4fe445SJerome Brunet static struct clk_regmap *const sm1_clk_regmaps[] = {
1525be4fe445SJerome Brunet &ddr_arb,
1526be4fe445SJerome Brunet &pdm,
1527be4fe445SJerome Brunet &tdmin_a,
1528be4fe445SJerome Brunet &tdmin_b,
1529be4fe445SJerome Brunet &tdmin_c,
1530be4fe445SJerome Brunet &tdmin_lb,
1531be4fe445SJerome Brunet &tdmout_a,
1532be4fe445SJerome Brunet &tdmout_b,
1533be4fe445SJerome Brunet &tdmout_c,
1534be4fe445SJerome Brunet &frddr_a,
1535be4fe445SJerome Brunet &frddr_b,
1536be4fe445SJerome Brunet &frddr_c,
1537be4fe445SJerome Brunet &toddr_a,
1538be4fe445SJerome Brunet &toddr_b,
1539be4fe445SJerome Brunet &toddr_c,
1540be4fe445SJerome Brunet &loopback,
1541be4fe445SJerome Brunet &spdifin,
1542be4fe445SJerome Brunet &spdifout,
1543be4fe445SJerome Brunet &resample,
1544be4fe445SJerome Brunet &spdifout_b,
1545be4fe445SJerome Brunet &sm1_mst_a_mclk_sel,
1546be4fe445SJerome Brunet &sm1_mst_b_mclk_sel,
1547be4fe445SJerome Brunet &sm1_mst_c_mclk_sel,
1548be4fe445SJerome Brunet &sm1_mst_d_mclk_sel,
1549be4fe445SJerome Brunet &sm1_mst_e_mclk_sel,
1550be4fe445SJerome Brunet &sm1_mst_f_mclk_sel,
1551be4fe445SJerome Brunet &sm1_mst_a_mclk_div,
1552be4fe445SJerome Brunet &sm1_mst_b_mclk_div,
1553be4fe445SJerome Brunet &sm1_mst_c_mclk_div,
1554be4fe445SJerome Brunet &sm1_mst_d_mclk_div,
1555be4fe445SJerome Brunet &sm1_mst_e_mclk_div,
1556be4fe445SJerome Brunet &sm1_mst_f_mclk_div,
1557be4fe445SJerome Brunet &sm1_mst_a_mclk,
1558be4fe445SJerome Brunet &sm1_mst_b_mclk,
1559be4fe445SJerome Brunet &sm1_mst_c_mclk,
1560be4fe445SJerome Brunet &sm1_mst_d_mclk,
1561be4fe445SJerome Brunet &sm1_mst_e_mclk,
1562be4fe445SJerome Brunet &sm1_mst_f_mclk,
1563be4fe445SJerome Brunet &spdifout_clk_sel,
1564be4fe445SJerome Brunet &spdifout_clk_div,
1565be4fe445SJerome Brunet &spdifout_clk,
1566be4fe445SJerome Brunet &spdifin_clk_sel,
1567be4fe445SJerome Brunet &spdifin_clk_div,
1568be4fe445SJerome Brunet &spdifin_clk,
1569be4fe445SJerome Brunet &pdm_dclk_sel,
1570be4fe445SJerome Brunet &pdm_dclk_div,
1571be4fe445SJerome Brunet &pdm_dclk,
1572be4fe445SJerome Brunet &pdm_sysclk_sel,
1573be4fe445SJerome Brunet &pdm_sysclk_div,
1574be4fe445SJerome Brunet &pdm_sysclk,
1575be4fe445SJerome Brunet &mst_a_sclk_pre_en,
1576be4fe445SJerome Brunet &mst_b_sclk_pre_en,
1577be4fe445SJerome Brunet &mst_c_sclk_pre_en,
1578be4fe445SJerome Brunet &mst_d_sclk_pre_en,
1579be4fe445SJerome Brunet &mst_e_sclk_pre_en,
1580be4fe445SJerome Brunet &mst_f_sclk_pre_en,
1581be4fe445SJerome Brunet &mst_a_sclk_div,
1582be4fe445SJerome Brunet &mst_b_sclk_div,
1583be4fe445SJerome Brunet &mst_c_sclk_div,
1584be4fe445SJerome Brunet &mst_d_sclk_div,
1585be4fe445SJerome Brunet &mst_e_sclk_div,
1586be4fe445SJerome Brunet &mst_f_sclk_div,
1587be4fe445SJerome Brunet &mst_a_sclk_post_en,
1588be4fe445SJerome Brunet &mst_b_sclk_post_en,
1589be4fe445SJerome Brunet &mst_c_sclk_post_en,
1590be4fe445SJerome Brunet &mst_d_sclk_post_en,
1591be4fe445SJerome Brunet &mst_e_sclk_post_en,
1592be4fe445SJerome Brunet &mst_f_sclk_post_en,
1593be4fe445SJerome Brunet &mst_a_sclk,
1594be4fe445SJerome Brunet &mst_b_sclk,
1595be4fe445SJerome Brunet &mst_c_sclk,
1596be4fe445SJerome Brunet &mst_d_sclk,
1597be4fe445SJerome Brunet &mst_e_sclk,
1598be4fe445SJerome Brunet &mst_f_sclk,
1599be4fe445SJerome Brunet &mst_a_lrclk_div,
1600be4fe445SJerome Brunet &mst_b_lrclk_div,
1601be4fe445SJerome Brunet &mst_c_lrclk_div,
1602be4fe445SJerome Brunet &mst_d_lrclk_div,
1603be4fe445SJerome Brunet &mst_e_lrclk_div,
1604be4fe445SJerome Brunet &mst_f_lrclk_div,
1605be4fe445SJerome Brunet &mst_a_lrclk,
1606be4fe445SJerome Brunet &mst_b_lrclk,
1607be4fe445SJerome Brunet &mst_c_lrclk,
1608be4fe445SJerome Brunet &mst_d_lrclk,
1609be4fe445SJerome Brunet &mst_e_lrclk,
1610be4fe445SJerome Brunet &mst_f_lrclk,
1611be4fe445SJerome Brunet &tdmin_a_sclk_sel,
1612be4fe445SJerome Brunet &tdmin_b_sclk_sel,
1613be4fe445SJerome Brunet &tdmin_c_sclk_sel,
1614be4fe445SJerome Brunet &tdmin_lb_sclk_sel,
1615be4fe445SJerome Brunet &tdmout_a_sclk_sel,
1616be4fe445SJerome Brunet &tdmout_b_sclk_sel,
1617be4fe445SJerome Brunet &tdmout_c_sclk_sel,
1618be4fe445SJerome Brunet &tdmin_a_sclk_pre_en,
1619be4fe445SJerome Brunet &tdmin_b_sclk_pre_en,
1620be4fe445SJerome Brunet &tdmin_c_sclk_pre_en,
1621be4fe445SJerome Brunet &tdmin_lb_sclk_pre_en,
1622be4fe445SJerome Brunet &tdmout_a_sclk_pre_en,
1623be4fe445SJerome Brunet &tdmout_b_sclk_pre_en,
1624be4fe445SJerome Brunet &tdmout_c_sclk_pre_en,
1625be4fe445SJerome Brunet &tdmin_a_sclk_post_en,
1626be4fe445SJerome Brunet &tdmin_b_sclk_post_en,
1627be4fe445SJerome Brunet &tdmin_c_sclk_post_en,
1628be4fe445SJerome Brunet &tdmin_lb_sclk_post_en,
1629be4fe445SJerome Brunet &tdmout_a_sclk_post_en,
1630be4fe445SJerome Brunet &tdmout_b_sclk_post_en,
1631be4fe445SJerome Brunet &tdmout_c_sclk_post_en,
1632be4fe445SJerome Brunet &tdmin_a_sclk,
1633be4fe445SJerome Brunet &tdmin_b_sclk,
1634be4fe445SJerome Brunet &tdmin_c_sclk,
1635be4fe445SJerome Brunet &tdmin_lb_sclk,
16364fd433fdSJerome Brunet &g12a_tdmout_a_sclk,
16374fd433fdSJerome Brunet &g12a_tdmout_b_sclk,
16384fd433fdSJerome Brunet &g12a_tdmout_c_sclk,
1639be4fe445SJerome Brunet &tdmin_a_lrclk,
1640be4fe445SJerome Brunet &tdmin_b_lrclk,
1641be4fe445SJerome Brunet &tdmin_c_lrclk,
1642be4fe445SJerome Brunet &tdmin_lb_lrclk,
1643be4fe445SJerome Brunet &tdmout_a_lrclk,
1644be4fe445SJerome Brunet &tdmout_b_lrclk,
1645be4fe445SJerome Brunet &tdmout_c_lrclk,
1646be4fe445SJerome Brunet &spdifout_b_clk_sel,
1647be4fe445SJerome Brunet &spdifout_b_clk_div,
1648be4fe445SJerome Brunet &spdifout_b_clk,
1649be4fe445SJerome Brunet &sm1_tdm_mclk_pad_0,
1650be4fe445SJerome Brunet &sm1_tdm_mclk_pad_1,
1651be4fe445SJerome Brunet &sm1_tdm_lrclk_pad_0,
1652be4fe445SJerome Brunet &sm1_tdm_lrclk_pad_1,
1653be4fe445SJerome Brunet &sm1_tdm_lrclk_pad_2,
1654be4fe445SJerome Brunet &sm1_tdm_sclk_pad_0,
1655be4fe445SJerome Brunet &sm1_tdm_sclk_pad_1,
1656be4fe445SJerome Brunet &sm1_tdm_sclk_pad_2,
1657be4fe445SJerome Brunet &sm1_aud_top,
1658be4fe445SJerome Brunet &toram,
1659be4fe445SJerome Brunet &eqdrc,
1660be4fe445SJerome Brunet &resample_b,
1661be4fe445SJerome Brunet &tovad,
1662be4fe445SJerome Brunet &locker,
1663be4fe445SJerome Brunet &spdifin_lb,
1664be4fe445SJerome Brunet &frddr_d,
1665be4fe445SJerome Brunet &toddr_d,
1666be4fe445SJerome Brunet &loopback_b,
1667be4fe445SJerome Brunet &sm1_clk81_en,
1668be4fe445SJerome Brunet &sm1_sysclk_a_div,
1669be4fe445SJerome Brunet &sm1_sysclk_a_en,
1670be4fe445SJerome Brunet &sm1_sysclk_b_div,
1671be4fe445SJerome Brunet &sm1_sysclk_b_en,
16724cb83470SJerome Brunet &earcrx,
16734cb83470SJerome Brunet &sm1_earcrx_cmdc_clk_sel,
16744cb83470SJerome Brunet &sm1_earcrx_cmdc_clk_div,
16754cb83470SJerome Brunet &sm1_earcrx_cmdc_clk,
16764cb83470SJerome Brunet &sm1_earcrx_dmac_clk_sel,
16774cb83470SJerome Brunet &sm1_earcrx_dmac_clk_div,
16784cb83470SJerome Brunet &sm1_earcrx_dmac_clk,
16791cd50181SJerome Brunet };
16801cd50181SJerome Brunet
16817cfefab6SJerome Brunet struct axg_audio_reset_data {
16827cfefab6SJerome Brunet struct reset_controller_dev rstc;
16837cfefab6SJerome Brunet struct regmap *map;
16847cfefab6SJerome Brunet unsigned int offset;
16857cfefab6SJerome Brunet };
16867cfefab6SJerome Brunet
axg_audio_reset_reg_and_bit(struct axg_audio_reset_data * rst,unsigned long id,unsigned int * reg,unsigned int * bit)16877cfefab6SJerome Brunet static void axg_audio_reset_reg_and_bit(struct axg_audio_reset_data *rst,
16887cfefab6SJerome Brunet unsigned long id,
16897cfefab6SJerome Brunet unsigned int *reg,
16907cfefab6SJerome Brunet unsigned int *bit)
16917cfefab6SJerome Brunet {
16927cfefab6SJerome Brunet unsigned int stride = regmap_get_reg_stride(rst->map);
16937cfefab6SJerome Brunet
16947cfefab6SJerome Brunet *reg = (id / (stride * BITS_PER_BYTE)) * stride;
16957cfefab6SJerome Brunet *reg += rst->offset;
16967cfefab6SJerome Brunet *bit = id % (stride * BITS_PER_BYTE);
16977cfefab6SJerome Brunet }
16987cfefab6SJerome Brunet
axg_audio_reset_update(struct reset_controller_dev * rcdev,unsigned long id,bool assert)16997cfefab6SJerome Brunet static int axg_audio_reset_update(struct reset_controller_dev *rcdev,
17007cfefab6SJerome Brunet unsigned long id, bool assert)
17017cfefab6SJerome Brunet {
17027cfefab6SJerome Brunet struct axg_audio_reset_data *rst =
17037cfefab6SJerome Brunet container_of(rcdev, struct axg_audio_reset_data, rstc);
17047cfefab6SJerome Brunet unsigned int offset, bit;
17057cfefab6SJerome Brunet
17067cfefab6SJerome Brunet axg_audio_reset_reg_and_bit(rst, id, &offset, &bit);
17077cfefab6SJerome Brunet
17087cfefab6SJerome Brunet regmap_update_bits(rst->map, offset, BIT(bit),
17097cfefab6SJerome Brunet assert ? BIT(bit) : 0);
17107cfefab6SJerome Brunet
17117cfefab6SJerome Brunet return 0;
17127cfefab6SJerome Brunet }
17137cfefab6SJerome Brunet
axg_audio_reset_status(struct reset_controller_dev * rcdev,unsigned long id)17147cfefab6SJerome Brunet static int axg_audio_reset_status(struct reset_controller_dev *rcdev,
17157cfefab6SJerome Brunet unsigned long id)
17167cfefab6SJerome Brunet {
17177cfefab6SJerome Brunet struct axg_audio_reset_data *rst =
17187cfefab6SJerome Brunet container_of(rcdev, struct axg_audio_reset_data, rstc);
17197cfefab6SJerome Brunet unsigned int val, offset, bit;
17207cfefab6SJerome Brunet
17217cfefab6SJerome Brunet axg_audio_reset_reg_and_bit(rst, id, &offset, &bit);
17227cfefab6SJerome Brunet
17237cfefab6SJerome Brunet regmap_read(rst->map, offset, &val);
17247cfefab6SJerome Brunet
17257cfefab6SJerome Brunet return !!(val & BIT(bit));
17267cfefab6SJerome Brunet }
17277cfefab6SJerome Brunet
axg_audio_reset_assert(struct reset_controller_dev * rcdev,unsigned long id)17287cfefab6SJerome Brunet static int axg_audio_reset_assert(struct reset_controller_dev *rcdev,
17297cfefab6SJerome Brunet unsigned long id)
17307cfefab6SJerome Brunet {
17317cfefab6SJerome Brunet return axg_audio_reset_update(rcdev, id, true);
17327cfefab6SJerome Brunet }
17337cfefab6SJerome Brunet
axg_audio_reset_deassert(struct reset_controller_dev * rcdev,unsigned long id)17347cfefab6SJerome Brunet static int axg_audio_reset_deassert(struct reset_controller_dev *rcdev,
17357cfefab6SJerome Brunet unsigned long id)
17367cfefab6SJerome Brunet {
17377cfefab6SJerome Brunet return axg_audio_reset_update(rcdev, id, false);
17387cfefab6SJerome Brunet }
17397cfefab6SJerome Brunet
axg_audio_reset_toggle(struct reset_controller_dev * rcdev,unsigned long id)17407cfefab6SJerome Brunet static int axg_audio_reset_toggle(struct reset_controller_dev *rcdev,
17417cfefab6SJerome Brunet unsigned long id)
17427cfefab6SJerome Brunet {
17437cfefab6SJerome Brunet int ret;
17447cfefab6SJerome Brunet
17457cfefab6SJerome Brunet ret = axg_audio_reset_assert(rcdev, id);
17467cfefab6SJerome Brunet if (ret)
17477cfefab6SJerome Brunet return ret;
17487cfefab6SJerome Brunet
17497cfefab6SJerome Brunet return axg_audio_reset_deassert(rcdev, id);
17507cfefab6SJerome Brunet }
17517cfefab6SJerome Brunet
17527cfefab6SJerome Brunet static const struct reset_control_ops axg_audio_rstc_ops = {
17537cfefab6SJerome Brunet .assert = axg_audio_reset_assert,
17547cfefab6SJerome Brunet .deassert = axg_audio_reset_deassert,
17557cfefab6SJerome Brunet .reset = axg_audio_reset_toggle,
17567cfefab6SJerome Brunet .status = axg_audio_reset_status,
17577cfefab6SJerome Brunet };
17587cfefab6SJerome Brunet
1759dd8ab39aSJerome Brunet static struct regmap_config axg_audio_regmap_cfg = {
17601cd50181SJerome Brunet .reg_bits = 32,
17611cd50181SJerome Brunet .val_bits = 32,
17621cd50181SJerome Brunet .reg_stride = 4,
17631cd50181SJerome Brunet };
17641cd50181SJerome Brunet
176507500138SMaxime Jourdan struct audioclk_data {
1766be4fe445SJerome Brunet struct clk_regmap *const *regmap_clks;
1767be4fe445SJerome Brunet unsigned int regmap_clk_num;
176805d3b7c6SNeil Armstrong struct meson_clk_hw_data hw_clks;
17697cfefab6SJerome Brunet unsigned int reset_offset;
17707cfefab6SJerome Brunet unsigned int reset_num;
1771dd8ab39aSJerome Brunet unsigned int max_register;
177207500138SMaxime Jourdan };
177307500138SMaxime Jourdan
axg_audio_clkc_probe(struct platform_device * pdev)17741cd50181SJerome Brunet static int axg_audio_clkc_probe(struct platform_device *pdev)
17751cd50181SJerome Brunet {
17761cd50181SJerome Brunet struct device *dev = &pdev->dev;
177707500138SMaxime Jourdan const struct audioclk_data *data;
17787cfefab6SJerome Brunet struct axg_audio_reset_data *rst;
17791cd50181SJerome Brunet struct regmap *map;
17801cd50181SJerome Brunet void __iomem *regs;
17811cd50181SJerome Brunet struct clk_hw *hw;
178268bde8b2SUwe Kleine-König struct clk *clk;
17831cd50181SJerome Brunet int ret, i;
17841cd50181SJerome Brunet
178507500138SMaxime Jourdan data = of_device_get_match_data(dev);
178607500138SMaxime Jourdan if (!data)
178707500138SMaxime Jourdan return -EINVAL;
178807500138SMaxime Jourdan
178950bf025bSYueHaibing regs = devm_platform_ioremap_resource(pdev, 0);
17901cd50181SJerome Brunet if (IS_ERR(regs))
17911cd50181SJerome Brunet return PTR_ERR(regs);
17921cd50181SJerome Brunet
1793dd8ab39aSJerome Brunet axg_audio_regmap_cfg.max_register = data->max_register;
17941cd50181SJerome Brunet map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg);
17951cd50181SJerome Brunet if (IS_ERR(map)) {
17961cd50181SJerome Brunet dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map));
17971cd50181SJerome Brunet return PTR_ERR(map);
17981cd50181SJerome Brunet }
17991cd50181SJerome Brunet
18001cd50181SJerome Brunet /* Get the mandatory peripheral clock */
180168bde8b2SUwe Kleine-König clk = devm_clk_get_enabled(dev, "pclk");
180268bde8b2SUwe Kleine-König if (IS_ERR(clk))
180368bde8b2SUwe Kleine-König return PTR_ERR(clk);
18041cd50181SJerome Brunet
18051cd50181SJerome Brunet ret = device_reset(dev);
18061cd50181SJerome Brunet if (ret) {
180750cb321fSJerome Brunet dev_err_probe(dev, ret, "failed to reset device\n");
18081cd50181SJerome Brunet return ret;
18091cd50181SJerome Brunet }
18101cd50181SJerome Brunet
18111cd50181SJerome Brunet /* Populate regmap for the regmap backed clocks */
1812be4fe445SJerome Brunet for (i = 0; i < data->regmap_clk_num; i++)
1813be4fe445SJerome Brunet data->regmap_clks[i]->map = map;
18141cd50181SJerome Brunet
18151cd50181SJerome Brunet /* Take care to skip the registered input clocks */
181605d3b7c6SNeil Armstrong for (i = AUD_CLKID_DDR_ARB; i < data->hw_clks.num; i++) {
18171610dd79SStephen Boyd const char *name;
18181610dd79SStephen Boyd
181905d3b7c6SNeil Armstrong hw = data->hw_clks.hws[i];
18201cd50181SJerome Brunet /* array might be sparse */
18211cd50181SJerome Brunet if (!hw)
18221cd50181SJerome Brunet continue;
18231cd50181SJerome Brunet
18241610dd79SStephen Boyd name = hw->init->name;
18251610dd79SStephen Boyd
18261cd50181SJerome Brunet ret = devm_clk_hw_register(dev, hw);
18271cd50181SJerome Brunet if (ret) {
18281610dd79SStephen Boyd dev_err(dev, "failed to register clock %s\n", name);
18291cd50181SJerome Brunet return ret;
18301cd50181SJerome Brunet }
18311cd50181SJerome Brunet }
18321cd50181SJerome Brunet
183305d3b7c6SNeil Armstrong ret = devm_of_clk_add_hw_provider(dev, meson_clk_hw_get, (void *)&data->hw_clks);
18347cfefab6SJerome Brunet if (ret)
18357cfefab6SJerome Brunet return ret;
18367cfefab6SJerome Brunet
18377cfefab6SJerome Brunet /* Stop here if there is no reset */
18387cfefab6SJerome Brunet if (!data->reset_num)
18397cfefab6SJerome Brunet return 0;
18407cfefab6SJerome Brunet
18417cfefab6SJerome Brunet rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL);
18427cfefab6SJerome Brunet if (!rst)
18437cfefab6SJerome Brunet return -ENOMEM;
18447cfefab6SJerome Brunet
18457cfefab6SJerome Brunet rst->map = map;
18467cfefab6SJerome Brunet rst->offset = data->reset_offset;
18477cfefab6SJerome Brunet rst->rstc.nr_resets = data->reset_num;
18487cfefab6SJerome Brunet rst->rstc.ops = &axg_audio_rstc_ops;
18497cfefab6SJerome Brunet rst->rstc.of_node = dev->of_node;
18507cfefab6SJerome Brunet rst->rstc.owner = THIS_MODULE;
18517cfefab6SJerome Brunet
18527cfefab6SJerome Brunet return devm_reset_controller_register(dev, &rst->rstc);
18531cd50181SJerome Brunet }
18541cd50181SJerome Brunet
185507500138SMaxime Jourdan static const struct audioclk_data axg_audioclk_data = {
1856be4fe445SJerome Brunet .regmap_clks = axg_clk_regmaps,
1857be4fe445SJerome Brunet .regmap_clk_num = ARRAY_SIZE(axg_clk_regmaps),
185805d3b7c6SNeil Armstrong .hw_clks = {
185905d3b7c6SNeil Armstrong .hws = axg_audio_hw_clks,
186005d3b7c6SNeil Armstrong .num = ARRAY_SIZE(axg_audio_hw_clks),
186105d3b7c6SNeil Armstrong },
1862dd8ab39aSJerome Brunet .max_register = AUDIO_CLK_PDMIN_CTRL1,
186307500138SMaxime Jourdan };
186407500138SMaxime Jourdan
186507500138SMaxime Jourdan static const struct audioclk_data g12a_audioclk_data = {
1866cdabb1ffSJerome Brunet .regmap_clks = g12a_clk_regmaps,
1867cdabb1ffSJerome Brunet .regmap_clk_num = ARRAY_SIZE(g12a_clk_regmaps),
186805d3b7c6SNeil Armstrong .hw_clks = {
186905d3b7c6SNeil Armstrong .hws = g12a_audio_hw_clks,
187005d3b7c6SNeil Armstrong .num = ARRAY_SIZE(g12a_audio_hw_clks),
187105d3b7c6SNeil Armstrong },
18727cfefab6SJerome Brunet .reset_offset = AUDIO_SW_RESET,
18737cfefab6SJerome Brunet .reset_num = 26,
1874dd8ab39aSJerome Brunet .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL,
187507500138SMaxime Jourdan };
187607500138SMaxime Jourdan
1877be4fe445SJerome Brunet static const struct audioclk_data sm1_audioclk_data = {
1878be4fe445SJerome Brunet .regmap_clks = sm1_clk_regmaps,
1879be4fe445SJerome Brunet .regmap_clk_num = ARRAY_SIZE(sm1_clk_regmaps),
188005d3b7c6SNeil Armstrong .hw_clks = {
188105d3b7c6SNeil Armstrong .hws = sm1_audio_hw_clks,
188205d3b7c6SNeil Armstrong .num = ARRAY_SIZE(sm1_audio_hw_clks),
188305d3b7c6SNeil Armstrong },
1884be4fe445SJerome Brunet .reset_offset = AUDIO_SM1_SW_RESET0,
1885be4fe445SJerome Brunet .reset_num = 39,
18864cb83470SJerome Brunet .max_register = AUDIO_EARCRX_DMAC_CLK_CTRL,
1887be4fe445SJerome Brunet };
1888be4fe445SJerome Brunet
18891cd50181SJerome Brunet static const struct of_device_id clkc_match_table[] = {
189007500138SMaxime Jourdan {
189107500138SMaxime Jourdan .compatible = "amlogic,axg-audio-clkc",
189207500138SMaxime Jourdan .data = &axg_audioclk_data
189307500138SMaxime Jourdan }, {
189407500138SMaxime Jourdan .compatible = "amlogic,g12a-audio-clkc",
189507500138SMaxime Jourdan .data = &g12a_audioclk_data
1896be4fe445SJerome Brunet }, {
1897be4fe445SJerome Brunet .compatible = "amlogic,sm1-audio-clkc",
1898be4fe445SJerome Brunet .data = &sm1_audioclk_data
189907500138SMaxime Jourdan }, {}
19001cd50181SJerome Brunet };
19011cd50181SJerome Brunet MODULE_DEVICE_TABLE(of, clkc_match_table);
19021cd50181SJerome Brunet
19031cd50181SJerome Brunet static struct platform_driver axg_audio_driver = {
19041cd50181SJerome Brunet .probe = axg_audio_clkc_probe,
19051cd50181SJerome Brunet .driver = {
19061cd50181SJerome Brunet .name = "axg-audio-clkc",
19071cd50181SJerome Brunet .of_match_table = clkc_match_table,
19081cd50181SJerome Brunet },
19091cd50181SJerome Brunet };
19101cd50181SJerome Brunet module_platform_driver(axg_audio_driver);
19111cd50181SJerome Brunet
1912be4fe445SJerome Brunet MODULE_DESCRIPTION("Amlogic AXG/G12A/SM1 Audio Clock driver");
19131cd50181SJerome Brunet MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
1914e0892cb4SNeil Armstrong MODULE_LICENSE("GPL");
1915*adac147cSJerome Brunet MODULE_IMPORT_NS(CLK_MESON);
1916