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/of_device.h> 111cd50181SJerome Brunet #include <linux/module.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 181cd50181SJerome Brunet #include "axg-audio.h" 19889c2b7eSJerome Brunet #include "clk-regmap.h" 20889c2b7eSJerome Brunet #include "clk-phase.h" 21889c2b7eSJerome Brunet #include "sclk-div.h" 221cd50181SJerome Brunet 238ff93f28SJerome Brunet #define AUD_GATE(_name, _reg, _bit, _pname, _iflags) { \ 241cd50181SJerome Brunet .data = &(struct clk_regmap_gate_data){ \ 251cd50181SJerome Brunet .offset = (_reg), \ 261cd50181SJerome Brunet .bit_idx = (_bit), \ 271cd50181SJerome Brunet }, \ 281cd50181SJerome Brunet .hw.init = &(struct clk_init_data) { \ 29b18819c4SJerome Brunet .name = "aud_"#_name, \ 301cd50181SJerome Brunet .ops = &clk_regmap_gate_ops, \ 318ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \ 321cd50181SJerome Brunet .num_parents = 1, \ 331cd50181SJerome Brunet .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \ 341cd50181SJerome Brunet }, \ 351cd50181SJerome Brunet } 361cd50181SJerome Brunet 378ff93f28SJerome Brunet #define AUD_MUX(_name, _reg, _mask, _shift, _dflags, _pdata, _iflags) { \ 381cd50181SJerome Brunet .data = &(struct clk_regmap_mux_data){ \ 391cd50181SJerome Brunet .offset = (_reg), \ 401cd50181SJerome Brunet .mask = (_mask), \ 411cd50181SJerome Brunet .shift = (_shift), \ 421cd50181SJerome Brunet .flags = (_dflags), \ 431cd50181SJerome Brunet }, \ 441cd50181SJerome Brunet .hw.init = &(struct clk_init_data){ \ 45b18819c4SJerome Brunet .name = "aud_"#_name, \ 461cd50181SJerome Brunet .ops = &clk_regmap_mux_ops, \ 47282420eeSAlexandre Mergnat .parent_data = _pdata, \ 48282420eeSAlexandre Mergnat .num_parents = ARRAY_SIZE(_pdata), \ 491cd50181SJerome Brunet .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \ 501cd50181SJerome Brunet }, \ 511cd50181SJerome Brunet } 521cd50181SJerome Brunet 538ff93f28SJerome Brunet #define AUD_DIV(_name, _reg, _shift, _width, _dflags, _pname, _iflags) { \ 541cd50181SJerome Brunet .data = &(struct clk_regmap_div_data){ \ 551cd50181SJerome Brunet .offset = (_reg), \ 561cd50181SJerome Brunet .shift = (_shift), \ 571cd50181SJerome Brunet .width = (_width), \ 581cd50181SJerome Brunet .flags = (_dflags), \ 591cd50181SJerome Brunet }, \ 601cd50181SJerome Brunet .hw.init = &(struct clk_init_data){ \ 61b18819c4SJerome Brunet .name = "aud_"#_name, \ 621cd50181SJerome Brunet .ops = &clk_regmap_divider_ops, \ 638ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \ 641cd50181SJerome Brunet .num_parents = 1, \ 651cd50181SJerome Brunet .flags = (_iflags), \ 661cd50181SJerome Brunet }, \ 671cd50181SJerome Brunet } 681cd50181SJerome Brunet 69be4fe445SJerome Brunet #define AUD_PCLK_GATE(_name, _reg, _bit) { \ 70282420eeSAlexandre Mergnat .data = &(struct clk_regmap_gate_data){ \ 71be4fe445SJerome Brunet .offset = (_reg), \ 72282420eeSAlexandre Mergnat .bit_idx = (_bit), \ 73282420eeSAlexandre Mergnat }, \ 74282420eeSAlexandre Mergnat .hw.init = &(struct clk_init_data) { \ 75282420eeSAlexandre Mergnat .name = "aud_"#_name, \ 76282420eeSAlexandre Mergnat .ops = &clk_regmap_gate_ops, \ 77cf52db45SJerome Brunet .parent_names = (const char *[]){ "aud_top" }, \ 78282420eeSAlexandre Mergnat .num_parents = 1, \ 79282420eeSAlexandre Mergnat }, \ 80282420eeSAlexandre Mergnat } 811cd50181SJerome Brunet 82b18819c4SJerome Brunet #define AUD_SCLK_DIV(_name, _reg, _div_shift, _div_width, \ 838ff93f28SJerome Brunet _hi_shift, _hi_width, _pname, _iflags) { \ 841cd50181SJerome Brunet .data = &(struct meson_sclk_div_data) { \ 851cd50181SJerome Brunet .div = { \ 861cd50181SJerome Brunet .reg_off = (_reg), \ 871cd50181SJerome Brunet .shift = (_div_shift), \ 881cd50181SJerome Brunet .width = (_div_width), \ 891cd50181SJerome Brunet }, \ 901cd50181SJerome Brunet .hi = { \ 911cd50181SJerome Brunet .reg_off = (_reg), \ 921cd50181SJerome Brunet .shift = (_hi_shift), \ 931cd50181SJerome Brunet .width = (_hi_width), \ 941cd50181SJerome Brunet }, \ 951cd50181SJerome Brunet }, \ 961cd50181SJerome Brunet .hw.init = &(struct clk_init_data) { \ 97b18819c4SJerome Brunet .name = "aud_"#_name, \ 981cd50181SJerome Brunet .ops = &meson_sclk_div_ops, \ 998ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \ 1001cd50181SJerome Brunet .num_parents = 1, \ 1011cd50181SJerome Brunet .flags = (_iflags), \ 1021cd50181SJerome Brunet }, \ 1031cd50181SJerome Brunet } 1041cd50181SJerome Brunet 105b18819c4SJerome Brunet #define AUD_TRIPHASE(_name, _reg, _width, _shift0, _shift1, _shift2, \ 1068ff93f28SJerome Brunet _pname, _iflags) { \ 1071cd50181SJerome Brunet .data = &(struct meson_clk_triphase_data) { \ 1081cd50181SJerome Brunet .ph0 = { \ 1091cd50181SJerome Brunet .reg_off = (_reg), \ 1101cd50181SJerome Brunet .shift = (_shift0), \ 1111cd50181SJerome Brunet .width = (_width), \ 1121cd50181SJerome Brunet }, \ 1131cd50181SJerome Brunet .ph1 = { \ 1141cd50181SJerome Brunet .reg_off = (_reg), \ 1151cd50181SJerome Brunet .shift = (_shift1), \ 1161cd50181SJerome Brunet .width = (_width), \ 1171cd50181SJerome Brunet }, \ 1181cd50181SJerome Brunet .ph2 = { \ 1191cd50181SJerome Brunet .reg_off = (_reg), \ 1201cd50181SJerome Brunet .shift = (_shift2), \ 1211cd50181SJerome Brunet .width = (_width), \ 1221cd50181SJerome Brunet }, \ 1231cd50181SJerome Brunet }, \ 1241cd50181SJerome Brunet .hw.init = &(struct clk_init_data) { \ 125b18819c4SJerome Brunet .name = "aud_"#_name, \ 1261cd50181SJerome Brunet .ops = &meson_clk_triphase_ops, \ 1278ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \ 1281cd50181SJerome Brunet .num_parents = 1, \ 1291cd50181SJerome Brunet .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \ 1301cd50181SJerome Brunet }, \ 1311cd50181SJerome Brunet } 1321cd50181SJerome Brunet 1338ff93f28SJerome Brunet #define AUD_PHASE(_name, _reg, _width, _shift, _pname, _iflags) { \ 1348ff93f28SJerome Brunet .data = &(struct meson_clk_phase_data) { \ 1358ff93f28SJerome Brunet .ph = { \ 1368ff93f28SJerome Brunet .reg_off = (_reg), \ 1378ff93f28SJerome Brunet .shift = (_shift), \ 1388ff93f28SJerome Brunet .width = (_width), \ 1398ff93f28SJerome Brunet }, \ 1408ff93f28SJerome Brunet }, \ 1418ff93f28SJerome Brunet .hw.init = &(struct clk_init_data) { \ 1428ff93f28SJerome Brunet .name = "aud_"#_name, \ 1438ff93f28SJerome Brunet .ops = &meson_clk_phase_ops, \ 1448ff93f28SJerome Brunet .parent_names = (const char *[]){ #_pname }, \ 1458ff93f28SJerome Brunet .num_parents = 1, \ 1468ff93f28SJerome Brunet .flags = (_iflags), \ 1478ff93f28SJerome Brunet }, \ 1488ff93f28SJerome Brunet } 1498ff93f28SJerome Brunet 1508ff93f28SJerome Brunet /* Audio Master Clocks */ 1518ff93f28SJerome Brunet static const struct clk_parent_data mst_mux_parent_data[] = { 1528ff93f28SJerome Brunet { .fw_name = "mst_in0", }, 1538ff93f28SJerome Brunet { .fw_name = "mst_in1", }, 1548ff93f28SJerome Brunet { .fw_name = "mst_in2", }, 1558ff93f28SJerome Brunet { .fw_name = "mst_in3", }, 1568ff93f28SJerome Brunet { .fw_name = "mst_in4", }, 1578ff93f28SJerome Brunet { .fw_name = "mst_in5", }, 1588ff93f28SJerome Brunet { .fw_name = "mst_in6", }, 1598ff93f28SJerome Brunet { .fw_name = "mst_in7", }, 1608ff93f28SJerome Brunet }; 1618ff93f28SJerome Brunet 1628ff93f28SJerome Brunet #define AUD_MST_MUX(_name, _reg, _flag) \ 1638ff93f28SJerome Brunet AUD_MUX(_name##_sel, _reg, 0x7, 24, _flag, \ 1648ff93f28SJerome Brunet mst_mux_parent_data, 0) 1658ff93f28SJerome Brunet #define AUD_MST_DIV(_name, _reg, _flag) \ 1668ff93f28SJerome Brunet AUD_DIV(_name##_div, _reg, 0, 16, _flag, \ 1678ff93f28SJerome Brunet aud_##_name##_sel, CLK_SET_RATE_PARENT) 1688ff93f28SJerome Brunet #define AUD_MST_MCLK_GATE(_name, _reg) \ 1698ff93f28SJerome Brunet AUD_GATE(_name, _reg, 31, aud_##_name##_div, \ 1708ff93f28SJerome Brunet CLK_SET_RATE_PARENT) 1718ff93f28SJerome Brunet 1728ff93f28SJerome Brunet #define AUD_MST_MCLK_MUX(_name, _reg) \ 1738ff93f28SJerome Brunet AUD_MST_MUX(_name, _reg, CLK_MUX_ROUND_CLOSEST) 1748ff93f28SJerome Brunet #define AUD_MST_MCLK_DIV(_name, _reg) \ 1758ff93f28SJerome Brunet AUD_MST_DIV(_name, _reg, CLK_DIVIDER_ROUND_CLOSEST) 1768ff93f28SJerome Brunet 1778ff93f28SJerome Brunet #define AUD_MST_SYS_MUX(_name, _reg) \ 1788ff93f28SJerome Brunet AUD_MST_MUX(_name, _reg, 0) 1798ff93f28SJerome Brunet #define AUD_MST_SYS_DIV(_name, _reg) \ 1808ff93f28SJerome Brunet AUD_MST_DIV(_name, _reg, 0) 1818ff93f28SJerome Brunet 1828ff93f28SJerome Brunet /* Sample Clocks */ 1838ff93f28SJerome Brunet #define AUD_MST_SCLK_PRE_EN(_name, _reg) \ 1848ff93f28SJerome Brunet AUD_GATE(mst_##_name##_sclk_pre_en, _reg, 31, \ 1858ff93f28SJerome Brunet aud_mst_##_name##_mclk, 0) 1868ff93f28SJerome Brunet #define AUD_MST_SCLK_DIV(_name, _reg) \ 1878ff93f28SJerome Brunet AUD_SCLK_DIV(mst_##_name##_sclk_div, _reg, 20, 10, 0, 0, \ 1888ff93f28SJerome Brunet aud_mst_##_name##_sclk_pre_en, \ 1898ff93f28SJerome Brunet CLK_SET_RATE_PARENT) 1908ff93f28SJerome Brunet #define AUD_MST_SCLK_POST_EN(_name, _reg) \ 1918ff93f28SJerome Brunet AUD_GATE(mst_##_name##_sclk_post_en, _reg, 30, \ 1928ff93f28SJerome Brunet aud_mst_##_name##_sclk_div, CLK_SET_RATE_PARENT) 193b18819c4SJerome Brunet #define AUD_MST_SCLK(_name, _reg) \ 194b18819c4SJerome Brunet AUD_TRIPHASE(mst_##_name##_sclk, _reg, 1, 0, 2, 4, \ 195282420eeSAlexandre Mergnat aud_mst_##_name##_sclk_post_en, CLK_SET_RATE_PARENT) 1961cd50181SJerome Brunet 197b18819c4SJerome Brunet #define AUD_MST_LRCLK_DIV(_name, _reg) \ 198b18819c4SJerome Brunet AUD_SCLK_DIV(mst_##_name##_lrclk_div, _reg, 0, 10, 10, 10, \ 1998ff93f28SJerome Brunet aud_mst_##_name##_sclk_post_en, 0) 200b18819c4SJerome Brunet #define AUD_MST_LRCLK(_name, _reg) \ 201b18819c4SJerome Brunet AUD_TRIPHASE(mst_##_name##_lrclk, _reg, 1, 1, 3, 5, \ 202282420eeSAlexandre Mergnat aud_mst_##_name##_lrclk_div, CLK_SET_RATE_PARENT) 2031cd50181SJerome Brunet 2048ff93f28SJerome Brunet /* TDM bit clock sources */ 205282420eeSAlexandre Mergnat static const struct clk_parent_data tdm_sclk_parent_data[] = { 2068ff93f28SJerome Brunet { .name = "aud_mst_a_sclk", .index = -1, }, 2078ff93f28SJerome Brunet { .name = "aud_mst_b_sclk", .index = -1, }, 2088ff93f28SJerome Brunet { .name = "aud_mst_c_sclk", .index = -1, }, 2098ff93f28SJerome Brunet { .name = "aud_mst_d_sclk", .index = -1, }, 2108ff93f28SJerome Brunet { .name = "aud_mst_e_sclk", .index = -1, }, 2118ff93f28SJerome Brunet { .name = "aud_mst_f_sclk", .index = -1, }, 212282420eeSAlexandre Mergnat { .fw_name = "slv_sclk0", }, 213282420eeSAlexandre Mergnat { .fw_name = "slv_sclk1", }, 214282420eeSAlexandre Mergnat { .fw_name = "slv_sclk2", }, 215282420eeSAlexandre Mergnat { .fw_name = "slv_sclk3", }, 216282420eeSAlexandre Mergnat { .fw_name = "slv_sclk4", }, 217282420eeSAlexandre Mergnat { .fw_name = "slv_sclk5", }, 218282420eeSAlexandre Mergnat { .fw_name = "slv_sclk6", }, 219282420eeSAlexandre Mergnat { .fw_name = "slv_sclk7", }, 220282420eeSAlexandre Mergnat { .fw_name = "slv_sclk8", }, 221282420eeSAlexandre Mergnat { .fw_name = "slv_sclk9", }, 2221cd50181SJerome Brunet }; 2231cd50181SJerome Brunet 2248ff93f28SJerome Brunet /* TDM sample clock sources */ 225282420eeSAlexandre Mergnat static const struct clk_parent_data tdm_lrclk_parent_data[] = { 2268ff93f28SJerome Brunet { .name = "aud_mst_a_lrclk", .index = -1, }, 2278ff93f28SJerome Brunet { .name = "aud_mst_b_lrclk", .index = -1, }, 2288ff93f28SJerome Brunet { .name = "aud_mst_c_lrclk", .index = -1, }, 2298ff93f28SJerome Brunet { .name = "aud_mst_d_lrclk", .index = -1, }, 2308ff93f28SJerome Brunet { .name = "aud_mst_e_lrclk", .index = -1, }, 2318ff93f28SJerome Brunet { .name = "aud_mst_f_lrclk", .index = -1, }, 232282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk0", }, 233282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk1", }, 234282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk2", }, 235282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk3", }, 236282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk4", }, 237282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk5", }, 238282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk6", }, 239282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk7", }, 240282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk8", }, 241282420eeSAlexandre Mergnat { .fw_name = "slv_lrclk9", }, 2421cd50181SJerome Brunet }; 2431cd50181SJerome Brunet 2448ff93f28SJerome Brunet #define AUD_TDM_SCLK_MUX(_name, _reg) \ 2458ff93f28SJerome Brunet AUD_MUX(tdm##_name##_sclk_sel, _reg, 0xf, 24, \ 2468ff93f28SJerome Brunet CLK_MUX_ROUND_CLOSEST, tdm_sclk_parent_data, 0) 2478ff93f28SJerome Brunet #define AUD_TDM_SCLK_PRE_EN(_name, _reg) \ 2488ff93f28SJerome Brunet AUD_GATE(tdm##_name##_sclk_pre_en, _reg, 31, \ 2498ff93f28SJerome Brunet aud_tdm##_name##_sclk_sel, CLK_SET_RATE_PARENT) 2508ff93f28SJerome Brunet #define AUD_TDM_SCLK_POST_EN(_name, _reg) \ 2518ff93f28SJerome Brunet AUD_GATE(tdm##_name##_sclk_post_en, _reg, 30, \ 2528ff93f28SJerome Brunet aud_tdm##_name##_sclk_pre_en, CLK_SET_RATE_PARENT) 2538ff93f28SJerome Brunet #define AUD_TDM_SCLK(_name, _reg) \ 2548ff93f28SJerome Brunet AUD_PHASE(tdm##_name##_sclk, _reg, 1, 29, \ 2558ff93f28SJerome Brunet aud_tdm##_name##_sclk_post_en, \ 2568ff93f28SJerome Brunet CLK_DUTY_CYCLE_PARENT | CLK_SET_RATE_PARENT) 2578ff93f28SJerome Brunet 258b18819c4SJerome Brunet #define AUD_TDM_LRLCK(_name, _reg) \ 259b18819c4SJerome Brunet AUD_MUX(tdm##_name##_lrclk, _reg, 0xf, 20, \ 2608ff93f28SJerome Brunet CLK_MUX_ROUND_CLOSEST, tdm_lrclk_parent_data, 0) 2611cd50181SJerome Brunet 2628ff93f28SJerome Brunet /* Pad master clock sources */ 2638ff93f28SJerome Brunet static const struct clk_parent_data mclk_pad_ctrl_parent_data[] = { 2648ff93f28SJerome Brunet { .name = "aud_mst_a_mclk", .index = -1, }, 2658ff93f28SJerome Brunet { .name = "aud_mst_b_mclk", .index = -1, }, 2668ff93f28SJerome Brunet { .name = "aud_mst_c_mclk", .index = -1, }, 2678ff93f28SJerome Brunet { .name = "aud_mst_d_mclk", .index = -1, }, 2688ff93f28SJerome Brunet { .name = "aud_mst_e_mclk", .index = -1, }, 2698ff93f28SJerome Brunet { .name = "aud_mst_f_mclk", .index = -1, }, 2708ff93f28SJerome Brunet }; 2711cd50181SJerome Brunet 2728ff93f28SJerome Brunet /* Pad bit clock sources */ 2738ff93f28SJerome Brunet static const struct clk_parent_data sclk_pad_ctrl_parent_data[] = { 2748ff93f28SJerome Brunet { .name = "aud_mst_a_sclk", .index = -1, }, 2758ff93f28SJerome Brunet { .name = "aud_mst_b_sclk", .index = -1, }, 2768ff93f28SJerome Brunet { .name = "aud_mst_c_sclk", .index = -1, }, 2778ff93f28SJerome Brunet { .name = "aud_mst_d_sclk", .index = -1, }, 2788ff93f28SJerome Brunet { .name = "aud_mst_e_sclk", .index = -1, }, 2798ff93f28SJerome Brunet { .name = "aud_mst_f_sclk", .index = -1, }, 2808ff93f28SJerome Brunet }; 2818ff93f28SJerome Brunet 2828ff93f28SJerome Brunet /* Pad sample clock sources */ 2838ff93f28SJerome Brunet static const struct clk_parent_data lrclk_pad_ctrl_parent_data[] = { 2848ff93f28SJerome Brunet { .name = "aud_mst_a_lrclk", .index = -1, }, 2858ff93f28SJerome Brunet { .name = "aud_mst_b_lrclk", .index = -1, }, 2868ff93f28SJerome Brunet { .name = "aud_mst_c_lrclk", .index = -1, }, 2878ff93f28SJerome Brunet { .name = "aud_mst_d_lrclk", .index = -1, }, 2888ff93f28SJerome Brunet { .name = "aud_mst_e_lrclk", .index = -1, }, 2898ff93f28SJerome Brunet { .name = "aud_mst_f_lrclk", .index = -1, }, 2908ff93f28SJerome Brunet }; 2918ff93f28SJerome Brunet 29207500138SMaxime Jourdan #define AUD_TDM_PAD_CTRL(_name, _reg, _shift, _parents) \ 293be4fe445SJerome Brunet AUD_MUX(_name, _reg, 0x7, _shift, 0, _parents, \ 29407500138SMaxime Jourdan CLK_SET_RATE_NO_REPARENT) 29507500138SMaxime Jourdan 2968ff93f28SJerome Brunet /* Common Clocks */ 297be4fe445SJerome Brunet static struct clk_regmap ddr_arb = 298be4fe445SJerome Brunet AUD_PCLK_GATE(ddr_arb, AUDIO_CLK_GATE_EN, 0); 299be4fe445SJerome Brunet static struct clk_regmap pdm = 300be4fe445SJerome Brunet AUD_PCLK_GATE(pdm, AUDIO_CLK_GATE_EN, 1); 301be4fe445SJerome Brunet static struct clk_regmap tdmin_a = 302be4fe445SJerome Brunet AUD_PCLK_GATE(tdmin_a, AUDIO_CLK_GATE_EN, 2); 303be4fe445SJerome Brunet static struct clk_regmap tdmin_b = 304be4fe445SJerome Brunet AUD_PCLK_GATE(tdmin_b, AUDIO_CLK_GATE_EN, 3); 305be4fe445SJerome Brunet static struct clk_regmap tdmin_c = 306be4fe445SJerome Brunet AUD_PCLK_GATE(tdmin_c, AUDIO_CLK_GATE_EN, 4); 307be4fe445SJerome Brunet static struct clk_regmap tdmin_lb = 308be4fe445SJerome Brunet AUD_PCLK_GATE(tdmin_lb, AUDIO_CLK_GATE_EN, 5); 309be4fe445SJerome Brunet static struct clk_regmap tdmout_a = 310be4fe445SJerome Brunet AUD_PCLK_GATE(tdmout_a, AUDIO_CLK_GATE_EN, 6); 311be4fe445SJerome Brunet static struct clk_regmap tdmout_b = 312be4fe445SJerome Brunet AUD_PCLK_GATE(tdmout_b, AUDIO_CLK_GATE_EN, 7); 313be4fe445SJerome Brunet static struct clk_regmap tdmout_c = 314be4fe445SJerome Brunet AUD_PCLK_GATE(tdmout_c, AUDIO_CLK_GATE_EN, 8); 315be4fe445SJerome Brunet static struct clk_regmap frddr_a = 316be4fe445SJerome Brunet AUD_PCLK_GATE(frddr_a, AUDIO_CLK_GATE_EN, 9); 317be4fe445SJerome Brunet static struct clk_regmap frddr_b = 318be4fe445SJerome Brunet AUD_PCLK_GATE(frddr_b, AUDIO_CLK_GATE_EN, 10); 319be4fe445SJerome Brunet static struct clk_regmap frddr_c = 320be4fe445SJerome Brunet AUD_PCLK_GATE(frddr_c, AUDIO_CLK_GATE_EN, 11); 321be4fe445SJerome Brunet static struct clk_regmap toddr_a = 322be4fe445SJerome Brunet AUD_PCLK_GATE(toddr_a, AUDIO_CLK_GATE_EN, 12); 323be4fe445SJerome Brunet static struct clk_regmap toddr_b = 324be4fe445SJerome Brunet AUD_PCLK_GATE(toddr_b, AUDIO_CLK_GATE_EN, 13); 325be4fe445SJerome Brunet static struct clk_regmap toddr_c = 326be4fe445SJerome Brunet AUD_PCLK_GATE(toddr_c, AUDIO_CLK_GATE_EN, 14); 327be4fe445SJerome Brunet static struct clk_regmap loopback = 328be4fe445SJerome Brunet AUD_PCLK_GATE(loopback, AUDIO_CLK_GATE_EN, 15); 329be4fe445SJerome Brunet static struct clk_regmap spdifin = 330be4fe445SJerome Brunet AUD_PCLK_GATE(spdifin, AUDIO_CLK_GATE_EN, 16); 331be4fe445SJerome Brunet static struct clk_regmap spdifout = 332be4fe445SJerome Brunet AUD_PCLK_GATE(spdifout, AUDIO_CLK_GATE_EN, 17); 333be4fe445SJerome Brunet static struct clk_regmap resample = 334be4fe445SJerome Brunet AUD_PCLK_GATE(resample, AUDIO_CLK_GATE_EN, 18); 335be4fe445SJerome Brunet static struct clk_regmap power_detect = 336be4fe445SJerome Brunet AUD_PCLK_GATE(power_detect, AUDIO_CLK_GATE_EN, 19); 33707500138SMaxime Jourdan 3388ff93f28SJerome Brunet static struct clk_regmap spdifout_clk_sel = 3398ff93f28SJerome Brunet AUD_MST_MCLK_MUX(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL); 3408ff93f28SJerome Brunet static struct clk_regmap pdm_dclk_sel = 3418ff93f28SJerome Brunet AUD_MST_MCLK_MUX(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0); 3428ff93f28SJerome Brunet static struct clk_regmap spdifin_clk_sel = 3438ff93f28SJerome Brunet AUD_MST_SYS_MUX(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL); 3448ff93f28SJerome Brunet static struct clk_regmap pdm_sysclk_sel = 3458ff93f28SJerome Brunet AUD_MST_SYS_MUX(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1); 3468ff93f28SJerome Brunet static struct clk_regmap spdifout_b_clk_sel = 3478ff93f28SJerome Brunet AUD_MST_MCLK_MUX(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL); 34807500138SMaxime Jourdan 3498ff93f28SJerome Brunet static struct clk_regmap spdifout_clk_div = 3508ff93f28SJerome Brunet AUD_MST_MCLK_DIV(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL); 3518ff93f28SJerome Brunet static struct clk_regmap pdm_dclk_div = 3528ff93f28SJerome Brunet AUD_MST_MCLK_DIV(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0); 3538ff93f28SJerome Brunet static struct clk_regmap spdifin_clk_div = 3548ff93f28SJerome Brunet AUD_MST_SYS_DIV(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL); 3558ff93f28SJerome Brunet static struct clk_regmap pdm_sysclk_div = 3568ff93f28SJerome Brunet AUD_MST_SYS_DIV(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1); 3578ff93f28SJerome Brunet static struct clk_regmap spdifout_b_clk_div = 3588ff93f28SJerome Brunet AUD_MST_MCLK_DIV(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL); 35907500138SMaxime Jourdan 3608ff93f28SJerome Brunet static struct clk_regmap spdifout_clk = 3618ff93f28SJerome Brunet AUD_MST_MCLK_GATE(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL); 3628ff93f28SJerome Brunet static struct clk_regmap spdifin_clk = 3638ff93f28SJerome Brunet AUD_MST_MCLK_GATE(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL); 3648ff93f28SJerome Brunet static struct clk_regmap pdm_dclk = 3658ff93f28SJerome Brunet AUD_MST_MCLK_GATE(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0); 3668ff93f28SJerome Brunet static struct clk_regmap pdm_sysclk = 3678ff93f28SJerome Brunet AUD_MST_MCLK_GATE(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1); 3688ff93f28SJerome Brunet static struct clk_regmap spdifout_b_clk = 3698ff93f28SJerome Brunet AUD_MST_MCLK_GATE(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL); 37007500138SMaxime Jourdan 3718ff93f28SJerome Brunet static struct clk_regmap mst_a_sclk_pre_en = 3728ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(a, AUDIO_MST_A_SCLK_CTRL0); 3738ff93f28SJerome Brunet static struct clk_regmap mst_b_sclk_pre_en = 3748ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(b, AUDIO_MST_B_SCLK_CTRL0); 3758ff93f28SJerome Brunet static struct clk_regmap mst_c_sclk_pre_en = 3768ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(c, AUDIO_MST_C_SCLK_CTRL0); 3778ff93f28SJerome Brunet static struct clk_regmap mst_d_sclk_pre_en = 3788ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(d, AUDIO_MST_D_SCLK_CTRL0); 3798ff93f28SJerome Brunet static struct clk_regmap mst_e_sclk_pre_en = 3808ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(e, AUDIO_MST_E_SCLK_CTRL0); 3818ff93f28SJerome Brunet static struct clk_regmap mst_f_sclk_pre_en = 3828ff93f28SJerome Brunet AUD_MST_SCLK_PRE_EN(f, AUDIO_MST_F_SCLK_CTRL0); 38307500138SMaxime Jourdan 3848ff93f28SJerome Brunet static struct clk_regmap mst_a_sclk_div = 3858ff93f28SJerome Brunet AUD_MST_SCLK_DIV(a, AUDIO_MST_A_SCLK_CTRL0); 3868ff93f28SJerome Brunet static struct clk_regmap mst_b_sclk_div = 3878ff93f28SJerome Brunet AUD_MST_SCLK_DIV(b, AUDIO_MST_B_SCLK_CTRL0); 3888ff93f28SJerome Brunet static struct clk_regmap mst_c_sclk_div = 3898ff93f28SJerome Brunet AUD_MST_SCLK_DIV(c, AUDIO_MST_C_SCLK_CTRL0); 3908ff93f28SJerome Brunet static struct clk_regmap mst_d_sclk_div = 3918ff93f28SJerome Brunet AUD_MST_SCLK_DIV(d, AUDIO_MST_D_SCLK_CTRL0); 3928ff93f28SJerome Brunet static struct clk_regmap mst_e_sclk_div = 3938ff93f28SJerome Brunet AUD_MST_SCLK_DIV(e, AUDIO_MST_E_SCLK_CTRL0); 3948ff93f28SJerome Brunet static struct clk_regmap mst_f_sclk_div = 3958ff93f28SJerome Brunet AUD_MST_SCLK_DIV(f, AUDIO_MST_F_SCLK_CTRL0); 3968ff93f28SJerome Brunet 3978ff93f28SJerome Brunet static struct clk_regmap mst_a_sclk_post_en = 3988ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(a, AUDIO_MST_A_SCLK_CTRL0); 3998ff93f28SJerome Brunet static struct clk_regmap mst_b_sclk_post_en = 4008ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(b, AUDIO_MST_B_SCLK_CTRL0); 4018ff93f28SJerome Brunet static struct clk_regmap mst_c_sclk_post_en = 4028ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(c, AUDIO_MST_C_SCLK_CTRL0); 4038ff93f28SJerome Brunet static struct clk_regmap mst_d_sclk_post_en = 4048ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(d, AUDIO_MST_D_SCLK_CTRL0); 4058ff93f28SJerome Brunet static struct clk_regmap mst_e_sclk_post_en = 4068ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(e, AUDIO_MST_E_SCLK_CTRL0); 4078ff93f28SJerome Brunet static struct clk_regmap mst_f_sclk_post_en = 4088ff93f28SJerome Brunet AUD_MST_SCLK_POST_EN(f, AUDIO_MST_F_SCLK_CTRL0); 4098ff93f28SJerome Brunet 4108ff93f28SJerome Brunet static struct clk_regmap mst_a_sclk = 4118ff93f28SJerome Brunet AUD_MST_SCLK(a, AUDIO_MST_A_SCLK_CTRL1); 4128ff93f28SJerome Brunet static struct clk_regmap mst_b_sclk = 4138ff93f28SJerome Brunet AUD_MST_SCLK(b, AUDIO_MST_B_SCLK_CTRL1); 4148ff93f28SJerome Brunet static struct clk_regmap mst_c_sclk = 4158ff93f28SJerome Brunet AUD_MST_SCLK(c, AUDIO_MST_C_SCLK_CTRL1); 4168ff93f28SJerome Brunet static struct clk_regmap mst_d_sclk = 4178ff93f28SJerome Brunet AUD_MST_SCLK(d, AUDIO_MST_D_SCLK_CTRL1); 4188ff93f28SJerome Brunet static struct clk_regmap mst_e_sclk = 4198ff93f28SJerome Brunet AUD_MST_SCLK(e, AUDIO_MST_E_SCLK_CTRL1); 4208ff93f28SJerome Brunet static struct clk_regmap mst_f_sclk = 4218ff93f28SJerome Brunet AUD_MST_SCLK(f, AUDIO_MST_F_SCLK_CTRL1); 4228ff93f28SJerome Brunet 4238ff93f28SJerome Brunet static struct clk_regmap mst_a_lrclk_div = 4248ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(a, AUDIO_MST_A_SCLK_CTRL0); 4258ff93f28SJerome Brunet static struct clk_regmap mst_b_lrclk_div = 4268ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(b, AUDIO_MST_B_SCLK_CTRL0); 4278ff93f28SJerome Brunet static struct clk_regmap mst_c_lrclk_div = 4288ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(c, AUDIO_MST_C_SCLK_CTRL0); 4298ff93f28SJerome Brunet static struct clk_regmap mst_d_lrclk_div = 4308ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(d, AUDIO_MST_D_SCLK_CTRL0); 4318ff93f28SJerome Brunet static struct clk_regmap mst_e_lrclk_div = 4328ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(e, AUDIO_MST_E_SCLK_CTRL0); 4338ff93f28SJerome Brunet static struct clk_regmap mst_f_lrclk_div = 4348ff93f28SJerome Brunet AUD_MST_LRCLK_DIV(f, AUDIO_MST_F_SCLK_CTRL0); 4358ff93f28SJerome Brunet 4368ff93f28SJerome Brunet static struct clk_regmap mst_a_lrclk = 4378ff93f28SJerome Brunet AUD_MST_LRCLK(a, AUDIO_MST_A_SCLK_CTRL1); 4388ff93f28SJerome Brunet static struct clk_regmap mst_b_lrclk = 4398ff93f28SJerome Brunet AUD_MST_LRCLK(b, AUDIO_MST_B_SCLK_CTRL1); 4408ff93f28SJerome Brunet static struct clk_regmap mst_c_lrclk = 4418ff93f28SJerome Brunet AUD_MST_LRCLK(c, AUDIO_MST_C_SCLK_CTRL1); 4428ff93f28SJerome Brunet static struct clk_regmap mst_d_lrclk = 4438ff93f28SJerome Brunet AUD_MST_LRCLK(d, AUDIO_MST_D_SCLK_CTRL1); 4448ff93f28SJerome Brunet static struct clk_regmap mst_e_lrclk = 4458ff93f28SJerome Brunet AUD_MST_LRCLK(e, AUDIO_MST_E_SCLK_CTRL1); 4468ff93f28SJerome Brunet static struct clk_regmap mst_f_lrclk = 4478ff93f28SJerome Brunet AUD_MST_LRCLK(f, AUDIO_MST_F_SCLK_CTRL1); 4488ff93f28SJerome Brunet 4498ff93f28SJerome Brunet static struct clk_regmap tdmin_a_sclk_sel = 4508ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(in_a, AUDIO_CLK_TDMIN_A_CTRL); 4518ff93f28SJerome Brunet static struct clk_regmap tdmin_b_sclk_sel = 4528ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(in_b, AUDIO_CLK_TDMIN_B_CTRL); 4538ff93f28SJerome Brunet static struct clk_regmap tdmin_c_sclk_sel = 4548ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(in_c, AUDIO_CLK_TDMIN_C_CTRL); 4558ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_sclk_sel = 4568ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 4578ff93f28SJerome Brunet static struct clk_regmap tdmout_a_sclk_sel = 4588ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 4598ff93f28SJerome Brunet static struct clk_regmap tdmout_b_sclk_sel = 4608ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 4618ff93f28SJerome Brunet static struct clk_regmap tdmout_c_sclk_sel = 4628ff93f28SJerome Brunet AUD_TDM_SCLK_MUX(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 4638ff93f28SJerome Brunet 4648ff93f28SJerome Brunet static struct clk_regmap tdmin_a_sclk_pre_en = 4658ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(in_a, AUDIO_CLK_TDMIN_A_CTRL); 4668ff93f28SJerome Brunet static struct clk_regmap tdmin_b_sclk_pre_en = 4678ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(in_b, AUDIO_CLK_TDMIN_B_CTRL); 4688ff93f28SJerome Brunet static struct clk_regmap tdmin_c_sclk_pre_en = 4698ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(in_c, AUDIO_CLK_TDMIN_C_CTRL); 4708ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_sclk_pre_en = 4718ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 4728ff93f28SJerome Brunet static struct clk_regmap tdmout_a_sclk_pre_en = 4738ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 4748ff93f28SJerome Brunet static struct clk_regmap tdmout_b_sclk_pre_en = 4758ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 4768ff93f28SJerome Brunet static struct clk_regmap tdmout_c_sclk_pre_en = 4778ff93f28SJerome Brunet AUD_TDM_SCLK_PRE_EN(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 4788ff93f28SJerome Brunet 4798ff93f28SJerome Brunet static struct clk_regmap tdmin_a_sclk_post_en = 4808ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(in_a, AUDIO_CLK_TDMIN_A_CTRL); 4818ff93f28SJerome Brunet static struct clk_regmap tdmin_b_sclk_post_en = 4828ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(in_b, AUDIO_CLK_TDMIN_B_CTRL); 4838ff93f28SJerome Brunet static struct clk_regmap tdmin_c_sclk_post_en = 4848ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(in_c, AUDIO_CLK_TDMIN_C_CTRL); 4858ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_sclk_post_en = 4868ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 4878ff93f28SJerome Brunet static struct clk_regmap tdmout_a_sclk_post_en = 4888ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 4898ff93f28SJerome Brunet static struct clk_regmap tdmout_b_sclk_post_en = 4908ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 4918ff93f28SJerome Brunet static struct clk_regmap tdmout_c_sclk_post_en = 4928ff93f28SJerome Brunet AUD_TDM_SCLK_POST_EN(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 4938ff93f28SJerome Brunet 4948ff93f28SJerome Brunet static struct clk_regmap tdmin_a_sclk = 4958ff93f28SJerome Brunet AUD_TDM_SCLK(in_a, AUDIO_CLK_TDMIN_A_CTRL); 4968ff93f28SJerome Brunet static struct clk_regmap tdmin_b_sclk = 4978ff93f28SJerome Brunet AUD_TDM_SCLK(in_b, AUDIO_CLK_TDMIN_B_CTRL); 4988ff93f28SJerome Brunet static struct clk_regmap tdmin_c_sclk = 4998ff93f28SJerome Brunet AUD_TDM_SCLK(in_c, AUDIO_CLK_TDMIN_C_CTRL); 5008ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_sclk = 5018ff93f28SJerome Brunet AUD_TDM_SCLK(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 5028ff93f28SJerome Brunet static struct clk_regmap tdmout_a_sclk = 5038ff93f28SJerome Brunet AUD_TDM_SCLK(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 5048ff93f28SJerome Brunet static struct clk_regmap tdmout_b_sclk = 5058ff93f28SJerome Brunet AUD_TDM_SCLK(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 5068ff93f28SJerome Brunet static struct clk_regmap tdmout_c_sclk = 5078ff93f28SJerome Brunet AUD_TDM_SCLK(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 5088ff93f28SJerome Brunet 5098ff93f28SJerome Brunet static struct clk_regmap tdmin_a_lrclk = 5108ff93f28SJerome Brunet AUD_TDM_LRLCK(in_a, AUDIO_CLK_TDMIN_A_CTRL); 5118ff93f28SJerome Brunet static struct clk_regmap tdmin_b_lrclk = 5128ff93f28SJerome Brunet AUD_TDM_LRLCK(in_b, AUDIO_CLK_TDMIN_B_CTRL); 5138ff93f28SJerome Brunet static struct clk_regmap tdmin_c_lrclk = 5148ff93f28SJerome Brunet AUD_TDM_LRLCK(in_c, AUDIO_CLK_TDMIN_C_CTRL); 5158ff93f28SJerome Brunet static struct clk_regmap tdmin_lb_lrclk = 5168ff93f28SJerome Brunet AUD_TDM_LRLCK(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 5178ff93f28SJerome Brunet static struct clk_regmap tdmout_a_lrclk = 5188ff93f28SJerome Brunet AUD_TDM_LRLCK(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 5198ff93f28SJerome Brunet static struct clk_regmap tdmout_b_lrclk = 5208ff93f28SJerome Brunet AUD_TDM_LRLCK(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 5218ff93f28SJerome Brunet static struct clk_regmap tdmout_c_lrclk = 5228ff93f28SJerome Brunet AUD_TDM_LRLCK(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 5238ff93f28SJerome Brunet 5248ff93f28SJerome Brunet /* AXG/G12A Clocks */ 525cf52db45SJerome Brunet static struct clk_hw axg_aud_top = { 526cf52db45SJerome Brunet .init = &(struct clk_init_data) { 527cf52db45SJerome Brunet /* Provide aud_top signal name on axg and g12a */ 528cf52db45SJerome Brunet .name = "aud_top", 529cf52db45SJerome Brunet .ops = &(const struct clk_ops) {}, 530cf52db45SJerome Brunet .parent_data = &(const struct clk_parent_data) { 531cf52db45SJerome Brunet .fw_name = "pclk", 532cf52db45SJerome Brunet }, 533cf52db45SJerome Brunet .num_parents = 1, 534cf52db45SJerome Brunet }, 535cf52db45SJerome Brunet }; 536cf52db45SJerome Brunet 5378ff93f28SJerome Brunet static struct clk_regmap mst_a_mclk_sel = 5388ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_a_mclk, AUDIO_MCLK_A_CTRL); 5398ff93f28SJerome Brunet static struct clk_regmap mst_b_mclk_sel = 5408ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_b_mclk, AUDIO_MCLK_B_CTRL); 5418ff93f28SJerome Brunet static struct clk_regmap mst_c_mclk_sel = 5428ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_c_mclk, AUDIO_MCLK_C_CTRL); 5438ff93f28SJerome Brunet static struct clk_regmap mst_d_mclk_sel = 5448ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_d_mclk, AUDIO_MCLK_D_CTRL); 5458ff93f28SJerome Brunet static struct clk_regmap mst_e_mclk_sel = 5468ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_e_mclk, AUDIO_MCLK_E_CTRL); 5478ff93f28SJerome Brunet static struct clk_regmap mst_f_mclk_sel = 5488ff93f28SJerome Brunet AUD_MST_MCLK_MUX(mst_f_mclk, AUDIO_MCLK_F_CTRL); 5498ff93f28SJerome Brunet 5508ff93f28SJerome Brunet static struct clk_regmap mst_a_mclk_div = 5518ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_a_mclk, AUDIO_MCLK_A_CTRL); 5528ff93f28SJerome Brunet static struct clk_regmap mst_b_mclk_div = 5538ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_b_mclk, AUDIO_MCLK_B_CTRL); 5548ff93f28SJerome Brunet static struct clk_regmap mst_c_mclk_div = 5558ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_c_mclk, AUDIO_MCLK_C_CTRL); 5568ff93f28SJerome Brunet static struct clk_regmap mst_d_mclk_div = 5578ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_d_mclk, AUDIO_MCLK_D_CTRL); 5588ff93f28SJerome Brunet static struct clk_regmap mst_e_mclk_div = 5598ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_e_mclk, AUDIO_MCLK_E_CTRL); 5608ff93f28SJerome Brunet static struct clk_regmap mst_f_mclk_div = 5618ff93f28SJerome Brunet AUD_MST_MCLK_DIV(mst_f_mclk, AUDIO_MCLK_F_CTRL); 5628ff93f28SJerome Brunet 5638ff93f28SJerome Brunet static struct clk_regmap mst_a_mclk = 5648ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_a_mclk, AUDIO_MCLK_A_CTRL); 5658ff93f28SJerome Brunet static struct clk_regmap mst_b_mclk = 5668ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_b_mclk, AUDIO_MCLK_B_CTRL); 5678ff93f28SJerome Brunet static struct clk_regmap mst_c_mclk = 5688ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_c_mclk, AUDIO_MCLK_C_CTRL); 5698ff93f28SJerome Brunet static struct clk_regmap mst_d_mclk = 5708ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_d_mclk, AUDIO_MCLK_D_CTRL); 5718ff93f28SJerome Brunet static struct clk_regmap mst_e_mclk = 5728ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_e_mclk, AUDIO_MCLK_E_CTRL); 5738ff93f28SJerome Brunet static struct clk_regmap mst_f_mclk = 5748ff93f28SJerome Brunet AUD_MST_MCLK_GATE(mst_f_mclk, AUDIO_MCLK_F_CTRL); 5758ff93f28SJerome Brunet 5768ff93f28SJerome Brunet /* G12a clocks */ 5778ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_mclk_pad_0 = AUD_TDM_PAD_CTRL( 5788ff93f28SJerome Brunet mclk_pad_0, AUDIO_MST_PAD_CTRL0, 0, mclk_pad_ctrl_parent_data); 5798ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_mclk_pad_1 = AUD_TDM_PAD_CTRL( 5808ff93f28SJerome Brunet mclk_pad_1, AUDIO_MST_PAD_CTRL0, 4, mclk_pad_ctrl_parent_data); 5818ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_lrclk_pad_0 = AUD_TDM_PAD_CTRL( 5828ff93f28SJerome Brunet lrclk_pad_0, AUDIO_MST_PAD_CTRL1, 16, lrclk_pad_ctrl_parent_data); 5838ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_lrclk_pad_1 = AUD_TDM_PAD_CTRL( 5848ff93f28SJerome Brunet lrclk_pad_1, AUDIO_MST_PAD_CTRL1, 20, lrclk_pad_ctrl_parent_data); 5858ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_lrclk_pad_2 = AUD_TDM_PAD_CTRL( 5868ff93f28SJerome Brunet lrclk_pad_2, AUDIO_MST_PAD_CTRL1, 24, lrclk_pad_ctrl_parent_data); 5878ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_sclk_pad_0 = AUD_TDM_PAD_CTRL( 5888ff93f28SJerome Brunet sclk_pad_0, AUDIO_MST_PAD_CTRL1, 0, sclk_pad_ctrl_parent_data); 5898ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_sclk_pad_1 = AUD_TDM_PAD_CTRL( 5908ff93f28SJerome Brunet sclk_pad_1, AUDIO_MST_PAD_CTRL1, 4, sclk_pad_ctrl_parent_data); 5918ff93f28SJerome Brunet static struct clk_regmap g12a_tdm_sclk_pad_2 = AUD_TDM_PAD_CTRL( 5928ff93f28SJerome Brunet sclk_pad_2, AUDIO_MST_PAD_CTRL1, 8, sclk_pad_ctrl_parent_data); 5938ff93f28SJerome Brunet 5948ff93f28SJerome Brunet /* G12a/SM1 clocks */ 595be4fe445SJerome Brunet static struct clk_regmap toram = 596be4fe445SJerome Brunet AUD_PCLK_GATE(toram, AUDIO_CLK_GATE_EN, 20); 597be4fe445SJerome Brunet static struct clk_regmap spdifout_b = 598be4fe445SJerome Brunet AUD_PCLK_GATE(spdifout_b, AUDIO_CLK_GATE_EN, 21); 599be4fe445SJerome Brunet static struct clk_regmap eqdrc = 600be4fe445SJerome Brunet AUD_PCLK_GATE(eqdrc, AUDIO_CLK_GATE_EN, 22); 601be4fe445SJerome Brunet 602be4fe445SJerome Brunet /* SM1 Clocks */ 603be4fe445SJerome Brunet static struct clk_regmap sm1_clk81_en = { 604be4fe445SJerome Brunet .data = &(struct clk_regmap_gate_data){ 605be4fe445SJerome Brunet .offset = AUDIO_CLK81_EN, 606be4fe445SJerome Brunet .bit_idx = 31, 607be4fe445SJerome Brunet }, 608be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) { 609be4fe445SJerome Brunet .name = "aud_clk81_en", 610be4fe445SJerome Brunet .ops = &clk_regmap_gate_ops, 611be4fe445SJerome Brunet .parent_data = &(const struct clk_parent_data) { 612be4fe445SJerome Brunet .fw_name = "pclk", 613be4fe445SJerome Brunet }, 614be4fe445SJerome Brunet .num_parents = 1, 615be4fe445SJerome Brunet }, 616be4fe445SJerome Brunet }; 617be4fe445SJerome Brunet 618be4fe445SJerome Brunet static struct clk_regmap sm1_sysclk_a_div = { 619be4fe445SJerome Brunet .data = &(struct clk_regmap_div_data){ 620be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL, 621be4fe445SJerome Brunet .shift = 0, 622be4fe445SJerome Brunet .width = 8, 623be4fe445SJerome Brunet }, 624be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) { 625be4fe445SJerome Brunet .name = "aud_sysclk_a_div", 626be4fe445SJerome Brunet .ops = &clk_regmap_divider_ops, 627be4fe445SJerome Brunet .parent_hws = (const struct clk_hw *[]) { 628be4fe445SJerome Brunet &sm1_clk81_en.hw, 629be4fe445SJerome Brunet }, 630be4fe445SJerome Brunet .num_parents = 1, 631be4fe445SJerome Brunet .flags = CLK_SET_RATE_PARENT, 632be4fe445SJerome Brunet }, 633be4fe445SJerome Brunet }; 634be4fe445SJerome Brunet 635be4fe445SJerome Brunet static struct clk_regmap sm1_sysclk_a_en = { 636be4fe445SJerome Brunet .data = &(struct clk_regmap_gate_data){ 637be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL, 638be4fe445SJerome Brunet .bit_idx = 8, 639be4fe445SJerome Brunet }, 640be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) { 641be4fe445SJerome Brunet .name = "aud_sysclk_a_en", 642be4fe445SJerome Brunet .ops = &clk_regmap_gate_ops, 643be4fe445SJerome Brunet .parent_hws = (const struct clk_hw *[]) { 644be4fe445SJerome Brunet &sm1_sysclk_a_div.hw, 645be4fe445SJerome Brunet }, 646be4fe445SJerome Brunet .num_parents = 1, 647be4fe445SJerome Brunet .flags = CLK_SET_RATE_PARENT, 648be4fe445SJerome Brunet }, 649be4fe445SJerome Brunet }; 650be4fe445SJerome Brunet 651be4fe445SJerome Brunet static struct clk_regmap sm1_sysclk_b_div = { 652be4fe445SJerome Brunet .data = &(struct clk_regmap_div_data){ 653be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL, 654be4fe445SJerome Brunet .shift = 16, 655be4fe445SJerome Brunet .width = 8, 656be4fe445SJerome Brunet }, 657be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) { 658be4fe445SJerome Brunet .name = "aud_sysclk_b_div", 659be4fe445SJerome Brunet .ops = &clk_regmap_divider_ops, 660be4fe445SJerome Brunet .parent_hws = (const struct clk_hw *[]) { 661be4fe445SJerome Brunet &sm1_clk81_en.hw, 662be4fe445SJerome Brunet }, 663be4fe445SJerome Brunet .num_parents = 1, 664be4fe445SJerome Brunet .flags = CLK_SET_RATE_PARENT, 665be4fe445SJerome Brunet }, 666be4fe445SJerome Brunet }; 667be4fe445SJerome Brunet 668be4fe445SJerome Brunet static struct clk_regmap sm1_sysclk_b_en = { 669be4fe445SJerome Brunet .data = &(struct clk_regmap_gate_data){ 670be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL, 671be4fe445SJerome Brunet .bit_idx = 24, 672be4fe445SJerome Brunet }, 673be4fe445SJerome Brunet .hw.init = &(struct clk_init_data) { 674be4fe445SJerome Brunet .name = "aud_sysclk_b_en", 675be4fe445SJerome Brunet .ops = &clk_regmap_gate_ops, 676be4fe445SJerome Brunet .parent_hws = (const struct clk_hw *[]) { 677be4fe445SJerome Brunet &sm1_sysclk_b_div.hw, 678be4fe445SJerome Brunet }, 679be4fe445SJerome Brunet .num_parents = 1, 680be4fe445SJerome Brunet .flags = CLK_SET_RATE_PARENT, 681be4fe445SJerome Brunet }, 682be4fe445SJerome Brunet }; 683be4fe445SJerome Brunet 684be4fe445SJerome Brunet static const struct clk_hw *sm1_aud_top_parents[] = { 685be4fe445SJerome Brunet &sm1_sysclk_a_en.hw, 686be4fe445SJerome Brunet &sm1_sysclk_b_en.hw, 687be4fe445SJerome Brunet }; 688be4fe445SJerome Brunet 689be4fe445SJerome Brunet static struct clk_regmap sm1_aud_top = { 690be4fe445SJerome Brunet .data = &(struct clk_regmap_mux_data){ 691be4fe445SJerome Brunet .offset = AUDIO_CLK81_CTRL, 692be4fe445SJerome Brunet .mask = 0x1, 693be4fe445SJerome Brunet .shift = 31, 694be4fe445SJerome Brunet }, 695be4fe445SJerome Brunet .hw.init = &(struct clk_init_data){ 696be4fe445SJerome Brunet .name = "aud_top", 697be4fe445SJerome Brunet .ops = &clk_regmap_mux_ops, 698be4fe445SJerome Brunet .parent_hws = sm1_aud_top_parents, 699be4fe445SJerome Brunet .num_parents = ARRAY_SIZE(sm1_aud_top_parents), 700be4fe445SJerome Brunet .flags = CLK_SET_RATE_NO_REPARENT, 701be4fe445SJerome Brunet }, 702be4fe445SJerome Brunet }; 703be4fe445SJerome Brunet 704be4fe445SJerome Brunet static struct clk_regmap resample_b = 705be4fe445SJerome Brunet AUD_PCLK_GATE(resample_b, AUDIO_CLK_GATE_EN, 26); 706be4fe445SJerome Brunet static struct clk_regmap tovad = 707be4fe445SJerome Brunet AUD_PCLK_GATE(tovad, AUDIO_CLK_GATE_EN, 27); 708be4fe445SJerome Brunet static struct clk_regmap locker = 709be4fe445SJerome Brunet AUD_PCLK_GATE(locker, AUDIO_CLK_GATE_EN, 28); 710be4fe445SJerome Brunet static struct clk_regmap spdifin_lb = 711be4fe445SJerome Brunet AUD_PCLK_GATE(spdifin_lb, AUDIO_CLK_GATE_EN, 29); 712be4fe445SJerome Brunet static struct clk_regmap frddr_d = 713be4fe445SJerome Brunet AUD_PCLK_GATE(frddr_d, AUDIO_CLK_GATE_EN1, 0); 714be4fe445SJerome Brunet static struct clk_regmap toddr_d = 715be4fe445SJerome Brunet AUD_PCLK_GATE(toddr_d, AUDIO_CLK_GATE_EN1, 1); 716be4fe445SJerome Brunet static struct clk_regmap loopback_b = 717be4fe445SJerome Brunet AUD_PCLK_GATE(loopback_b, AUDIO_CLK_GATE_EN1, 2); 718be4fe445SJerome Brunet 719be4fe445SJerome Brunet static struct clk_regmap sm1_mst_a_mclk_sel = 720be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); 721be4fe445SJerome Brunet static struct clk_regmap sm1_mst_b_mclk_sel = 722be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL); 723be4fe445SJerome Brunet static struct clk_regmap sm1_mst_c_mclk_sel = 724be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL); 725be4fe445SJerome Brunet static struct clk_regmap sm1_mst_d_mclk_sel = 726be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL); 727be4fe445SJerome Brunet static struct clk_regmap sm1_mst_e_mclk_sel = 728be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); 729be4fe445SJerome Brunet static struct clk_regmap sm1_mst_f_mclk_sel = 730be4fe445SJerome Brunet AUD_MST_MCLK_MUX(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); 731be4fe445SJerome Brunet 732be4fe445SJerome Brunet static struct clk_regmap sm1_mst_a_mclk_div = 733be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); 734be4fe445SJerome Brunet static struct clk_regmap sm1_mst_b_mclk_div = 735be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL); 736be4fe445SJerome Brunet static struct clk_regmap sm1_mst_c_mclk_div = 737be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL); 738be4fe445SJerome Brunet static struct clk_regmap sm1_mst_d_mclk_div = 739be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL); 740be4fe445SJerome Brunet static struct clk_regmap sm1_mst_e_mclk_div = 741be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); 742be4fe445SJerome Brunet static struct clk_regmap sm1_mst_f_mclk_div = 743be4fe445SJerome Brunet AUD_MST_MCLK_DIV(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); 744be4fe445SJerome Brunet 745be4fe445SJerome Brunet static struct clk_regmap sm1_mst_a_mclk = 746be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); 747be4fe445SJerome Brunet static struct clk_regmap sm1_mst_b_mclk = 748be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL); 749be4fe445SJerome Brunet static struct clk_regmap sm1_mst_c_mclk = 750be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL); 751be4fe445SJerome Brunet static struct clk_regmap sm1_mst_d_mclk = 752be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL); 753be4fe445SJerome Brunet static struct clk_regmap sm1_mst_e_mclk = 754be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); 755be4fe445SJerome Brunet static struct clk_regmap sm1_mst_f_mclk = 756be4fe445SJerome Brunet AUD_MST_MCLK_GATE(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); 757be4fe445SJerome Brunet 758be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_mclk_pad_0 = AUD_TDM_PAD_CTRL( 759be4fe445SJerome Brunet tdm_mclk_pad_0, AUDIO_SM1_MST_PAD_CTRL0, 0, mclk_pad_ctrl_parent_data); 760be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_mclk_pad_1 = AUD_TDM_PAD_CTRL( 761be4fe445SJerome Brunet tdm_mclk_pad_1, AUDIO_SM1_MST_PAD_CTRL0, 4, mclk_pad_ctrl_parent_data); 762be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_lrclk_pad_0 = AUD_TDM_PAD_CTRL( 763be4fe445SJerome Brunet tdm_lrclk_pad_0, AUDIO_SM1_MST_PAD_CTRL1, 16, lrclk_pad_ctrl_parent_data); 764be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_lrclk_pad_1 = AUD_TDM_PAD_CTRL( 765be4fe445SJerome Brunet tdm_lrclk_pad_1, AUDIO_SM1_MST_PAD_CTRL1, 20, lrclk_pad_ctrl_parent_data); 766be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_lrclk_pad_2 = AUD_TDM_PAD_CTRL( 767be4fe445SJerome Brunet tdm_lrclk_pad_2, AUDIO_SM1_MST_PAD_CTRL1, 24, lrclk_pad_ctrl_parent_data); 768be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_sclk_pad_0 = AUD_TDM_PAD_CTRL( 769be4fe445SJerome Brunet tdm_sclk_pad_0, AUDIO_SM1_MST_PAD_CTRL1, 0, sclk_pad_ctrl_parent_data); 770be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_sclk_pad_1 = AUD_TDM_PAD_CTRL( 771be4fe445SJerome Brunet tdm_sclk_pad_1, AUDIO_SM1_MST_PAD_CTRL1, 4, sclk_pad_ctrl_parent_data); 772be4fe445SJerome Brunet static struct clk_regmap sm1_tdm_sclk_pad_2 = AUD_TDM_PAD_CTRL( 773be4fe445SJerome Brunet tdm_sclk_pad_2, AUDIO_SM1_MST_PAD_CTRL1, 8, sclk_pad_ctrl_parent_data); 77407500138SMaxime Jourdan 7751cd50181SJerome Brunet /* 7761cd50181SJerome Brunet * Array of all clocks provided by this provider 7771cd50181SJerome Brunet * The input clocks of the controller will be populated at runtime 7781cd50181SJerome Brunet */ 7791cd50181SJerome Brunet static struct clk_hw_onecell_data axg_audio_hw_onecell_data = { 7801cd50181SJerome Brunet .hws = { 7818ff93f28SJerome Brunet [AUD_CLKID_DDR_ARB] = &ddr_arb.hw, 7828ff93f28SJerome Brunet [AUD_CLKID_PDM] = &pdm.hw, 7838ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A] = &tdmin_a.hw, 7848ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B] = &tdmin_b.hw, 7858ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C] = &tdmin_c.hw, 7868ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw, 7878ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw, 7888ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw, 7898ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw, 7908ff93f28SJerome Brunet [AUD_CLKID_FRDDR_A] = &frddr_a.hw, 7918ff93f28SJerome Brunet [AUD_CLKID_FRDDR_B] = &frddr_b.hw, 7928ff93f28SJerome Brunet [AUD_CLKID_FRDDR_C] = &frddr_c.hw, 7938ff93f28SJerome Brunet [AUD_CLKID_TODDR_A] = &toddr_a.hw, 7948ff93f28SJerome Brunet [AUD_CLKID_TODDR_B] = &toddr_b.hw, 7958ff93f28SJerome Brunet [AUD_CLKID_TODDR_C] = &toddr_c.hw, 7968ff93f28SJerome Brunet [AUD_CLKID_LOOPBACK] = &loopback.hw, 7978ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN] = &spdifin.hw, 7988ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT] = &spdifout.hw, 7998ff93f28SJerome Brunet [AUD_CLKID_RESAMPLE] = &resample.hw, 8008ff93f28SJerome Brunet [AUD_CLKID_POWER_DETECT] = &power_detect.hw, 8018ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK_SEL] = &mst_a_mclk_sel.hw, 8028ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK_SEL] = &mst_b_mclk_sel.hw, 8038ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK_SEL] = &mst_c_mclk_sel.hw, 8048ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK_SEL] = &mst_d_mclk_sel.hw, 8058ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK_SEL] = &mst_e_mclk_sel.hw, 8068ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK_SEL] = &mst_f_mclk_sel.hw, 8078ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK_DIV] = &mst_a_mclk_div.hw, 8088ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK_DIV] = &mst_b_mclk_div.hw, 8098ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK_DIV] = &mst_c_mclk_div.hw, 8108ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK_DIV] = &mst_d_mclk_div.hw, 8118ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK_DIV] = &mst_e_mclk_div.hw, 8128ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK_DIV] = &mst_f_mclk_div.hw, 8138ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK] = &mst_a_mclk.hw, 8148ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK] = &mst_b_mclk.hw, 8158ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK] = &mst_c_mclk.hw, 8168ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK] = &mst_d_mclk.hw, 8178ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK] = &mst_e_mclk.hw, 8188ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK] = &mst_f_mclk.hw, 8198ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw, 8208ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw, 8218ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw, 8228ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw, 8238ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw, 8248ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw, 8258ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw, 8268ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw, 8278ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw, 8288ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw, 8298ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw, 8308ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw, 8318ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw, 8328ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw, 8338ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw, 8348ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw, 8358ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw, 8368ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw, 8378ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw, 8388ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw, 8398ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw, 8408ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw, 8418ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw, 8428ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw, 8438ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw, 8448ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw, 8458ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw, 8468ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw, 8478ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw, 8488ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw, 8498ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw, 8508ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw, 8518ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw, 8528ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw, 8538ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw, 8548ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw, 8558ff93f28SJerome Brunet [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw, 8568ff93f28SJerome Brunet [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw, 8578ff93f28SJerome Brunet [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw, 8588ff93f28SJerome Brunet [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw, 8598ff93f28SJerome Brunet [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw, 8608ff93f28SJerome Brunet [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw, 8618ff93f28SJerome Brunet [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw, 8628ff93f28SJerome Brunet [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw, 8638ff93f28SJerome Brunet [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw, 8648ff93f28SJerome Brunet [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw, 8658ff93f28SJerome Brunet [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw, 8668ff93f28SJerome Brunet [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw, 8678ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw, 8688ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw, 8698ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw, 8708ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw, 8718ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw, 8728ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw, 8738ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw, 8748ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw, 8758ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw, 8768ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw, 8778ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw, 8788ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw, 8798ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw, 8808ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw, 8818ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw, 8828ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw, 8838ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw, 8848ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw, 8858ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw, 8868ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw, 8878ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw, 8888ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw, 8898ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw, 8908ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw, 8918ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw, 8928ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK] = &tdmout_a_sclk.hw, 8938ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK] = &tdmout_b_sclk.hw, 8948ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK] = &tdmout_c_sclk.hw, 8958ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw, 8968ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw, 8978ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw, 8988ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw, 8998ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw, 9008ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw, 9018ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw, 902cf52db45SJerome Brunet [AUD_CLKID_TOP] = &axg_aud_top, 9031cd50181SJerome Brunet [NR_CLKS] = NULL, 9041cd50181SJerome Brunet }, 9051cd50181SJerome Brunet .num = NR_CLKS, 9061cd50181SJerome Brunet }; 9071cd50181SJerome Brunet 90807500138SMaxime Jourdan /* 90907500138SMaxime Jourdan * Array of all G12A clocks provided by this provider 91007500138SMaxime Jourdan * The input clocks of the controller will be populated at runtime 91107500138SMaxime Jourdan */ 91207500138SMaxime Jourdan static struct clk_hw_onecell_data g12a_audio_hw_onecell_data = { 91307500138SMaxime Jourdan .hws = { 9148ff93f28SJerome Brunet [AUD_CLKID_DDR_ARB] = &ddr_arb.hw, 9158ff93f28SJerome Brunet [AUD_CLKID_PDM] = &pdm.hw, 9168ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A] = &tdmin_a.hw, 9178ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B] = &tdmin_b.hw, 9188ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C] = &tdmin_c.hw, 9198ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw, 9208ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw, 9218ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw, 9228ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw, 9238ff93f28SJerome Brunet [AUD_CLKID_FRDDR_A] = &frddr_a.hw, 9248ff93f28SJerome Brunet [AUD_CLKID_FRDDR_B] = &frddr_b.hw, 9258ff93f28SJerome Brunet [AUD_CLKID_FRDDR_C] = &frddr_c.hw, 9268ff93f28SJerome Brunet [AUD_CLKID_TODDR_A] = &toddr_a.hw, 9278ff93f28SJerome Brunet [AUD_CLKID_TODDR_B] = &toddr_b.hw, 9288ff93f28SJerome Brunet [AUD_CLKID_TODDR_C] = &toddr_c.hw, 9298ff93f28SJerome Brunet [AUD_CLKID_LOOPBACK] = &loopback.hw, 9308ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN] = &spdifin.hw, 9318ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT] = &spdifout.hw, 9328ff93f28SJerome Brunet [AUD_CLKID_RESAMPLE] = &resample.hw, 9338ff93f28SJerome Brunet [AUD_CLKID_POWER_DETECT] = &power_detect.hw, 9348ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_B] = &spdifout_b.hw, 9358ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK_SEL] = &mst_a_mclk_sel.hw, 9368ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK_SEL] = &mst_b_mclk_sel.hw, 9378ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK_SEL] = &mst_c_mclk_sel.hw, 9388ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK_SEL] = &mst_d_mclk_sel.hw, 9398ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK_SEL] = &mst_e_mclk_sel.hw, 9408ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK_SEL] = &mst_f_mclk_sel.hw, 9418ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK_DIV] = &mst_a_mclk_div.hw, 9428ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK_DIV] = &mst_b_mclk_div.hw, 9438ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK_DIV] = &mst_c_mclk_div.hw, 9448ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK_DIV] = &mst_d_mclk_div.hw, 9458ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK_DIV] = &mst_e_mclk_div.hw, 9468ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK_DIV] = &mst_f_mclk_div.hw, 9478ff93f28SJerome Brunet [AUD_CLKID_MST_A_MCLK] = &mst_a_mclk.hw, 9488ff93f28SJerome Brunet [AUD_CLKID_MST_B_MCLK] = &mst_b_mclk.hw, 9498ff93f28SJerome Brunet [AUD_CLKID_MST_C_MCLK] = &mst_c_mclk.hw, 9508ff93f28SJerome Brunet [AUD_CLKID_MST_D_MCLK] = &mst_d_mclk.hw, 9518ff93f28SJerome Brunet [AUD_CLKID_MST_E_MCLK] = &mst_e_mclk.hw, 9528ff93f28SJerome Brunet [AUD_CLKID_MST_F_MCLK] = &mst_f_mclk.hw, 9538ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw, 9548ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw, 9558ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw, 9568ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK_SEL] = &spdifout_b_clk_sel.hw, 9578ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK_DIV] = &spdifout_b_clk_div.hw, 9588ff93f28SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK] = &spdifout_b_clk.hw, 9598ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw, 9608ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw, 9618ff93f28SJerome Brunet [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw, 9628ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw, 9638ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw, 9648ff93f28SJerome Brunet [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw, 9658ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw, 9668ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw, 9678ff93f28SJerome Brunet [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw, 9688ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw, 9698ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw, 9708ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw, 9718ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw, 9728ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw, 9738ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw, 9748ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw, 9758ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw, 9768ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw, 9778ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw, 9788ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw, 9798ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw, 9808ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw, 9818ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw, 9828ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw, 9838ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw, 9848ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw, 9858ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw, 9868ff93f28SJerome Brunet [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw, 9878ff93f28SJerome Brunet [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw, 9888ff93f28SJerome Brunet [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw, 9898ff93f28SJerome Brunet [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw, 9908ff93f28SJerome Brunet [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw, 9918ff93f28SJerome Brunet [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw, 9928ff93f28SJerome Brunet [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw, 9938ff93f28SJerome Brunet [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw, 9948ff93f28SJerome Brunet [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw, 9958ff93f28SJerome Brunet [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw, 9968ff93f28SJerome Brunet [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw, 9978ff93f28SJerome Brunet [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw, 9988ff93f28SJerome Brunet [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw, 9998ff93f28SJerome Brunet [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw, 10008ff93f28SJerome Brunet [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw, 10018ff93f28SJerome Brunet [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw, 10028ff93f28SJerome Brunet [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw, 10038ff93f28SJerome Brunet [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw, 10048ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw, 10058ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw, 10068ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw, 10078ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw, 10088ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw, 10098ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw, 10108ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw, 10118ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw, 10128ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw, 10138ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw, 10148ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw, 10158ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw, 10168ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw, 10178ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw, 10188ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw, 10198ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw, 10208ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw, 10218ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw, 10228ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw, 10238ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw, 10248ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw, 10258ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw, 10268ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw, 10278ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw, 10288ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw, 10298ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK] = &tdmout_a_sclk.hw, 10308ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK] = &tdmout_b_sclk.hw, 10318ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK] = &tdmout_c_sclk.hw, 10328ff93f28SJerome Brunet [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw, 10338ff93f28SJerome Brunet [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw, 10348ff93f28SJerome Brunet [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw, 10358ff93f28SJerome Brunet [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw, 10368ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw, 10378ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw, 10388ff93f28SJerome Brunet [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw, 10398ff93f28SJerome Brunet [AUD_CLKID_TDM_MCLK_PAD0] = &g12a_tdm_mclk_pad_0.hw, 10408ff93f28SJerome Brunet [AUD_CLKID_TDM_MCLK_PAD1] = &g12a_tdm_mclk_pad_1.hw, 10418ff93f28SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD0] = &g12a_tdm_lrclk_pad_0.hw, 10428ff93f28SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD1] = &g12a_tdm_lrclk_pad_1.hw, 10438ff93f28SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD2] = &g12a_tdm_lrclk_pad_2.hw, 10448ff93f28SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD0] = &g12a_tdm_sclk_pad_0.hw, 10458ff93f28SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD1] = &g12a_tdm_sclk_pad_1.hw, 10468ff93f28SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD2] = &g12a_tdm_sclk_pad_2.hw, 1047cf52db45SJerome Brunet [AUD_CLKID_TOP] = &axg_aud_top, 104807500138SMaxime Jourdan [NR_CLKS] = NULL, 104907500138SMaxime Jourdan }, 105007500138SMaxime Jourdan .num = NR_CLKS, 105107500138SMaxime Jourdan }; 105207500138SMaxime Jourdan 1053be4fe445SJerome Brunet /* 1054be4fe445SJerome Brunet * Array of all SM1 clocks provided by this provider 1055be4fe445SJerome Brunet * The input clocks of the controller will be populated at runtime 1056be4fe445SJerome Brunet */ 1057be4fe445SJerome Brunet static struct clk_hw_onecell_data sm1_audio_hw_onecell_data = { 1058be4fe445SJerome Brunet .hws = { 1059be4fe445SJerome Brunet [AUD_CLKID_DDR_ARB] = &ddr_arb.hw, 1060be4fe445SJerome Brunet [AUD_CLKID_PDM] = &pdm.hw, 1061be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A] = &tdmin_a.hw, 1062be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B] = &tdmin_b.hw, 1063be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C] = &tdmin_c.hw, 1064be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw, 1065be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw, 1066be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw, 1067be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw, 1068be4fe445SJerome Brunet [AUD_CLKID_FRDDR_A] = &frddr_a.hw, 1069be4fe445SJerome Brunet [AUD_CLKID_FRDDR_B] = &frddr_b.hw, 1070be4fe445SJerome Brunet [AUD_CLKID_FRDDR_C] = &frddr_c.hw, 1071be4fe445SJerome Brunet [AUD_CLKID_TODDR_A] = &toddr_a.hw, 1072be4fe445SJerome Brunet [AUD_CLKID_TODDR_B] = &toddr_b.hw, 1073be4fe445SJerome Brunet [AUD_CLKID_TODDR_C] = &toddr_c.hw, 1074be4fe445SJerome Brunet [AUD_CLKID_LOOPBACK] = &loopback.hw, 1075be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN] = &spdifin.hw, 1076be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT] = &spdifout.hw, 1077be4fe445SJerome Brunet [AUD_CLKID_RESAMPLE] = &resample.hw, 1078be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_B] = &spdifout_b.hw, 1079be4fe445SJerome Brunet [AUD_CLKID_MST_A_MCLK_SEL] = &sm1_mst_a_mclk_sel.hw, 1080be4fe445SJerome Brunet [AUD_CLKID_MST_B_MCLK_SEL] = &sm1_mst_b_mclk_sel.hw, 1081be4fe445SJerome Brunet [AUD_CLKID_MST_C_MCLK_SEL] = &sm1_mst_c_mclk_sel.hw, 1082be4fe445SJerome Brunet [AUD_CLKID_MST_D_MCLK_SEL] = &sm1_mst_d_mclk_sel.hw, 1083be4fe445SJerome Brunet [AUD_CLKID_MST_E_MCLK_SEL] = &sm1_mst_e_mclk_sel.hw, 1084be4fe445SJerome Brunet [AUD_CLKID_MST_F_MCLK_SEL] = &sm1_mst_f_mclk_sel.hw, 1085be4fe445SJerome Brunet [AUD_CLKID_MST_A_MCLK_DIV] = &sm1_mst_a_mclk_div.hw, 1086be4fe445SJerome Brunet [AUD_CLKID_MST_B_MCLK_DIV] = &sm1_mst_b_mclk_div.hw, 1087be4fe445SJerome Brunet [AUD_CLKID_MST_C_MCLK_DIV] = &sm1_mst_c_mclk_div.hw, 1088be4fe445SJerome Brunet [AUD_CLKID_MST_D_MCLK_DIV] = &sm1_mst_d_mclk_div.hw, 1089be4fe445SJerome Brunet [AUD_CLKID_MST_E_MCLK_DIV] = &sm1_mst_e_mclk_div.hw, 1090be4fe445SJerome Brunet [AUD_CLKID_MST_F_MCLK_DIV] = &sm1_mst_f_mclk_div.hw, 1091be4fe445SJerome Brunet [AUD_CLKID_MST_A_MCLK] = &sm1_mst_a_mclk.hw, 1092be4fe445SJerome Brunet [AUD_CLKID_MST_B_MCLK] = &sm1_mst_b_mclk.hw, 1093be4fe445SJerome Brunet [AUD_CLKID_MST_C_MCLK] = &sm1_mst_c_mclk.hw, 1094be4fe445SJerome Brunet [AUD_CLKID_MST_D_MCLK] = &sm1_mst_d_mclk.hw, 1095be4fe445SJerome Brunet [AUD_CLKID_MST_E_MCLK] = &sm1_mst_e_mclk.hw, 1096be4fe445SJerome Brunet [AUD_CLKID_MST_F_MCLK] = &sm1_mst_f_mclk.hw, 1097be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw, 1098be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw, 1099be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw, 1100be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK_SEL] = &spdifout_b_clk_sel.hw, 1101be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK_DIV] = &spdifout_b_clk_div.hw, 1102be4fe445SJerome Brunet [AUD_CLKID_SPDIFOUT_B_CLK] = &spdifout_b_clk.hw, 1103be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw, 1104be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw, 1105be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw, 1106be4fe445SJerome Brunet [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw, 1107be4fe445SJerome Brunet [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw, 1108be4fe445SJerome Brunet [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw, 1109be4fe445SJerome Brunet [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw, 1110be4fe445SJerome Brunet [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw, 1111be4fe445SJerome Brunet [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw, 1112be4fe445SJerome Brunet [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw, 1113be4fe445SJerome Brunet [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw, 1114be4fe445SJerome Brunet [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw, 1115be4fe445SJerome Brunet [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw, 1116be4fe445SJerome Brunet [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw, 1117be4fe445SJerome Brunet [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw, 1118be4fe445SJerome Brunet [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw, 1119be4fe445SJerome Brunet [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw, 1120be4fe445SJerome Brunet [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw, 1121be4fe445SJerome Brunet [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw, 1122be4fe445SJerome Brunet [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw, 1123be4fe445SJerome Brunet [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw, 1124be4fe445SJerome Brunet [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw, 1125be4fe445SJerome Brunet [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw, 1126be4fe445SJerome Brunet [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw, 1127be4fe445SJerome Brunet [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw, 1128be4fe445SJerome Brunet [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw, 1129be4fe445SJerome Brunet [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw, 1130be4fe445SJerome Brunet [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw, 1131be4fe445SJerome Brunet [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw, 1132be4fe445SJerome Brunet [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw, 1133be4fe445SJerome Brunet [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw, 1134be4fe445SJerome Brunet [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw, 1135be4fe445SJerome Brunet [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw, 1136be4fe445SJerome Brunet [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw, 1137be4fe445SJerome Brunet [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw, 1138be4fe445SJerome Brunet [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw, 1139be4fe445SJerome Brunet [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw, 1140be4fe445SJerome Brunet [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw, 1141be4fe445SJerome Brunet [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw, 1142be4fe445SJerome Brunet [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw, 1143be4fe445SJerome Brunet [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw, 1144be4fe445SJerome Brunet [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw, 1145be4fe445SJerome Brunet [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw, 1146be4fe445SJerome Brunet [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw, 1147be4fe445SJerome Brunet [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw, 1148be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw, 1149be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw, 1150be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw, 1151be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw, 1152be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw, 1153be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw, 1154be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw, 1155be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw, 1156be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw, 1157be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw, 1158be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw, 1159be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw, 1160be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw, 1161be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw, 1162be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw, 1163be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw, 1164be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw, 1165be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw, 1166be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw, 1167be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw, 1168be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw, 1169be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw, 1170be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw, 1171be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw, 1172be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw, 1173be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_SCLK] = &tdmout_a_sclk.hw, 1174be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_SCLK] = &tdmout_b_sclk.hw, 1175be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_SCLK] = &tdmout_c_sclk.hw, 1176be4fe445SJerome Brunet [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw, 1177be4fe445SJerome Brunet [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw, 1178be4fe445SJerome Brunet [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw, 1179be4fe445SJerome Brunet [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw, 1180be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw, 1181be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw, 1182be4fe445SJerome Brunet [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw, 1183be4fe445SJerome Brunet [AUD_CLKID_TDM_MCLK_PAD0] = &sm1_tdm_mclk_pad_0.hw, 1184be4fe445SJerome Brunet [AUD_CLKID_TDM_MCLK_PAD1] = &sm1_tdm_mclk_pad_1.hw, 1185be4fe445SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD0] = &sm1_tdm_lrclk_pad_0.hw, 1186be4fe445SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD1] = &sm1_tdm_lrclk_pad_1.hw, 1187be4fe445SJerome Brunet [AUD_CLKID_TDM_LRCLK_PAD2] = &sm1_tdm_lrclk_pad_2.hw, 1188be4fe445SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD0] = &sm1_tdm_sclk_pad_0.hw, 1189be4fe445SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD1] = &sm1_tdm_sclk_pad_1.hw, 1190be4fe445SJerome Brunet [AUD_CLKID_TDM_SCLK_PAD2] = &sm1_tdm_sclk_pad_2.hw, 1191be4fe445SJerome Brunet [AUD_CLKID_TOP] = &sm1_aud_top.hw, 1192be4fe445SJerome Brunet [AUD_CLKID_TORAM] = &toram.hw, 1193be4fe445SJerome Brunet [AUD_CLKID_EQDRC] = &eqdrc.hw, 1194be4fe445SJerome Brunet [AUD_CLKID_RESAMPLE_B] = &resample_b.hw, 1195be4fe445SJerome Brunet [AUD_CLKID_TOVAD] = &tovad.hw, 1196be4fe445SJerome Brunet [AUD_CLKID_LOCKER] = &locker.hw, 1197be4fe445SJerome Brunet [AUD_CLKID_SPDIFIN_LB] = &spdifin_lb.hw, 1198be4fe445SJerome Brunet [AUD_CLKID_FRDDR_D] = &frddr_d.hw, 1199be4fe445SJerome Brunet [AUD_CLKID_TODDR_D] = &toddr_d.hw, 1200be4fe445SJerome Brunet [AUD_CLKID_LOOPBACK_B] = &loopback_b.hw, 1201be4fe445SJerome Brunet [AUD_CLKID_CLK81_EN] = &sm1_clk81_en.hw, 1202be4fe445SJerome Brunet [AUD_CLKID_SYSCLK_A_DIV] = &sm1_sysclk_a_div.hw, 1203be4fe445SJerome Brunet [AUD_CLKID_SYSCLK_A_EN] = &sm1_sysclk_a_en.hw, 1204be4fe445SJerome Brunet [AUD_CLKID_SYSCLK_B_DIV] = &sm1_sysclk_b_div.hw, 1205be4fe445SJerome Brunet [AUD_CLKID_SYSCLK_B_EN] = &sm1_sysclk_b_en.hw, 1206be4fe445SJerome Brunet [NR_CLKS] = NULL, 1207be4fe445SJerome Brunet }, 1208be4fe445SJerome Brunet .num = NR_CLKS, 1209be4fe445SJerome Brunet }; 1210be4fe445SJerome Brunet 1211be4fe445SJerome Brunet 121207500138SMaxime Jourdan /* Convenience table to populate regmap in .probe() 121307500138SMaxime Jourdan * Note that this table is shared between both AXG and G12A, 121407500138SMaxime Jourdan * with spdifout_b clocks being exclusive to G12A. Since those 121507500138SMaxime Jourdan * clocks are not declared within the AXG onecell table, we do not 121607500138SMaxime Jourdan * feel the need to have separate AXG/G12A regmap tables. 121707500138SMaxime Jourdan */ 1218be4fe445SJerome Brunet static struct clk_regmap *const axg_clk_regmaps[] = { 12198ff93f28SJerome Brunet &ddr_arb, 12208ff93f28SJerome Brunet &pdm, 12218ff93f28SJerome Brunet &tdmin_a, 12228ff93f28SJerome Brunet &tdmin_b, 12238ff93f28SJerome Brunet &tdmin_c, 12248ff93f28SJerome Brunet &tdmin_lb, 12258ff93f28SJerome Brunet &tdmout_a, 12268ff93f28SJerome Brunet &tdmout_b, 12278ff93f28SJerome Brunet &tdmout_c, 12288ff93f28SJerome Brunet &frddr_a, 12298ff93f28SJerome Brunet &frddr_b, 12308ff93f28SJerome Brunet &frddr_c, 12318ff93f28SJerome Brunet &toddr_a, 12328ff93f28SJerome Brunet &toddr_b, 12338ff93f28SJerome Brunet &toddr_c, 12348ff93f28SJerome Brunet &loopback, 12358ff93f28SJerome Brunet &spdifin, 12368ff93f28SJerome Brunet &spdifout, 12378ff93f28SJerome Brunet &resample, 12388ff93f28SJerome Brunet &power_detect, 12398ff93f28SJerome Brunet &spdifout_b, 12408ff93f28SJerome Brunet &mst_a_mclk_sel, 12418ff93f28SJerome Brunet &mst_b_mclk_sel, 12428ff93f28SJerome Brunet &mst_c_mclk_sel, 12438ff93f28SJerome Brunet &mst_d_mclk_sel, 12448ff93f28SJerome Brunet &mst_e_mclk_sel, 12458ff93f28SJerome Brunet &mst_f_mclk_sel, 12468ff93f28SJerome Brunet &mst_a_mclk_div, 12478ff93f28SJerome Brunet &mst_b_mclk_div, 12488ff93f28SJerome Brunet &mst_c_mclk_div, 12498ff93f28SJerome Brunet &mst_d_mclk_div, 12508ff93f28SJerome Brunet &mst_e_mclk_div, 12518ff93f28SJerome Brunet &mst_f_mclk_div, 12528ff93f28SJerome Brunet &mst_a_mclk, 12538ff93f28SJerome Brunet &mst_b_mclk, 12548ff93f28SJerome Brunet &mst_c_mclk, 12558ff93f28SJerome Brunet &mst_d_mclk, 12568ff93f28SJerome Brunet &mst_e_mclk, 12578ff93f28SJerome Brunet &mst_f_mclk, 12588ff93f28SJerome Brunet &spdifout_clk_sel, 12598ff93f28SJerome Brunet &spdifout_clk_div, 12608ff93f28SJerome Brunet &spdifout_clk, 12618ff93f28SJerome Brunet &spdifin_clk_sel, 12628ff93f28SJerome Brunet &spdifin_clk_div, 12638ff93f28SJerome Brunet &spdifin_clk, 12648ff93f28SJerome Brunet &pdm_dclk_sel, 12658ff93f28SJerome Brunet &pdm_dclk_div, 12668ff93f28SJerome Brunet &pdm_dclk, 12678ff93f28SJerome Brunet &pdm_sysclk_sel, 12688ff93f28SJerome Brunet &pdm_sysclk_div, 12698ff93f28SJerome Brunet &pdm_sysclk, 12708ff93f28SJerome Brunet &mst_a_sclk_pre_en, 12718ff93f28SJerome Brunet &mst_b_sclk_pre_en, 12728ff93f28SJerome Brunet &mst_c_sclk_pre_en, 12738ff93f28SJerome Brunet &mst_d_sclk_pre_en, 12748ff93f28SJerome Brunet &mst_e_sclk_pre_en, 12758ff93f28SJerome Brunet &mst_f_sclk_pre_en, 12768ff93f28SJerome Brunet &mst_a_sclk_div, 12778ff93f28SJerome Brunet &mst_b_sclk_div, 12788ff93f28SJerome Brunet &mst_c_sclk_div, 12798ff93f28SJerome Brunet &mst_d_sclk_div, 12808ff93f28SJerome Brunet &mst_e_sclk_div, 12818ff93f28SJerome Brunet &mst_f_sclk_div, 12828ff93f28SJerome Brunet &mst_a_sclk_post_en, 12838ff93f28SJerome Brunet &mst_b_sclk_post_en, 12848ff93f28SJerome Brunet &mst_c_sclk_post_en, 12858ff93f28SJerome Brunet &mst_d_sclk_post_en, 12868ff93f28SJerome Brunet &mst_e_sclk_post_en, 12878ff93f28SJerome Brunet &mst_f_sclk_post_en, 12888ff93f28SJerome Brunet &mst_a_sclk, 12898ff93f28SJerome Brunet &mst_b_sclk, 12908ff93f28SJerome Brunet &mst_c_sclk, 12918ff93f28SJerome Brunet &mst_d_sclk, 12928ff93f28SJerome Brunet &mst_e_sclk, 12938ff93f28SJerome Brunet &mst_f_sclk, 12948ff93f28SJerome Brunet &mst_a_lrclk_div, 12958ff93f28SJerome Brunet &mst_b_lrclk_div, 12968ff93f28SJerome Brunet &mst_c_lrclk_div, 12978ff93f28SJerome Brunet &mst_d_lrclk_div, 12988ff93f28SJerome Brunet &mst_e_lrclk_div, 12998ff93f28SJerome Brunet &mst_f_lrclk_div, 13008ff93f28SJerome Brunet &mst_a_lrclk, 13018ff93f28SJerome Brunet &mst_b_lrclk, 13028ff93f28SJerome Brunet &mst_c_lrclk, 13038ff93f28SJerome Brunet &mst_d_lrclk, 13048ff93f28SJerome Brunet &mst_e_lrclk, 13058ff93f28SJerome Brunet &mst_f_lrclk, 13068ff93f28SJerome Brunet &tdmin_a_sclk_sel, 13078ff93f28SJerome Brunet &tdmin_b_sclk_sel, 13088ff93f28SJerome Brunet &tdmin_c_sclk_sel, 13098ff93f28SJerome Brunet &tdmin_lb_sclk_sel, 13108ff93f28SJerome Brunet &tdmout_a_sclk_sel, 13118ff93f28SJerome Brunet &tdmout_b_sclk_sel, 13128ff93f28SJerome Brunet &tdmout_c_sclk_sel, 13138ff93f28SJerome Brunet &tdmin_a_sclk_pre_en, 13148ff93f28SJerome Brunet &tdmin_b_sclk_pre_en, 13158ff93f28SJerome Brunet &tdmin_c_sclk_pre_en, 13168ff93f28SJerome Brunet &tdmin_lb_sclk_pre_en, 13178ff93f28SJerome Brunet &tdmout_a_sclk_pre_en, 13188ff93f28SJerome Brunet &tdmout_b_sclk_pre_en, 13198ff93f28SJerome Brunet &tdmout_c_sclk_pre_en, 13208ff93f28SJerome Brunet &tdmin_a_sclk_post_en, 13218ff93f28SJerome Brunet &tdmin_b_sclk_post_en, 13228ff93f28SJerome Brunet &tdmin_c_sclk_post_en, 13238ff93f28SJerome Brunet &tdmin_lb_sclk_post_en, 13248ff93f28SJerome Brunet &tdmout_a_sclk_post_en, 13258ff93f28SJerome Brunet &tdmout_b_sclk_post_en, 13268ff93f28SJerome Brunet &tdmout_c_sclk_post_en, 13278ff93f28SJerome Brunet &tdmin_a_sclk, 13288ff93f28SJerome Brunet &tdmin_b_sclk, 13298ff93f28SJerome Brunet &tdmin_c_sclk, 13308ff93f28SJerome Brunet &tdmin_lb_sclk, 13318ff93f28SJerome Brunet &tdmout_a_sclk, 13328ff93f28SJerome Brunet &tdmout_b_sclk, 13338ff93f28SJerome Brunet &tdmout_c_sclk, 13348ff93f28SJerome Brunet &tdmin_a_lrclk, 13358ff93f28SJerome Brunet &tdmin_b_lrclk, 13368ff93f28SJerome Brunet &tdmin_c_lrclk, 13378ff93f28SJerome Brunet &tdmin_lb_lrclk, 13388ff93f28SJerome Brunet &tdmout_a_lrclk, 13398ff93f28SJerome Brunet &tdmout_b_lrclk, 13408ff93f28SJerome Brunet &tdmout_c_lrclk, 13418ff93f28SJerome Brunet &spdifout_b_clk_sel, 13428ff93f28SJerome Brunet &spdifout_b_clk_div, 13438ff93f28SJerome Brunet &spdifout_b_clk, 13448ff93f28SJerome Brunet &g12a_tdm_mclk_pad_0, 13458ff93f28SJerome Brunet &g12a_tdm_mclk_pad_1, 13468ff93f28SJerome Brunet &g12a_tdm_lrclk_pad_0, 13478ff93f28SJerome Brunet &g12a_tdm_lrclk_pad_1, 13488ff93f28SJerome Brunet &g12a_tdm_lrclk_pad_2, 13498ff93f28SJerome Brunet &g12a_tdm_sclk_pad_0, 13508ff93f28SJerome Brunet &g12a_tdm_sclk_pad_1, 13518ff93f28SJerome Brunet &g12a_tdm_sclk_pad_2, 1352be4fe445SJerome Brunet &toram, 1353be4fe445SJerome Brunet &eqdrc, 1354be4fe445SJerome Brunet }; 1355be4fe445SJerome Brunet 1356be4fe445SJerome Brunet static struct clk_regmap *const sm1_clk_regmaps[] = { 1357be4fe445SJerome Brunet &ddr_arb, 1358be4fe445SJerome Brunet &pdm, 1359be4fe445SJerome Brunet &tdmin_a, 1360be4fe445SJerome Brunet &tdmin_b, 1361be4fe445SJerome Brunet &tdmin_c, 1362be4fe445SJerome Brunet &tdmin_lb, 1363be4fe445SJerome Brunet &tdmout_a, 1364be4fe445SJerome Brunet &tdmout_b, 1365be4fe445SJerome Brunet &tdmout_c, 1366be4fe445SJerome Brunet &frddr_a, 1367be4fe445SJerome Brunet &frddr_b, 1368be4fe445SJerome Brunet &frddr_c, 1369be4fe445SJerome Brunet &toddr_a, 1370be4fe445SJerome Brunet &toddr_b, 1371be4fe445SJerome Brunet &toddr_c, 1372be4fe445SJerome Brunet &loopback, 1373be4fe445SJerome Brunet &spdifin, 1374be4fe445SJerome Brunet &spdifout, 1375be4fe445SJerome Brunet &resample, 1376be4fe445SJerome Brunet &spdifout_b, 1377be4fe445SJerome Brunet &sm1_mst_a_mclk_sel, 1378be4fe445SJerome Brunet &sm1_mst_b_mclk_sel, 1379be4fe445SJerome Brunet &sm1_mst_c_mclk_sel, 1380be4fe445SJerome Brunet &sm1_mst_d_mclk_sel, 1381be4fe445SJerome Brunet &sm1_mst_e_mclk_sel, 1382be4fe445SJerome Brunet &sm1_mst_f_mclk_sel, 1383be4fe445SJerome Brunet &sm1_mst_a_mclk_div, 1384be4fe445SJerome Brunet &sm1_mst_b_mclk_div, 1385be4fe445SJerome Brunet &sm1_mst_c_mclk_div, 1386be4fe445SJerome Brunet &sm1_mst_d_mclk_div, 1387be4fe445SJerome Brunet &sm1_mst_e_mclk_div, 1388be4fe445SJerome Brunet &sm1_mst_f_mclk_div, 1389be4fe445SJerome Brunet &sm1_mst_a_mclk, 1390be4fe445SJerome Brunet &sm1_mst_b_mclk, 1391be4fe445SJerome Brunet &sm1_mst_c_mclk, 1392be4fe445SJerome Brunet &sm1_mst_d_mclk, 1393be4fe445SJerome Brunet &sm1_mst_e_mclk, 1394be4fe445SJerome Brunet &sm1_mst_f_mclk, 1395be4fe445SJerome Brunet &spdifout_clk_sel, 1396be4fe445SJerome Brunet &spdifout_clk_div, 1397be4fe445SJerome Brunet &spdifout_clk, 1398be4fe445SJerome Brunet &spdifin_clk_sel, 1399be4fe445SJerome Brunet &spdifin_clk_div, 1400be4fe445SJerome Brunet &spdifin_clk, 1401be4fe445SJerome Brunet &pdm_dclk_sel, 1402be4fe445SJerome Brunet &pdm_dclk_div, 1403be4fe445SJerome Brunet &pdm_dclk, 1404be4fe445SJerome Brunet &pdm_sysclk_sel, 1405be4fe445SJerome Brunet &pdm_sysclk_div, 1406be4fe445SJerome Brunet &pdm_sysclk, 1407be4fe445SJerome Brunet &mst_a_sclk_pre_en, 1408be4fe445SJerome Brunet &mst_b_sclk_pre_en, 1409be4fe445SJerome Brunet &mst_c_sclk_pre_en, 1410be4fe445SJerome Brunet &mst_d_sclk_pre_en, 1411be4fe445SJerome Brunet &mst_e_sclk_pre_en, 1412be4fe445SJerome Brunet &mst_f_sclk_pre_en, 1413be4fe445SJerome Brunet &mst_a_sclk_div, 1414be4fe445SJerome Brunet &mst_b_sclk_div, 1415be4fe445SJerome Brunet &mst_c_sclk_div, 1416be4fe445SJerome Brunet &mst_d_sclk_div, 1417be4fe445SJerome Brunet &mst_e_sclk_div, 1418be4fe445SJerome Brunet &mst_f_sclk_div, 1419be4fe445SJerome Brunet &mst_a_sclk_post_en, 1420be4fe445SJerome Brunet &mst_b_sclk_post_en, 1421be4fe445SJerome Brunet &mst_c_sclk_post_en, 1422be4fe445SJerome Brunet &mst_d_sclk_post_en, 1423be4fe445SJerome Brunet &mst_e_sclk_post_en, 1424be4fe445SJerome Brunet &mst_f_sclk_post_en, 1425be4fe445SJerome Brunet &mst_a_sclk, 1426be4fe445SJerome Brunet &mst_b_sclk, 1427be4fe445SJerome Brunet &mst_c_sclk, 1428be4fe445SJerome Brunet &mst_d_sclk, 1429be4fe445SJerome Brunet &mst_e_sclk, 1430be4fe445SJerome Brunet &mst_f_sclk, 1431be4fe445SJerome Brunet &mst_a_lrclk_div, 1432be4fe445SJerome Brunet &mst_b_lrclk_div, 1433be4fe445SJerome Brunet &mst_c_lrclk_div, 1434be4fe445SJerome Brunet &mst_d_lrclk_div, 1435be4fe445SJerome Brunet &mst_e_lrclk_div, 1436be4fe445SJerome Brunet &mst_f_lrclk_div, 1437be4fe445SJerome Brunet &mst_a_lrclk, 1438be4fe445SJerome Brunet &mst_b_lrclk, 1439be4fe445SJerome Brunet &mst_c_lrclk, 1440be4fe445SJerome Brunet &mst_d_lrclk, 1441be4fe445SJerome Brunet &mst_e_lrclk, 1442be4fe445SJerome Brunet &mst_f_lrclk, 1443be4fe445SJerome Brunet &tdmin_a_sclk_sel, 1444be4fe445SJerome Brunet &tdmin_b_sclk_sel, 1445be4fe445SJerome Brunet &tdmin_c_sclk_sel, 1446be4fe445SJerome Brunet &tdmin_lb_sclk_sel, 1447be4fe445SJerome Brunet &tdmout_a_sclk_sel, 1448be4fe445SJerome Brunet &tdmout_b_sclk_sel, 1449be4fe445SJerome Brunet &tdmout_c_sclk_sel, 1450be4fe445SJerome Brunet &tdmin_a_sclk_pre_en, 1451be4fe445SJerome Brunet &tdmin_b_sclk_pre_en, 1452be4fe445SJerome Brunet &tdmin_c_sclk_pre_en, 1453be4fe445SJerome Brunet &tdmin_lb_sclk_pre_en, 1454be4fe445SJerome Brunet &tdmout_a_sclk_pre_en, 1455be4fe445SJerome Brunet &tdmout_b_sclk_pre_en, 1456be4fe445SJerome Brunet &tdmout_c_sclk_pre_en, 1457be4fe445SJerome Brunet &tdmin_a_sclk_post_en, 1458be4fe445SJerome Brunet &tdmin_b_sclk_post_en, 1459be4fe445SJerome Brunet &tdmin_c_sclk_post_en, 1460be4fe445SJerome Brunet &tdmin_lb_sclk_post_en, 1461be4fe445SJerome Brunet &tdmout_a_sclk_post_en, 1462be4fe445SJerome Brunet &tdmout_b_sclk_post_en, 1463be4fe445SJerome Brunet &tdmout_c_sclk_post_en, 1464be4fe445SJerome Brunet &tdmin_a_sclk, 1465be4fe445SJerome Brunet &tdmin_b_sclk, 1466be4fe445SJerome Brunet &tdmin_c_sclk, 1467be4fe445SJerome Brunet &tdmin_lb_sclk, 1468be4fe445SJerome Brunet &tdmout_a_sclk, 1469be4fe445SJerome Brunet &tdmout_b_sclk, 1470be4fe445SJerome Brunet &tdmout_c_sclk, 1471be4fe445SJerome Brunet &tdmin_a_lrclk, 1472be4fe445SJerome Brunet &tdmin_b_lrclk, 1473be4fe445SJerome Brunet &tdmin_c_lrclk, 1474be4fe445SJerome Brunet &tdmin_lb_lrclk, 1475be4fe445SJerome Brunet &tdmout_a_lrclk, 1476be4fe445SJerome Brunet &tdmout_b_lrclk, 1477be4fe445SJerome Brunet &tdmout_c_lrclk, 1478be4fe445SJerome Brunet &spdifout_b_clk_sel, 1479be4fe445SJerome Brunet &spdifout_b_clk_div, 1480be4fe445SJerome Brunet &spdifout_b_clk, 1481be4fe445SJerome Brunet &sm1_tdm_mclk_pad_0, 1482be4fe445SJerome Brunet &sm1_tdm_mclk_pad_1, 1483be4fe445SJerome Brunet &sm1_tdm_lrclk_pad_0, 1484be4fe445SJerome Brunet &sm1_tdm_lrclk_pad_1, 1485be4fe445SJerome Brunet &sm1_tdm_lrclk_pad_2, 1486be4fe445SJerome Brunet &sm1_tdm_sclk_pad_0, 1487be4fe445SJerome Brunet &sm1_tdm_sclk_pad_1, 1488be4fe445SJerome Brunet &sm1_tdm_sclk_pad_2, 1489be4fe445SJerome Brunet &sm1_aud_top, 1490be4fe445SJerome Brunet &toram, 1491be4fe445SJerome Brunet &eqdrc, 1492be4fe445SJerome Brunet &resample_b, 1493be4fe445SJerome Brunet &tovad, 1494be4fe445SJerome Brunet &locker, 1495be4fe445SJerome Brunet &spdifin_lb, 1496be4fe445SJerome Brunet &frddr_d, 1497be4fe445SJerome Brunet &toddr_d, 1498be4fe445SJerome Brunet &loopback_b, 1499be4fe445SJerome Brunet &sm1_clk81_en, 1500be4fe445SJerome Brunet &sm1_sysclk_a_div, 1501be4fe445SJerome Brunet &sm1_sysclk_a_en, 1502be4fe445SJerome Brunet &sm1_sysclk_b_div, 1503be4fe445SJerome Brunet &sm1_sysclk_b_en, 15041cd50181SJerome Brunet }; 15051cd50181SJerome Brunet 1506f03566d0SJerome Brunet static int devm_clk_get_enable(struct device *dev, char *id) 15071cd50181SJerome Brunet { 15081cd50181SJerome Brunet struct clk *clk; 15091cd50181SJerome Brunet int ret; 15101cd50181SJerome Brunet 15111cd50181SJerome Brunet clk = devm_clk_get(dev, id); 15121cd50181SJerome Brunet if (IS_ERR(clk)) { 1513f03566d0SJerome Brunet ret = PTR_ERR(clk); 1514f03566d0SJerome Brunet if (ret != -EPROBE_DEFER) 15151cd50181SJerome Brunet dev_err(dev, "failed to get %s", id); 1516f03566d0SJerome Brunet return ret; 15171cd50181SJerome Brunet } 15181cd50181SJerome Brunet 15191cd50181SJerome Brunet ret = clk_prepare_enable(clk); 15201cd50181SJerome Brunet if (ret) { 15211cd50181SJerome Brunet dev_err(dev, "failed to enable %s", id); 1522f03566d0SJerome Brunet return ret; 15231cd50181SJerome Brunet } 15241cd50181SJerome Brunet 15251cd50181SJerome Brunet ret = devm_add_action_or_reset(dev, 15261cd50181SJerome Brunet (void(*)(void *))clk_disable_unprepare, 15271cd50181SJerome Brunet clk); 15281cd50181SJerome Brunet if (ret) { 15291cd50181SJerome Brunet dev_err(dev, "failed to add reset action on %s", id); 1530f03566d0SJerome Brunet return ret; 15311cd50181SJerome Brunet } 15321cd50181SJerome Brunet 1533f03566d0SJerome Brunet return 0; 15341cd50181SJerome Brunet } 15351cd50181SJerome Brunet 15367cfefab6SJerome Brunet struct axg_audio_reset_data { 15377cfefab6SJerome Brunet struct reset_controller_dev rstc; 15387cfefab6SJerome Brunet struct regmap *map; 15397cfefab6SJerome Brunet unsigned int offset; 15407cfefab6SJerome Brunet }; 15417cfefab6SJerome Brunet 15427cfefab6SJerome Brunet static void axg_audio_reset_reg_and_bit(struct axg_audio_reset_data *rst, 15437cfefab6SJerome Brunet unsigned long id, 15447cfefab6SJerome Brunet unsigned int *reg, 15457cfefab6SJerome Brunet unsigned int *bit) 15467cfefab6SJerome Brunet { 15477cfefab6SJerome Brunet unsigned int stride = regmap_get_reg_stride(rst->map); 15487cfefab6SJerome Brunet 15497cfefab6SJerome Brunet *reg = (id / (stride * BITS_PER_BYTE)) * stride; 15507cfefab6SJerome Brunet *reg += rst->offset; 15517cfefab6SJerome Brunet *bit = id % (stride * BITS_PER_BYTE); 15527cfefab6SJerome Brunet } 15537cfefab6SJerome Brunet 15547cfefab6SJerome Brunet static int axg_audio_reset_update(struct reset_controller_dev *rcdev, 15557cfefab6SJerome Brunet unsigned long id, bool assert) 15567cfefab6SJerome Brunet { 15577cfefab6SJerome Brunet struct axg_audio_reset_data *rst = 15587cfefab6SJerome Brunet container_of(rcdev, struct axg_audio_reset_data, rstc); 15597cfefab6SJerome Brunet unsigned int offset, bit; 15607cfefab6SJerome Brunet 15617cfefab6SJerome Brunet axg_audio_reset_reg_and_bit(rst, id, &offset, &bit); 15627cfefab6SJerome Brunet 15637cfefab6SJerome Brunet regmap_update_bits(rst->map, offset, BIT(bit), 15647cfefab6SJerome Brunet assert ? BIT(bit) : 0); 15657cfefab6SJerome Brunet 15667cfefab6SJerome Brunet return 0; 15677cfefab6SJerome Brunet } 15687cfefab6SJerome Brunet 15697cfefab6SJerome Brunet static int axg_audio_reset_status(struct reset_controller_dev *rcdev, 15707cfefab6SJerome Brunet unsigned long id) 15717cfefab6SJerome Brunet { 15727cfefab6SJerome Brunet struct axg_audio_reset_data *rst = 15737cfefab6SJerome Brunet container_of(rcdev, struct axg_audio_reset_data, rstc); 15747cfefab6SJerome Brunet unsigned int val, offset, bit; 15757cfefab6SJerome Brunet 15767cfefab6SJerome Brunet axg_audio_reset_reg_and_bit(rst, id, &offset, &bit); 15777cfefab6SJerome Brunet 15787cfefab6SJerome Brunet regmap_read(rst->map, offset, &val); 15797cfefab6SJerome Brunet 15807cfefab6SJerome Brunet return !!(val & BIT(bit)); 15817cfefab6SJerome Brunet } 15827cfefab6SJerome Brunet 15837cfefab6SJerome Brunet static int axg_audio_reset_assert(struct reset_controller_dev *rcdev, 15847cfefab6SJerome Brunet unsigned long id) 15857cfefab6SJerome Brunet { 15867cfefab6SJerome Brunet return axg_audio_reset_update(rcdev, id, true); 15877cfefab6SJerome Brunet } 15887cfefab6SJerome Brunet 15897cfefab6SJerome Brunet static int axg_audio_reset_deassert(struct reset_controller_dev *rcdev, 15907cfefab6SJerome Brunet unsigned long id) 15917cfefab6SJerome Brunet { 15927cfefab6SJerome Brunet return axg_audio_reset_update(rcdev, id, false); 15937cfefab6SJerome Brunet } 15947cfefab6SJerome Brunet 15957cfefab6SJerome Brunet static int axg_audio_reset_toggle(struct reset_controller_dev *rcdev, 15967cfefab6SJerome Brunet unsigned long id) 15977cfefab6SJerome Brunet { 15987cfefab6SJerome Brunet int ret; 15997cfefab6SJerome Brunet 16007cfefab6SJerome Brunet ret = axg_audio_reset_assert(rcdev, id); 16017cfefab6SJerome Brunet if (ret) 16027cfefab6SJerome Brunet return ret; 16037cfefab6SJerome Brunet 16047cfefab6SJerome Brunet return axg_audio_reset_deassert(rcdev, id); 16057cfefab6SJerome Brunet } 16067cfefab6SJerome Brunet 16077cfefab6SJerome Brunet static const struct reset_control_ops axg_audio_rstc_ops = { 16087cfefab6SJerome Brunet .assert = axg_audio_reset_assert, 16097cfefab6SJerome Brunet .deassert = axg_audio_reset_deassert, 16107cfefab6SJerome Brunet .reset = axg_audio_reset_toggle, 16117cfefab6SJerome Brunet .status = axg_audio_reset_status, 16127cfefab6SJerome Brunet }; 16137cfefab6SJerome Brunet 16141cd50181SJerome Brunet static const struct regmap_config axg_audio_regmap_cfg = { 16151cd50181SJerome Brunet .reg_bits = 32, 16161cd50181SJerome Brunet .val_bits = 32, 16171cd50181SJerome Brunet .reg_stride = 4, 1618255cab9dSJerome Brunet .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL, 16191cd50181SJerome Brunet }; 16201cd50181SJerome Brunet 162107500138SMaxime Jourdan struct audioclk_data { 1622be4fe445SJerome Brunet struct clk_regmap *const *regmap_clks; 1623be4fe445SJerome Brunet unsigned int regmap_clk_num; 162407500138SMaxime Jourdan struct clk_hw_onecell_data *hw_onecell_data; 16257cfefab6SJerome Brunet unsigned int reset_offset; 16267cfefab6SJerome Brunet unsigned int reset_num; 162707500138SMaxime Jourdan }; 162807500138SMaxime Jourdan 16291cd50181SJerome Brunet static int axg_audio_clkc_probe(struct platform_device *pdev) 16301cd50181SJerome Brunet { 16311cd50181SJerome Brunet struct device *dev = &pdev->dev; 163207500138SMaxime Jourdan const struct audioclk_data *data; 16337cfefab6SJerome Brunet struct axg_audio_reset_data *rst; 16341cd50181SJerome Brunet struct regmap *map; 16351cd50181SJerome Brunet void __iomem *regs; 16361cd50181SJerome Brunet struct clk_hw *hw; 16371cd50181SJerome Brunet int ret, i; 16381cd50181SJerome Brunet 163907500138SMaxime Jourdan data = of_device_get_match_data(dev); 164007500138SMaxime Jourdan if (!data) 164107500138SMaxime Jourdan return -EINVAL; 164207500138SMaxime Jourdan 1643*50bf025bSYueHaibing regs = devm_platform_ioremap_resource(pdev, 0); 16441cd50181SJerome Brunet if (IS_ERR(regs)) 16451cd50181SJerome Brunet return PTR_ERR(regs); 16461cd50181SJerome Brunet 16471cd50181SJerome Brunet map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg); 16481cd50181SJerome Brunet if (IS_ERR(map)) { 16491cd50181SJerome Brunet dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map)); 16501cd50181SJerome Brunet return PTR_ERR(map); 16511cd50181SJerome Brunet } 16521cd50181SJerome Brunet 16531cd50181SJerome Brunet /* Get the mandatory peripheral clock */ 1654f03566d0SJerome Brunet ret = devm_clk_get_enable(dev, "pclk"); 1655f03566d0SJerome Brunet if (ret) 1656f03566d0SJerome Brunet return ret; 16571cd50181SJerome Brunet 16581cd50181SJerome Brunet ret = device_reset(dev); 16591cd50181SJerome Brunet if (ret) { 16601cd50181SJerome Brunet dev_err(dev, "failed to reset device\n"); 16611cd50181SJerome Brunet return ret; 16621cd50181SJerome Brunet } 16631cd50181SJerome Brunet 16641cd50181SJerome Brunet /* Populate regmap for the regmap backed clocks */ 1665be4fe445SJerome Brunet for (i = 0; i < data->regmap_clk_num; i++) 1666be4fe445SJerome Brunet data->regmap_clks[i]->map = map; 16671cd50181SJerome Brunet 16681cd50181SJerome Brunet /* Take care to skip the registered input clocks */ 166907500138SMaxime Jourdan for (i = AUD_CLKID_DDR_ARB; i < data->hw_onecell_data->num; i++) { 16701610dd79SStephen Boyd const char *name; 16711610dd79SStephen Boyd 167207500138SMaxime Jourdan hw = data->hw_onecell_data->hws[i]; 16731cd50181SJerome Brunet /* array might be sparse */ 16741cd50181SJerome Brunet if (!hw) 16751cd50181SJerome Brunet continue; 16761cd50181SJerome Brunet 16771610dd79SStephen Boyd name = hw->init->name; 16781610dd79SStephen Boyd 16791cd50181SJerome Brunet ret = devm_clk_hw_register(dev, hw); 16801cd50181SJerome Brunet if (ret) { 16811610dd79SStephen Boyd dev_err(dev, "failed to register clock %s\n", name); 16821cd50181SJerome Brunet return ret; 16831cd50181SJerome Brunet } 16841cd50181SJerome Brunet } 16851cd50181SJerome Brunet 16867cfefab6SJerome Brunet ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, 168707500138SMaxime Jourdan data->hw_onecell_data); 16887cfefab6SJerome Brunet if (ret) 16897cfefab6SJerome Brunet return ret; 16907cfefab6SJerome Brunet 16917cfefab6SJerome Brunet /* Stop here if there is no reset */ 16927cfefab6SJerome Brunet if (!data->reset_num) 16937cfefab6SJerome Brunet return 0; 16947cfefab6SJerome Brunet 16957cfefab6SJerome Brunet rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL); 16967cfefab6SJerome Brunet if (!rst) 16977cfefab6SJerome Brunet return -ENOMEM; 16987cfefab6SJerome Brunet 16997cfefab6SJerome Brunet rst->map = map; 17007cfefab6SJerome Brunet rst->offset = data->reset_offset; 17017cfefab6SJerome Brunet rst->rstc.nr_resets = data->reset_num; 17027cfefab6SJerome Brunet rst->rstc.ops = &axg_audio_rstc_ops; 17037cfefab6SJerome Brunet rst->rstc.of_node = dev->of_node; 17047cfefab6SJerome Brunet rst->rstc.owner = THIS_MODULE; 17057cfefab6SJerome Brunet 17067cfefab6SJerome Brunet return devm_reset_controller_register(dev, &rst->rstc); 17071cd50181SJerome Brunet } 17081cd50181SJerome Brunet 170907500138SMaxime Jourdan static const struct audioclk_data axg_audioclk_data = { 1710be4fe445SJerome Brunet .regmap_clks = axg_clk_regmaps, 1711be4fe445SJerome Brunet .regmap_clk_num = ARRAY_SIZE(axg_clk_regmaps), 171207500138SMaxime Jourdan .hw_onecell_data = &axg_audio_hw_onecell_data, 171307500138SMaxime Jourdan }; 171407500138SMaxime Jourdan 171507500138SMaxime Jourdan static const struct audioclk_data g12a_audioclk_data = { 1716be4fe445SJerome Brunet .regmap_clks = axg_clk_regmaps, 1717be4fe445SJerome Brunet .regmap_clk_num = ARRAY_SIZE(axg_clk_regmaps), 171807500138SMaxime Jourdan .hw_onecell_data = &g12a_audio_hw_onecell_data, 17197cfefab6SJerome Brunet .reset_offset = AUDIO_SW_RESET, 17207cfefab6SJerome Brunet .reset_num = 26, 172107500138SMaxime Jourdan }; 172207500138SMaxime Jourdan 1723be4fe445SJerome Brunet static const struct audioclk_data sm1_audioclk_data = { 1724be4fe445SJerome Brunet .regmap_clks = sm1_clk_regmaps, 1725be4fe445SJerome Brunet .regmap_clk_num = ARRAY_SIZE(sm1_clk_regmaps), 1726be4fe445SJerome Brunet .hw_onecell_data = &sm1_audio_hw_onecell_data, 1727be4fe445SJerome Brunet .reset_offset = AUDIO_SM1_SW_RESET0, 1728be4fe445SJerome Brunet .reset_num = 39, 1729be4fe445SJerome Brunet }; 1730be4fe445SJerome Brunet 17311cd50181SJerome Brunet static const struct of_device_id clkc_match_table[] = { 173207500138SMaxime Jourdan { 173307500138SMaxime Jourdan .compatible = "amlogic,axg-audio-clkc", 173407500138SMaxime Jourdan .data = &axg_audioclk_data 173507500138SMaxime Jourdan }, { 173607500138SMaxime Jourdan .compatible = "amlogic,g12a-audio-clkc", 173707500138SMaxime Jourdan .data = &g12a_audioclk_data 1738be4fe445SJerome Brunet }, { 1739be4fe445SJerome Brunet .compatible = "amlogic,sm1-audio-clkc", 1740be4fe445SJerome Brunet .data = &sm1_audioclk_data 174107500138SMaxime Jourdan }, {} 17421cd50181SJerome Brunet }; 17431cd50181SJerome Brunet MODULE_DEVICE_TABLE(of, clkc_match_table); 17441cd50181SJerome Brunet 17451cd50181SJerome Brunet static struct platform_driver axg_audio_driver = { 17461cd50181SJerome Brunet .probe = axg_audio_clkc_probe, 17471cd50181SJerome Brunet .driver = { 17481cd50181SJerome Brunet .name = "axg-audio-clkc", 17491cd50181SJerome Brunet .of_match_table = clkc_match_table, 17501cd50181SJerome Brunet }, 17511cd50181SJerome Brunet }; 17521cd50181SJerome Brunet module_platform_driver(axg_audio_driver); 17531cd50181SJerome Brunet 1754be4fe445SJerome Brunet MODULE_DESCRIPTION("Amlogic AXG/G12A/SM1 Audio Clock driver"); 17551cd50181SJerome Brunet MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>"); 17561cd50181SJerome Brunet MODULE_LICENSE("GPL v2"); 1757