18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: (GPL-2.0 OR MIT) 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (c) 2018 BayLibre, SAS. 48c2ecf20Sopenharmony_ci * Author: Jerome Brunet <jbrunet@baylibre.com> 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <linux/clk.h> 88c2ecf20Sopenharmony_ci#include <linux/clk-provider.h> 98c2ecf20Sopenharmony_ci#include <linux/init.h> 108c2ecf20Sopenharmony_ci#include <linux/of_device.h> 118c2ecf20Sopenharmony_ci#include <linux/module.h> 128c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 138c2ecf20Sopenharmony_ci#include <linux/regmap.h> 148c2ecf20Sopenharmony_ci#include <linux/reset.h> 158c2ecf20Sopenharmony_ci#include <linux/reset-controller.h> 168c2ecf20Sopenharmony_ci#include <linux/slab.h> 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#include "axg-audio.h" 198c2ecf20Sopenharmony_ci#include "clk-regmap.h" 208c2ecf20Sopenharmony_ci#include "clk-phase.h" 218c2ecf20Sopenharmony_ci#include "sclk-div.h" 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#define AUD_GATE(_name, _reg, _bit, _pname, _iflags) { \ 248c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data){ \ 258c2ecf20Sopenharmony_ci .offset = (_reg), \ 268c2ecf20Sopenharmony_ci .bit_idx = (_bit), \ 278c2ecf20Sopenharmony_ci }, \ 288c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { \ 298c2ecf20Sopenharmony_ci .name = "aud_"#_name, \ 308c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, \ 318c2ecf20Sopenharmony_ci .parent_names = (const char *[]){ #_pname }, \ 328c2ecf20Sopenharmony_ci .num_parents = 1, \ 338c2ecf20Sopenharmony_ci .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \ 348c2ecf20Sopenharmony_ci }, \ 358c2ecf20Sopenharmony_ci} 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci#define AUD_MUX(_name, _reg, _mask, _shift, _dflags, _pdata, _iflags) { \ 388c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_mux_data){ \ 398c2ecf20Sopenharmony_ci .offset = (_reg), \ 408c2ecf20Sopenharmony_ci .mask = (_mask), \ 418c2ecf20Sopenharmony_ci .shift = (_shift), \ 428c2ecf20Sopenharmony_ci .flags = (_dflags), \ 438c2ecf20Sopenharmony_ci }, \ 448c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ \ 458c2ecf20Sopenharmony_ci .name = "aud_"#_name, \ 468c2ecf20Sopenharmony_ci .ops = &clk_regmap_mux_ops, \ 478c2ecf20Sopenharmony_ci .parent_data = _pdata, \ 488c2ecf20Sopenharmony_ci .num_parents = ARRAY_SIZE(_pdata), \ 498c2ecf20Sopenharmony_ci .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \ 508c2ecf20Sopenharmony_ci }, \ 518c2ecf20Sopenharmony_ci} 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci#define AUD_DIV(_name, _reg, _shift, _width, _dflags, _pname, _iflags) { \ 548c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_div_data){ \ 558c2ecf20Sopenharmony_ci .offset = (_reg), \ 568c2ecf20Sopenharmony_ci .shift = (_shift), \ 578c2ecf20Sopenharmony_ci .width = (_width), \ 588c2ecf20Sopenharmony_ci .flags = (_dflags), \ 598c2ecf20Sopenharmony_ci }, \ 608c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ \ 618c2ecf20Sopenharmony_ci .name = "aud_"#_name, \ 628c2ecf20Sopenharmony_ci .ops = &clk_regmap_divider_ops, \ 638c2ecf20Sopenharmony_ci .parent_names = (const char *[]){ #_pname }, \ 648c2ecf20Sopenharmony_ci .num_parents = 1, \ 658c2ecf20Sopenharmony_ci .flags = (_iflags), \ 668c2ecf20Sopenharmony_ci }, \ 678c2ecf20Sopenharmony_ci} 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define AUD_PCLK_GATE(_name, _reg, _bit) { \ 708c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data){ \ 718c2ecf20Sopenharmony_ci .offset = (_reg), \ 728c2ecf20Sopenharmony_ci .bit_idx = (_bit), \ 738c2ecf20Sopenharmony_ci }, \ 748c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { \ 758c2ecf20Sopenharmony_ci .name = "aud_"#_name, \ 768c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, \ 778c2ecf20Sopenharmony_ci .parent_names = (const char *[]){ "aud_top" }, \ 788c2ecf20Sopenharmony_ci .num_parents = 1, \ 798c2ecf20Sopenharmony_ci }, \ 808c2ecf20Sopenharmony_ci} 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define AUD_SCLK_DIV(_name, _reg, _div_shift, _div_width, \ 838c2ecf20Sopenharmony_ci _hi_shift, _hi_width, _pname, _iflags) { \ 848c2ecf20Sopenharmony_ci .data = &(struct meson_sclk_div_data) { \ 858c2ecf20Sopenharmony_ci .div = { \ 868c2ecf20Sopenharmony_ci .reg_off = (_reg), \ 878c2ecf20Sopenharmony_ci .shift = (_div_shift), \ 888c2ecf20Sopenharmony_ci .width = (_div_width), \ 898c2ecf20Sopenharmony_ci }, \ 908c2ecf20Sopenharmony_ci .hi = { \ 918c2ecf20Sopenharmony_ci .reg_off = (_reg), \ 928c2ecf20Sopenharmony_ci .shift = (_hi_shift), \ 938c2ecf20Sopenharmony_ci .width = (_hi_width), \ 948c2ecf20Sopenharmony_ci }, \ 958c2ecf20Sopenharmony_ci }, \ 968c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { \ 978c2ecf20Sopenharmony_ci .name = "aud_"#_name, \ 988c2ecf20Sopenharmony_ci .ops = &meson_sclk_div_ops, \ 998c2ecf20Sopenharmony_ci .parent_names = (const char *[]){ #_pname }, \ 1008c2ecf20Sopenharmony_ci .num_parents = 1, \ 1018c2ecf20Sopenharmony_ci .flags = (_iflags), \ 1028c2ecf20Sopenharmony_ci }, \ 1038c2ecf20Sopenharmony_ci} 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci#define AUD_TRIPHASE(_name, _reg, _width, _shift0, _shift1, _shift2, \ 1068c2ecf20Sopenharmony_ci _pname, _iflags) { \ 1078c2ecf20Sopenharmony_ci .data = &(struct meson_clk_triphase_data) { \ 1088c2ecf20Sopenharmony_ci .ph0 = { \ 1098c2ecf20Sopenharmony_ci .reg_off = (_reg), \ 1108c2ecf20Sopenharmony_ci .shift = (_shift0), \ 1118c2ecf20Sopenharmony_ci .width = (_width), \ 1128c2ecf20Sopenharmony_ci }, \ 1138c2ecf20Sopenharmony_ci .ph1 = { \ 1148c2ecf20Sopenharmony_ci .reg_off = (_reg), \ 1158c2ecf20Sopenharmony_ci .shift = (_shift1), \ 1168c2ecf20Sopenharmony_ci .width = (_width), \ 1178c2ecf20Sopenharmony_ci }, \ 1188c2ecf20Sopenharmony_ci .ph2 = { \ 1198c2ecf20Sopenharmony_ci .reg_off = (_reg), \ 1208c2ecf20Sopenharmony_ci .shift = (_shift2), \ 1218c2ecf20Sopenharmony_ci .width = (_width), \ 1228c2ecf20Sopenharmony_ci }, \ 1238c2ecf20Sopenharmony_ci }, \ 1248c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { \ 1258c2ecf20Sopenharmony_ci .name = "aud_"#_name, \ 1268c2ecf20Sopenharmony_ci .ops = &meson_clk_triphase_ops, \ 1278c2ecf20Sopenharmony_ci .parent_names = (const char *[]){ #_pname }, \ 1288c2ecf20Sopenharmony_ci .num_parents = 1, \ 1298c2ecf20Sopenharmony_ci .flags = CLK_DUTY_CYCLE_PARENT | (_iflags), \ 1308c2ecf20Sopenharmony_ci }, \ 1318c2ecf20Sopenharmony_ci} 1328c2ecf20Sopenharmony_ci 1338c2ecf20Sopenharmony_ci#define AUD_PHASE(_name, _reg, _width, _shift, _pname, _iflags) { \ 1348c2ecf20Sopenharmony_ci .data = &(struct meson_clk_phase_data) { \ 1358c2ecf20Sopenharmony_ci .ph = { \ 1368c2ecf20Sopenharmony_ci .reg_off = (_reg), \ 1378c2ecf20Sopenharmony_ci .shift = (_shift), \ 1388c2ecf20Sopenharmony_ci .width = (_width), \ 1398c2ecf20Sopenharmony_ci }, \ 1408c2ecf20Sopenharmony_ci }, \ 1418c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { \ 1428c2ecf20Sopenharmony_ci .name = "aud_"#_name, \ 1438c2ecf20Sopenharmony_ci .ops = &meson_clk_phase_ops, \ 1448c2ecf20Sopenharmony_ci .parent_names = (const char *[]){ #_pname }, \ 1458c2ecf20Sopenharmony_ci .num_parents = 1, \ 1468c2ecf20Sopenharmony_ci .flags = (_iflags), \ 1478c2ecf20Sopenharmony_ci }, \ 1488c2ecf20Sopenharmony_ci} 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ci#define AUD_SCLK_WS(_name, _reg, _width, _shift_ph, _shift_ws, _pname, \ 1518c2ecf20Sopenharmony_ci _iflags) { \ 1528c2ecf20Sopenharmony_ci .data = &(struct meson_sclk_ws_inv_data) { \ 1538c2ecf20Sopenharmony_ci .ph = { \ 1548c2ecf20Sopenharmony_ci .reg_off = (_reg), \ 1558c2ecf20Sopenharmony_ci .shift = (_shift_ph), \ 1568c2ecf20Sopenharmony_ci .width = (_width), \ 1578c2ecf20Sopenharmony_ci }, \ 1588c2ecf20Sopenharmony_ci .ws = { \ 1598c2ecf20Sopenharmony_ci .reg_off = (_reg), \ 1608c2ecf20Sopenharmony_ci .shift = (_shift_ws), \ 1618c2ecf20Sopenharmony_ci .width = (_width), \ 1628c2ecf20Sopenharmony_ci }, \ 1638c2ecf20Sopenharmony_ci }, \ 1648c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { \ 1658c2ecf20Sopenharmony_ci .name = "aud_"#_name, \ 1668c2ecf20Sopenharmony_ci .ops = &meson_clk_phase_ops, \ 1678c2ecf20Sopenharmony_ci .parent_names = (const char *[]){ #_pname }, \ 1688c2ecf20Sopenharmony_ci .num_parents = 1, \ 1698c2ecf20Sopenharmony_ci .flags = (_iflags), \ 1708c2ecf20Sopenharmony_ci }, \ 1718c2ecf20Sopenharmony_ci} 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ci/* Audio Master Clocks */ 1748c2ecf20Sopenharmony_cistatic const struct clk_parent_data mst_mux_parent_data[] = { 1758c2ecf20Sopenharmony_ci { .fw_name = "mst_in0", }, 1768c2ecf20Sopenharmony_ci { .fw_name = "mst_in1", }, 1778c2ecf20Sopenharmony_ci { .fw_name = "mst_in2", }, 1788c2ecf20Sopenharmony_ci { .fw_name = "mst_in3", }, 1798c2ecf20Sopenharmony_ci { .fw_name = "mst_in4", }, 1808c2ecf20Sopenharmony_ci { .fw_name = "mst_in5", }, 1818c2ecf20Sopenharmony_ci { .fw_name = "mst_in6", }, 1828c2ecf20Sopenharmony_ci { .fw_name = "mst_in7", }, 1838c2ecf20Sopenharmony_ci}; 1848c2ecf20Sopenharmony_ci 1858c2ecf20Sopenharmony_ci#define AUD_MST_MUX(_name, _reg, _flag) \ 1868c2ecf20Sopenharmony_ci AUD_MUX(_name##_sel, _reg, 0x7, 24, _flag, \ 1878c2ecf20Sopenharmony_ci mst_mux_parent_data, 0) 1888c2ecf20Sopenharmony_ci#define AUD_MST_DIV(_name, _reg, _flag) \ 1898c2ecf20Sopenharmony_ci AUD_DIV(_name##_div, _reg, 0, 16, _flag, \ 1908c2ecf20Sopenharmony_ci aud_##_name##_sel, CLK_SET_RATE_PARENT) 1918c2ecf20Sopenharmony_ci#define AUD_MST_MCLK_GATE(_name, _reg) \ 1928c2ecf20Sopenharmony_ci AUD_GATE(_name, _reg, 31, aud_##_name##_div, \ 1938c2ecf20Sopenharmony_ci CLK_SET_RATE_PARENT) 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci#define AUD_MST_MCLK_MUX(_name, _reg) \ 1968c2ecf20Sopenharmony_ci AUD_MST_MUX(_name, _reg, CLK_MUX_ROUND_CLOSEST) 1978c2ecf20Sopenharmony_ci#define AUD_MST_MCLK_DIV(_name, _reg) \ 1988c2ecf20Sopenharmony_ci AUD_MST_DIV(_name, _reg, CLK_DIVIDER_ROUND_CLOSEST) 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci#define AUD_MST_SYS_MUX(_name, _reg) \ 2018c2ecf20Sopenharmony_ci AUD_MST_MUX(_name, _reg, 0) 2028c2ecf20Sopenharmony_ci#define AUD_MST_SYS_DIV(_name, _reg) \ 2038c2ecf20Sopenharmony_ci AUD_MST_DIV(_name, _reg, 0) 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci/* Sample Clocks */ 2068c2ecf20Sopenharmony_ci#define AUD_MST_SCLK_PRE_EN(_name, _reg) \ 2078c2ecf20Sopenharmony_ci AUD_GATE(mst_##_name##_sclk_pre_en, _reg, 31, \ 2088c2ecf20Sopenharmony_ci aud_mst_##_name##_mclk, 0) 2098c2ecf20Sopenharmony_ci#define AUD_MST_SCLK_DIV(_name, _reg) \ 2108c2ecf20Sopenharmony_ci AUD_SCLK_DIV(mst_##_name##_sclk_div, _reg, 20, 10, 0, 0, \ 2118c2ecf20Sopenharmony_ci aud_mst_##_name##_sclk_pre_en, \ 2128c2ecf20Sopenharmony_ci CLK_SET_RATE_PARENT) 2138c2ecf20Sopenharmony_ci#define AUD_MST_SCLK_POST_EN(_name, _reg) \ 2148c2ecf20Sopenharmony_ci AUD_GATE(mst_##_name##_sclk_post_en, _reg, 30, \ 2158c2ecf20Sopenharmony_ci aud_mst_##_name##_sclk_div, CLK_SET_RATE_PARENT) 2168c2ecf20Sopenharmony_ci#define AUD_MST_SCLK(_name, _reg) \ 2178c2ecf20Sopenharmony_ci AUD_TRIPHASE(mst_##_name##_sclk, _reg, 1, 0, 2, 4, \ 2188c2ecf20Sopenharmony_ci aud_mst_##_name##_sclk_post_en, CLK_SET_RATE_PARENT) 2198c2ecf20Sopenharmony_ci 2208c2ecf20Sopenharmony_ci#define AUD_MST_LRCLK_DIV(_name, _reg) \ 2218c2ecf20Sopenharmony_ci AUD_SCLK_DIV(mst_##_name##_lrclk_div, _reg, 0, 10, 10, 10, \ 2228c2ecf20Sopenharmony_ci aud_mst_##_name##_sclk_post_en, 0) 2238c2ecf20Sopenharmony_ci#define AUD_MST_LRCLK(_name, _reg) \ 2248c2ecf20Sopenharmony_ci AUD_TRIPHASE(mst_##_name##_lrclk, _reg, 1, 1, 3, 5, \ 2258c2ecf20Sopenharmony_ci aud_mst_##_name##_lrclk_div, CLK_SET_RATE_PARENT) 2268c2ecf20Sopenharmony_ci 2278c2ecf20Sopenharmony_ci/* TDM bit clock sources */ 2288c2ecf20Sopenharmony_cistatic const struct clk_parent_data tdm_sclk_parent_data[] = { 2298c2ecf20Sopenharmony_ci { .name = "aud_mst_a_sclk", .index = -1, }, 2308c2ecf20Sopenharmony_ci { .name = "aud_mst_b_sclk", .index = -1, }, 2318c2ecf20Sopenharmony_ci { .name = "aud_mst_c_sclk", .index = -1, }, 2328c2ecf20Sopenharmony_ci { .name = "aud_mst_d_sclk", .index = -1, }, 2338c2ecf20Sopenharmony_ci { .name = "aud_mst_e_sclk", .index = -1, }, 2348c2ecf20Sopenharmony_ci { .name = "aud_mst_f_sclk", .index = -1, }, 2358c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk0", }, 2368c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk1", }, 2378c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk2", }, 2388c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk3", }, 2398c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk4", }, 2408c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk5", }, 2418c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk6", }, 2428c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk7", }, 2438c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk8", }, 2448c2ecf20Sopenharmony_ci { .fw_name = "slv_sclk9", }, 2458c2ecf20Sopenharmony_ci}; 2468c2ecf20Sopenharmony_ci 2478c2ecf20Sopenharmony_ci/* TDM sample clock sources */ 2488c2ecf20Sopenharmony_cistatic const struct clk_parent_data tdm_lrclk_parent_data[] = { 2498c2ecf20Sopenharmony_ci { .name = "aud_mst_a_lrclk", .index = -1, }, 2508c2ecf20Sopenharmony_ci { .name = "aud_mst_b_lrclk", .index = -1, }, 2518c2ecf20Sopenharmony_ci { .name = "aud_mst_c_lrclk", .index = -1, }, 2528c2ecf20Sopenharmony_ci { .name = "aud_mst_d_lrclk", .index = -1, }, 2538c2ecf20Sopenharmony_ci { .name = "aud_mst_e_lrclk", .index = -1, }, 2548c2ecf20Sopenharmony_ci { .name = "aud_mst_f_lrclk", .index = -1, }, 2558c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk0", }, 2568c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk1", }, 2578c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk2", }, 2588c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk3", }, 2598c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk4", }, 2608c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk5", }, 2618c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk6", }, 2628c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk7", }, 2638c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk8", }, 2648c2ecf20Sopenharmony_ci { .fw_name = "slv_lrclk9", }, 2658c2ecf20Sopenharmony_ci}; 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_ci#define AUD_TDM_SCLK_MUX(_name, _reg) \ 2688c2ecf20Sopenharmony_ci AUD_MUX(tdm##_name##_sclk_sel, _reg, 0xf, 24, \ 2698c2ecf20Sopenharmony_ci CLK_MUX_ROUND_CLOSEST, tdm_sclk_parent_data, 0) 2708c2ecf20Sopenharmony_ci#define AUD_TDM_SCLK_PRE_EN(_name, _reg) \ 2718c2ecf20Sopenharmony_ci AUD_GATE(tdm##_name##_sclk_pre_en, _reg, 31, \ 2728c2ecf20Sopenharmony_ci aud_tdm##_name##_sclk_sel, CLK_SET_RATE_PARENT) 2738c2ecf20Sopenharmony_ci#define AUD_TDM_SCLK_POST_EN(_name, _reg) \ 2748c2ecf20Sopenharmony_ci AUD_GATE(tdm##_name##_sclk_post_en, _reg, 30, \ 2758c2ecf20Sopenharmony_ci aud_tdm##_name##_sclk_pre_en, CLK_SET_RATE_PARENT) 2768c2ecf20Sopenharmony_ci#define AUD_TDM_SCLK(_name, _reg) \ 2778c2ecf20Sopenharmony_ci AUD_PHASE(tdm##_name##_sclk, _reg, 1, 29, \ 2788c2ecf20Sopenharmony_ci aud_tdm##_name##_sclk_post_en, \ 2798c2ecf20Sopenharmony_ci CLK_DUTY_CYCLE_PARENT | CLK_SET_RATE_PARENT) 2808c2ecf20Sopenharmony_ci#define AUD_TDM_SCLK_WS(_name, _reg) \ 2818c2ecf20Sopenharmony_ci AUD_SCLK_WS(tdm##_name##_sclk, _reg, 1, 29, 28, \ 2828c2ecf20Sopenharmony_ci aud_tdm##_name##_sclk_post_en, \ 2838c2ecf20Sopenharmony_ci CLK_DUTY_CYCLE_PARENT | CLK_SET_RATE_PARENT) 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_ci#define AUD_TDM_LRLCK(_name, _reg) \ 2868c2ecf20Sopenharmony_ci AUD_MUX(tdm##_name##_lrclk, _reg, 0xf, 20, \ 2878c2ecf20Sopenharmony_ci CLK_MUX_ROUND_CLOSEST, tdm_lrclk_parent_data, 0) 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ci/* Pad master clock sources */ 2908c2ecf20Sopenharmony_cistatic const struct clk_parent_data mclk_pad_ctrl_parent_data[] = { 2918c2ecf20Sopenharmony_ci { .name = "aud_mst_a_mclk", .index = -1, }, 2928c2ecf20Sopenharmony_ci { .name = "aud_mst_b_mclk", .index = -1, }, 2938c2ecf20Sopenharmony_ci { .name = "aud_mst_c_mclk", .index = -1, }, 2948c2ecf20Sopenharmony_ci { .name = "aud_mst_d_mclk", .index = -1, }, 2958c2ecf20Sopenharmony_ci { .name = "aud_mst_e_mclk", .index = -1, }, 2968c2ecf20Sopenharmony_ci { .name = "aud_mst_f_mclk", .index = -1, }, 2978c2ecf20Sopenharmony_ci}; 2988c2ecf20Sopenharmony_ci 2998c2ecf20Sopenharmony_ci/* Pad bit clock sources */ 3008c2ecf20Sopenharmony_cistatic const struct clk_parent_data sclk_pad_ctrl_parent_data[] = { 3018c2ecf20Sopenharmony_ci { .name = "aud_mst_a_sclk", .index = -1, }, 3028c2ecf20Sopenharmony_ci { .name = "aud_mst_b_sclk", .index = -1, }, 3038c2ecf20Sopenharmony_ci { .name = "aud_mst_c_sclk", .index = -1, }, 3048c2ecf20Sopenharmony_ci { .name = "aud_mst_d_sclk", .index = -1, }, 3058c2ecf20Sopenharmony_ci { .name = "aud_mst_e_sclk", .index = -1, }, 3068c2ecf20Sopenharmony_ci { .name = "aud_mst_f_sclk", .index = -1, }, 3078c2ecf20Sopenharmony_ci}; 3088c2ecf20Sopenharmony_ci 3098c2ecf20Sopenharmony_ci/* Pad sample clock sources */ 3108c2ecf20Sopenharmony_cistatic const struct clk_parent_data lrclk_pad_ctrl_parent_data[] = { 3118c2ecf20Sopenharmony_ci { .name = "aud_mst_a_lrclk", .index = -1, }, 3128c2ecf20Sopenharmony_ci { .name = "aud_mst_b_lrclk", .index = -1, }, 3138c2ecf20Sopenharmony_ci { .name = "aud_mst_c_lrclk", .index = -1, }, 3148c2ecf20Sopenharmony_ci { .name = "aud_mst_d_lrclk", .index = -1, }, 3158c2ecf20Sopenharmony_ci { .name = "aud_mst_e_lrclk", .index = -1, }, 3168c2ecf20Sopenharmony_ci { .name = "aud_mst_f_lrclk", .index = -1, }, 3178c2ecf20Sopenharmony_ci}; 3188c2ecf20Sopenharmony_ci 3198c2ecf20Sopenharmony_ci#define AUD_TDM_PAD_CTRL(_name, _reg, _shift, _parents) \ 3208c2ecf20Sopenharmony_ci AUD_MUX(_name, _reg, 0x7, _shift, 0, _parents, \ 3218c2ecf20Sopenharmony_ci CLK_SET_RATE_NO_REPARENT) 3228c2ecf20Sopenharmony_ci 3238c2ecf20Sopenharmony_ci/* Common Clocks */ 3248c2ecf20Sopenharmony_cistatic struct clk_regmap ddr_arb = 3258c2ecf20Sopenharmony_ci AUD_PCLK_GATE(ddr_arb, AUDIO_CLK_GATE_EN, 0); 3268c2ecf20Sopenharmony_cistatic struct clk_regmap pdm = 3278c2ecf20Sopenharmony_ci AUD_PCLK_GATE(pdm, AUDIO_CLK_GATE_EN, 1); 3288c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_a = 3298c2ecf20Sopenharmony_ci AUD_PCLK_GATE(tdmin_a, AUDIO_CLK_GATE_EN, 2); 3308c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_b = 3318c2ecf20Sopenharmony_ci AUD_PCLK_GATE(tdmin_b, AUDIO_CLK_GATE_EN, 3); 3328c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_c = 3338c2ecf20Sopenharmony_ci AUD_PCLK_GATE(tdmin_c, AUDIO_CLK_GATE_EN, 4); 3348c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_lb = 3358c2ecf20Sopenharmony_ci AUD_PCLK_GATE(tdmin_lb, AUDIO_CLK_GATE_EN, 5); 3368c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_a = 3378c2ecf20Sopenharmony_ci AUD_PCLK_GATE(tdmout_a, AUDIO_CLK_GATE_EN, 6); 3388c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_b = 3398c2ecf20Sopenharmony_ci AUD_PCLK_GATE(tdmout_b, AUDIO_CLK_GATE_EN, 7); 3408c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_c = 3418c2ecf20Sopenharmony_ci AUD_PCLK_GATE(tdmout_c, AUDIO_CLK_GATE_EN, 8); 3428c2ecf20Sopenharmony_cistatic struct clk_regmap frddr_a = 3438c2ecf20Sopenharmony_ci AUD_PCLK_GATE(frddr_a, AUDIO_CLK_GATE_EN, 9); 3448c2ecf20Sopenharmony_cistatic struct clk_regmap frddr_b = 3458c2ecf20Sopenharmony_ci AUD_PCLK_GATE(frddr_b, AUDIO_CLK_GATE_EN, 10); 3468c2ecf20Sopenharmony_cistatic struct clk_regmap frddr_c = 3478c2ecf20Sopenharmony_ci AUD_PCLK_GATE(frddr_c, AUDIO_CLK_GATE_EN, 11); 3488c2ecf20Sopenharmony_cistatic struct clk_regmap toddr_a = 3498c2ecf20Sopenharmony_ci AUD_PCLK_GATE(toddr_a, AUDIO_CLK_GATE_EN, 12); 3508c2ecf20Sopenharmony_cistatic struct clk_regmap toddr_b = 3518c2ecf20Sopenharmony_ci AUD_PCLK_GATE(toddr_b, AUDIO_CLK_GATE_EN, 13); 3528c2ecf20Sopenharmony_cistatic struct clk_regmap toddr_c = 3538c2ecf20Sopenharmony_ci AUD_PCLK_GATE(toddr_c, AUDIO_CLK_GATE_EN, 14); 3548c2ecf20Sopenharmony_cistatic struct clk_regmap loopback = 3558c2ecf20Sopenharmony_ci AUD_PCLK_GATE(loopback, AUDIO_CLK_GATE_EN, 15); 3568c2ecf20Sopenharmony_cistatic struct clk_regmap spdifin = 3578c2ecf20Sopenharmony_ci AUD_PCLK_GATE(spdifin, AUDIO_CLK_GATE_EN, 16); 3588c2ecf20Sopenharmony_cistatic struct clk_regmap spdifout = 3598c2ecf20Sopenharmony_ci AUD_PCLK_GATE(spdifout, AUDIO_CLK_GATE_EN, 17); 3608c2ecf20Sopenharmony_cistatic struct clk_regmap resample = 3618c2ecf20Sopenharmony_ci AUD_PCLK_GATE(resample, AUDIO_CLK_GATE_EN, 18); 3628c2ecf20Sopenharmony_cistatic struct clk_regmap power_detect = 3638c2ecf20Sopenharmony_ci AUD_PCLK_GATE(power_detect, AUDIO_CLK_GATE_EN, 19); 3648c2ecf20Sopenharmony_ci 3658c2ecf20Sopenharmony_cistatic struct clk_regmap spdifout_clk_sel = 3668c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL); 3678c2ecf20Sopenharmony_cistatic struct clk_regmap pdm_dclk_sel = 3688c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0); 3698c2ecf20Sopenharmony_cistatic struct clk_regmap spdifin_clk_sel = 3708c2ecf20Sopenharmony_ci AUD_MST_SYS_MUX(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL); 3718c2ecf20Sopenharmony_cistatic struct clk_regmap pdm_sysclk_sel = 3728c2ecf20Sopenharmony_ci AUD_MST_SYS_MUX(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1); 3738c2ecf20Sopenharmony_cistatic struct clk_regmap spdifout_b_clk_sel = 3748c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL); 3758c2ecf20Sopenharmony_ci 3768c2ecf20Sopenharmony_cistatic struct clk_regmap spdifout_clk_div = 3778c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL); 3788c2ecf20Sopenharmony_cistatic struct clk_regmap pdm_dclk_div = 3798c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0); 3808c2ecf20Sopenharmony_cistatic struct clk_regmap spdifin_clk_div = 3818c2ecf20Sopenharmony_ci AUD_MST_SYS_DIV(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL); 3828c2ecf20Sopenharmony_cistatic struct clk_regmap pdm_sysclk_div = 3838c2ecf20Sopenharmony_ci AUD_MST_SYS_DIV(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1); 3848c2ecf20Sopenharmony_cistatic struct clk_regmap spdifout_b_clk_div = 3858c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL); 3868c2ecf20Sopenharmony_ci 3878c2ecf20Sopenharmony_cistatic struct clk_regmap spdifout_clk = 3888c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(spdifout_clk, AUDIO_CLK_SPDIFOUT_CTRL); 3898c2ecf20Sopenharmony_cistatic struct clk_regmap spdifin_clk = 3908c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(spdifin_clk, AUDIO_CLK_SPDIFIN_CTRL); 3918c2ecf20Sopenharmony_cistatic struct clk_regmap pdm_dclk = 3928c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(pdm_dclk, AUDIO_CLK_PDMIN_CTRL0); 3938c2ecf20Sopenharmony_cistatic struct clk_regmap pdm_sysclk = 3948c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(pdm_sysclk, AUDIO_CLK_PDMIN_CTRL1); 3958c2ecf20Sopenharmony_cistatic struct clk_regmap spdifout_b_clk = 3968c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(spdifout_b_clk, AUDIO_CLK_SPDIFOUT_B_CTRL); 3978c2ecf20Sopenharmony_ci 3988c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_sclk_pre_en = 3998c2ecf20Sopenharmony_ci AUD_MST_SCLK_PRE_EN(a, AUDIO_MST_A_SCLK_CTRL0); 4008c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_sclk_pre_en = 4018c2ecf20Sopenharmony_ci AUD_MST_SCLK_PRE_EN(b, AUDIO_MST_B_SCLK_CTRL0); 4028c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_sclk_pre_en = 4038c2ecf20Sopenharmony_ci AUD_MST_SCLK_PRE_EN(c, AUDIO_MST_C_SCLK_CTRL0); 4048c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_sclk_pre_en = 4058c2ecf20Sopenharmony_ci AUD_MST_SCLK_PRE_EN(d, AUDIO_MST_D_SCLK_CTRL0); 4068c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_sclk_pre_en = 4078c2ecf20Sopenharmony_ci AUD_MST_SCLK_PRE_EN(e, AUDIO_MST_E_SCLK_CTRL0); 4088c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_sclk_pre_en = 4098c2ecf20Sopenharmony_ci AUD_MST_SCLK_PRE_EN(f, AUDIO_MST_F_SCLK_CTRL0); 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_sclk_div = 4128c2ecf20Sopenharmony_ci AUD_MST_SCLK_DIV(a, AUDIO_MST_A_SCLK_CTRL0); 4138c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_sclk_div = 4148c2ecf20Sopenharmony_ci AUD_MST_SCLK_DIV(b, AUDIO_MST_B_SCLK_CTRL0); 4158c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_sclk_div = 4168c2ecf20Sopenharmony_ci AUD_MST_SCLK_DIV(c, AUDIO_MST_C_SCLK_CTRL0); 4178c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_sclk_div = 4188c2ecf20Sopenharmony_ci AUD_MST_SCLK_DIV(d, AUDIO_MST_D_SCLK_CTRL0); 4198c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_sclk_div = 4208c2ecf20Sopenharmony_ci AUD_MST_SCLK_DIV(e, AUDIO_MST_E_SCLK_CTRL0); 4218c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_sclk_div = 4228c2ecf20Sopenharmony_ci AUD_MST_SCLK_DIV(f, AUDIO_MST_F_SCLK_CTRL0); 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_sclk_post_en = 4258c2ecf20Sopenharmony_ci AUD_MST_SCLK_POST_EN(a, AUDIO_MST_A_SCLK_CTRL0); 4268c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_sclk_post_en = 4278c2ecf20Sopenharmony_ci AUD_MST_SCLK_POST_EN(b, AUDIO_MST_B_SCLK_CTRL0); 4288c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_sclk_post_en = 4298c2ecf20Sopenharmony_ci AUD_MST_SCLK_POST_EN(c, AUDIO_MST_C_SCLK_CTRL0); 4308c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_sclk_post_en = 4318c2ecf20Sopenharmony_ci AUD_MST_SCLK_POST_EN(d, AUDIO_MST_D_SCLK_CTRL0); 4328c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_sclk_post_en = 4338c2ecf20Sopenharmony_ci AUD_MST_SCLK_POST_EN(e, AUDIO_MST_E_SCLK_CTRL0); 4348c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_sclk_post_en = 4358c2ecf20Sopenharmony_ci AUD_MST_SCLK_POST_EN(f, AUDIO_MST_F_SCLK_CTRL0); 4368c2ecf20Sopenharmony_ci 4378c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_sclk = 4388c2ecf20Sopenharmony_ci AUD_MST_SCLK(a, AUDIO_MST_A_SCLK_CTRL1); 4398c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_sclk = 4408c2ecf20Sopenharmony_ci AUD_MST_SCLK(b, AUDIO_MST_B_SCLK_CTRL1); 4418c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_sclk = 4428c2ecf20Sopenharmony_ci AUD_MST_SCLK(c, AUDIO_MST_C_SCLK_CTRL1); 4438c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_sclk = 4448c2ecf20Sopenharmony_ci AUD_MST_SCLK(d, AUDIO_MST_D_SCLK_CTRL1); 4458c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_sclk = 4468c2ecf20Sopenharmony_ci AUD_MST_SCLK(e, AUDIO_MST_E_SCLK_CTRL1); 4478c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_sclk = 4488c2ecf20Sopenharmony_ci AUD_MST_SCLK(f, AUDIO_MST_F_SCLK_CTRL1); 4498c2ecf20Sopenharmony_ci 4508c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_lrclk_div = 4518c2ecf20Sopenharmony_ci AUD_MST_LRCLK_DIV(a, AUDIO_MST_A_SCLK_CTRL0); 4528c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_lrclk_div = 4538c2ecf20Sopenharmony_ci AUD_MST_LRCLK_DIV(b, AUDIO_MST_B_SCLK_CTRL0); 4548c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_lrclk_div = 4558c2ecf20Sopenharmony_ci AUD_MST_LRCLK_DIV(c, AUDIO_MST_C_SCLK_CTRL0); 4568c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_lrclk_div = 4578c2ecf20Sopenharmony_ci AUD_MST_LRCLK_DIV(d, AUDIO_MST_D_SCLK_CTRL0); 4588c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_lrclk_div = 4598c2ecf20Sopenharmony_ci AUD_MST_LRCLK_DIV(e, AUDIO_MST_E_SCLK_CTRL0); 4608c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_lrclk_div = 4618c2ecf20Sopenharmony_ci AUD_MST_LRCLK_DIV(f, AUDIO_MST_F_SCLK_CTRL0); 4628c2ecf20Sopenharmony_ci 4638c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_lrclk = 4648c2ecf20Sopenharmony_ci AUD_MST_LRCLK(a, AUDIO_MST_A_SCLK_CTRL1); 4658c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_lrclk = 4668c2ecf20Sopenharmony_ci AUD_MST_LRCLK(b, AUDIO_MST_B_SCLK_CTRL1); 4678c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_lrclk = 4688c2ecf20Sopenharmony_ci AUD_MST_LRCLK(c, AUDIO_MST_C_SCLK_CTRL1); 4698c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_lrclk = 4708c2ecf20Sopenharmony_ci AUD_MST_LRCLK(d, AUDIO_MST_D_SCLK_CTRL1); 4718c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_lrclk = 4728c2ecf20Sopenharmony_ci AUD_MST_LRCLK(e, AUDIO_MST_E_SCLK_CTRL1); 4738c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_lrclk = 4748c2ecf20Sopenharmony_ci AUD_MST_LRCLK(f, AUDIO_MST_F_SCLK_CTRL1); 4758c2ecf20Sopenharmony_ci 4768c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_a_sclk_sel = 4778c2ecf20Sopenharmony_ci AUD_TDM_SCLK_MUX(in_a, AUDIO_CLK_TDMIN_A_CTRL); 4788c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_b_sclk_sel = 4798c2ecf20Sopenharmony_ci AUD_TDM_SCLK_MUX(in_b, AUDIO_CLK_TDMIN_B_CTRL); 4808c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_c_sclk_sel = 4818c2ecf20Sopenharmony_ci AUD_TDM_SCLK_MUX(in_c, AUDIO_CLK_TDMIN_C_CTRL); 4828c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_lb_sclk_sel = 4838c2ecf20Sopenharmony_ci AUD_TDM_SCLK_MUX(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 4848c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_a_sclk_sel = 4858c2ecf20Sopenharmony_ci AUD_TDM_SCLK_MUX(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 4868c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_b_sclk_sel = 4878c2ecf20Sopenharmony_ci AUD_TDM_SCLK_MUX(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 4888c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_c_sclk_sel = 4898c2ecf20Sopenharmony_ci AUD_TDM_SCLK_MUX(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 4908c2ecf20Sopenharmony_ci 4918c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_a_sclk_pre_en = 4928c2ecf20Sopenharmony_ci AUD_TDM_SCLK_PRE_EN(in_a, AUDIO_CLK_TDMIN_A_CTRL); 4938c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_b_sclk_pre_en = 4948c2ecf20Sopenharmony_ci AUD_TDM_SCLK_PRE_EN(in_b, AUDIO_CLK_TDMIN_B_CTRL); 4958c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_c_sclk_pre_en = 4968c2ecf20Sopenharmony_ci AUD_TDM_SCLK_PRE_EN(in_c, AUDIO_CLK_TDMIN_C_CTRL); 4978c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_lb_sclk_pre_en = 4988c2ecf20Sopenharmony_ci AUD_TDM_SCLK_PRE_EN(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 4998c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_a_sclk_pre_en = 5008c2ecf20Sopenharmony_ci AUD_TDM_SCLK_PRE_EN(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 5018c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_b_sclk_pre_en = 5028c2ecf20Sopenharmony_ci AUD_TDM_SCLK_PRE_EN(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 5038c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_c_sclk_pre_en = 5048c2ecf20Sopenharmony_ci AUD_TDM_SCLK_PRE_EN(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 5058c2ecf20Sopenharmony_ci 5068c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_a_sclk_post_en = 5078c2ecf20Sopenharmony_ci AUD_TDM_SCLK_POST_EN(in_a, AUDIO_CLK_TDMIN_A_CTRL); 5088c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_b_sclk_post_en = 5098c2ecf20Sopenharmony_ci AUD_TDM_SCLK_POST_EN(in_b, AUDIO_CLK_TDMIN_B_CTRL); 5108c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_c_sclk_post_en = 5118c2ecf20Sopenharmony_ci AUD_TDM_SCLK_POST_EN(in_c, AUDIO_CLK_TDMIN_C_CTRL); 5128c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_lb_sclk_post_en = 5138c2ecf20Sopenharmony_ci AUD_TDM_SCLK_POST_EN(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 5148c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_a_sclk_post_en = 5158c2ecf20Sopenharmony_ci AUD_TDM_SCLK_POST_EN(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 5168c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_b_sclk_post_en = 5178c2ecf20Sopenharmony_ci AUD_TDM_SCLK_POST_EN(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 5188c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_c_sclk_post_en = 5198c2ecf20Sopenharmony_ci AUD_TDM_SCLK_POST_EN(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 5208c2ecf20Sopenharmony_ci 5218c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_a_sclk = 5228c2ecf20Sopenharmony_ci AUD_TDM_SCLK(in_a, AUDIO_CLK_TDMIN_A_CTRL); 5238c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_b_sclk = 5248c2ecf20Sopenharmony_ci AUD_TDM_SCLK(in_b, AUDIO_CLK_TDMIN_B_CTRL); 5258c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_c_sclk = 5268c2ecf20Sopenharmony_ci AUD_TDM_SCLK(in_c, AUDIO_CLK_TDMIN_C_CTRL); 5278c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_lb_sclk = 5288c2ecf20Sopenharmony_ci AUD_TDM_SCLK(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 5298c2ecf20Sopenharmony_ci 5308c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_a_lrclk = 5318c2ecf20Sopenharmony_ci AUD_TDM_LRLCK(in_a, AUDIO_CLK_TDMIN_A_CTRL); 5328c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_b_lrclk = 5338c2ecf20Sopenharmony_ci AUD_TDM_LRLCK(in_b, AUDIO_CLK_TDMIN_B_CTRL); 5348c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_c_lrclk = 5358c2ecf20Sopenharmony_ci AUD_TDM_LRLCK(in_c, AUDIO_CLK_TDMIN_C_CTRL); 5368c2ecf20Sopenharmony_cistatic struct clk_regmap tdmin_lb_lrclk = 5378c2ecf20Sopenharmony_ci AUD_TDM_LRLCK(in_lb, AUDIO_CLK_TDMIN_LB_CTRL); 5388c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_a_lrclk = 5398c2ecf20Sopenharmony_ci AUD_TDM_LRLCK(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 5408c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_b_lrclk = 5418c2ecf20Sopenharmony_ci AUD_TDM_LRLCK(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 5428c2ecf20Sopenharmony_cistatic struct clk_regmap tdmout_c_lrclk = 5438c2ecf20Sopenharmony_ci AUD_TDM_LRLCK(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 5448c2ecf20Sopenharmony_ci 5458c2ecf20Sopenharmony_ci/* AXG Clocks */ 5468c2ecf20Sopenharmony_cistatic struct clk_regmap axg_tdmout_a_sclk = 5478c2ecf20Sopenharmony_ci AUD_TDM_SCLK(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 5488c2ecf20Sopenharmony_cistatic struct clk_regmap axg_tdmout_b_sclk = 5498c2ecf20Sopenharmony_ci AUD_TDM_SCLK(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 5508c2ecf20Sopenharmony_cistatic struct clk_regmap axg_tdmout_c_sclk = 5518c2ecf20Sopenharmony_ci AUD_TDM_SCLK(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 5528c2ecf20Sopenharmony_ci 5538c2ecf20Sopenharmony_ci/* AXG/G12A Clocks */ 5548c2ecf20Sopenharmony_cistatic struct clk_hw axg_aud_top = { 5558c2ecf20Sopenharmony_ci .init = &(struct clk_init_data) { 5568c2ecf20Sopenharmony_ci /* Provide aud_top signal name on axg and g12a */ 5578c2ecf20Sopenharmony_ci .name = "aud_top", 5588c2ecf20Sopenharmony_ci .ops = &(const struct clk_ops) {}, 5598c2ecf20Sopenharmony_ci .parent_data = &(const struct clk_parent_data) { 5608c2ecf20Sopenharmony_ci .fw_name = "pclk", 5618c2ecf20Sopenharmony_ci }, 5628c2ecf20Sopenharmony_ci .num_parents = 1, 5638c2ecf20Sopenharmony_ci }, 5648c2ecf20Sopenharmony_ci}; 5658c2ecf20Sopenharmony_ci 5668c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_mclk_sel = 5678c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_a_mclk, AUDIO_MCLK_A_CTRL); 5688c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_mclk_sel = 5698c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_b_mclk, AUDIO_MCLK_B_CTRL); 5708c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_mclk_sel = 5718c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_c_mclk, AUDIO_MCLK_C_CTRL); 5728c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_mclk_sel = 5738c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_d_mclk, AUDIO_MCLK_D_CTRL); 5748c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_mclk_sel = 5758c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_e_mclk, AUDIO_MCLK_E_CTRL); 5768c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_mclk_sel = 5778c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_f_mclk, AUDIO_MCLK_F_CTRL); 5788c2ecf20Sopenharmony_ci 5798c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_mclk_div = 5808c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_a_mclk, AUDIO_MCLK_A_CTRL); 5818c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_mclk_div = 5828c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_b_mclk, AUDIO_MCLK_B_CTRL); 5838c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_mclk_div = 5848c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_c_mclk, AUDIO_MCLK_C_CTRL); 5858c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_mclk_div = 5868c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_d_mclk, AUDIO_MCLK_D_CTRL); 5878c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_mclk_div = 5888c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_e_mclk, AUDIO_MCLK_E_CTRL); 5898c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_mclk_div = 5908c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_f_mclk, AUDIO_MCLK_F_CTRL); 5918c2ecf20Sopenharmony_ci 5928c2ecf20Sopenharmony_cistatic struct clk_regmap mst_a_mclk = 5938c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_a_mclk, AUDIO_MCLK_A_CTRL); 5948c2ecf20Sopenharmony_cistatic struct clk_regmap mst_b_mclk = 5958c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_b_mclk, AUDIO_MCLK_B_CTRL); 5968c2ecf20Sopenharmony_cistatic struct clk_regmap mst_c_mclk = 5978c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_c_mclk, AUDIO_MCLK_C_CTRL); 5988c2ecf20Sopenharmony_cistatic struct clk_regmap mst_d_mclk = 5998c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_d_mclk, AUDIO_MCLK_D_CTRL); 6008c2ecf20Sopenharmony_cistatic struct clk_regmap mst_e_mclk = 6018c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_e_mclk, AUDIO_MCLK_E_CTRL); 6028c2ecf20Sopenharmony_cistatic struct clk_regmap mst_f_mclk = 6038c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_f_mclk, AUDIO_MCLK_F_CTRL); 6048c2ecf20Sopenharmony_ci 6058c2ecf20Sopenharmony_ci/* G12a clocks */ 6068c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdm_mclk_pad_0 = AUD_TDM_PAD_CTRL( 6078c2ecf20Sopenharmony_ci mclk_pad_0, AUDIO_MST_PAD_CTRL0, 0, mclk_pad_ctrl_parent_data); 6088c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdm_mclk_pad_1 = AUD_TDM_PAD_CTRL( 6098c2ecf20Sopenharmony_ci mclk_pad_1, AUDIO_MST_PAD_CTRL0, 4, mclk_pad_ctrl_parent_data); 6108c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdm_lrclk_pad_0 = AUD_TDM_PAD_CTRL( 6118c2ecf20Sopenharmony_ci lrclk_pad_0, AUDIO_MST_PAD_CTRL1, 16, lrclk_pad_ctrl_parent_data); 6128c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdm_lrclk_pad_1 = AUD_TDM_PAD_CTRL( 6138c2ecf20Sopenharmony_ci lrclk_pad_1, AUDIO_MST_PAD_CTRL1, 20, lrclk_pad_ctrl_parent_data); 6148c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdm_lrclk_pad_2 = AUD_TDM_PAD_CTRL( 6158c2ecf20Sopenharmony_ci lrclk_pad_2, AUDIO_MST_PAD_CTRL1, 24, lrclk_pad_ctrl_parent_data); 6168c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdm_sclk_pad_0 = AUD_TDM_PAD_CTRL( 6178c2ecf20Sopenharmony_ci sclk_pad_0, AUDIO_MST_PAD_CTRL1, 0, sclk_pad_ctrl_parent_data); 6188c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdm_sclk_pad_1 = AUD_TDM_PAD_CTRL( 6198c2ecf20Sopenharmony_ci sclk_pad_1, AUDIO_MST_PAD_CTRL1, 4, sclk_pad_ctrl_parent_data); 6208c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdm_sclk_pad_2 = AUD_TDM_PAD_CTRL( 6218c2ecf20Sopenharmony_ci sclk_pad_2, AUDIO_MST_PAD_CTRL1, 8, sclk_pad_ctrl_parent_data); 6228c2ecf20Sopenharmony_ci 6238c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdmout_a_sclk = 6248c2ecf20Sopenharmony_ci AUD_TDM_SCLK_WS(out_a, AUDIO_CLK_TDMOUT_A_CTRL); 6258c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdmout_b_sclk = 6268c2ecf20Sopenharmony_ci AUD_TDM_SCLK_WS(out_b, AUDIO_CLK_TDMOUT_B_CTRL); 6278c2ecf20Sopenharmony_cistatic struct clk_regmap g12a_tdmout_c_sclk = 6288c2ecf20Sopenharmony_ci AUD_TDM_SCLK_WS(out_c, AUDIO_CLK_TDMOUT_C_CTRL); 6298c2ecf20Sopenharmony_ci 6308c2ecf20Sopenharmony_cistatic struct clk_regmap toram = 6318c2ecf20Sopenharmony_ci AUD_PCLK_GATE(toram, AUDIO_CLK_GATE_EN, 20); 6328c2ecf20Sopenharmony_cistatic struct clk_regmap spdifout_b = 6338c2ecf20Sopenharmony_ci AUD_PCLK_GATE(spdifout_b, AUDIO_CLK_GATE_EN, 21); 6348c2ecf20Sopenharmony_cistatic struct clk_regmap eqdrc = 6358c2ecf20Sopenharmony_ci AUD_PCLK_GATE(eqdrc, AUDIO_CLK_GATE_EN, 22); 6368c2ecf20Sopenharmony_ci 6378c2ecf20Sopenharmony_ci/* SM1 Clocks */ 6388c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_clk81_en = { 6398c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data){ 6408c2ecf20Sopenharmony_ci .offset = AUDIO_CLK81_EN, 6418c2ecf20Sopenharmony_ci .bit_idx = 31, 6428c2ecf20Sopenharmony_ci }, 6438c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { 6448c2ecf20Sopenharmony_ci .name = "aud_clk81_en", 6458c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, 6468c2ecf20Sopenharmony_ci .parent_data = &(const struct clk_parent_data) { 6478c2ecf20Sopenharmony_ci .fw_name = "pclk", 6488c2ecf20Sopenharmony_ci }, 6498c2ecf20Sopenharmony_ci .num_parents = 1, 6508c2ecf20Sopenharmony_ci }, 6518c2ecf20Sopenharmony_ci}; 6528c2ecf20Sopenharmony_ci 6538c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_sysclk_a_div = { 6548c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_div_data){ 6558c2ecf20Sopenharmony_ci .offset = AUDIO_CLK81_CTRL, 6568c2ecf20Sopenharmony_ci .shift = 0, 6578c2ecf20Sopenharmony_ci .width = 8, 6588c2ecf20Sopenharmony_ci }, 6598c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { 6608c2ecf20Sopenharmony_ci .name = "aud_sysclk_a_div", 6618c2ecf20Sopenharmony_ci .ops = &clk_regmap_divider_ops, 6628c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 6638c2ecf20Sopenharmony_ci &sm1_clk81_en.hw, 6648c2ecf20Sopenharmony_ci }, 6658c2ecf20Sopenharmony_ci .num_parents = 1, 6668c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 6678c2ecf20Sopenharmony_ci }, 6688c2ecf20Sopenharmony_ci}; 6698c2ecf20Sopenharmony_ci 6708c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_sysclk_a_en = { 6718c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data){ 6728c2ecf20Sopenharmony_ci .offset = AUDIO_CLK81_CTRL, 6738c2ecf20Sopenharmony_ci .bit_idx = 8, 6748c2ecf20Sopenharmony_ci }, 6758c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { 6768c2ecf20Sopenharmony_ci .name = "aud_sysclk_a_en", 6778c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, 6788c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 6798c2ecf20Sopenharmony_ci &sm1_sysclk_a_div.hw, 6808c2ecf20Sopenharmony_ci }, 6818c2ecf20Sopenharmony_ci .num_parents = 1, 6828c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 6838c2ecf20Sopenharmony_ci }, 6848c2ecf20Sopenharmony_ci}; 6858c2ecf20Sopenharmony_ci 6868c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_sysclk_b_div = { 6878c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_div_data){ 6888c2ecf20Sopenharmony_ci .offset = AUDIO_CLK81_CTRL, 6898c2ecf20Sopenharmony_ci .shift = 16, 6908c2ecf20Sopenharmony_ci .width = 8, 6918c2ecf20Sopenharmony_ci }, 6928c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { 6938c2ecf20Sopenharmony_ci .name = "aud_sysclk_b_div", 6948c2ecf20Sopenharmony_ci .ops = &clk_regmap_divider_ops, 6958c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 6968c2ecf20Sopenharmony_ci &sm1_clk81_en.hw, 6978c2ecf20Sopenharmony_ci }, 6988c2ecf20Sopenharmony_ci .num_parents = 1, 6998c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 7008c2ecf20Sopenharmony_ci }, 7018c2ecf20Sopenharmony_ci}; 7028c2ecf20Sopenharmony_ci 7038c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_sysclk_b_en = { 7048c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data){ 7058c2ecf20Sopenharmony_ci .offset = AUDIO_CLK81_CTRL, 7068c2ecf20Sopenharmony_ci .bit_idx = 24, 7078c2ecf20Sopenharmony_ci }, 7088c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { 7098c2ecf20Sopenharmony_ci .name = "aud_sysclk_b_en", 7108c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, 7118c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 7128c2ecf20Sopenharmony_ci &sm1_sysclk_b_div.hw, 7138c2ecf20Sopenharmony_ci }, 7148c2ecf20Sopenharmony_ci .num_parents = 1, 7158c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 7168c2ecf20Sopenharmony_ci }, 7178c2ecf20Sopenharmony_ci}; 7188c2ecf20Sopenharmony_ci 7198c2ecf20Sopenharmony_cistatic const struct clk_hw *sm1_aud_top_parents[] = { 7208c2ecf20Sopenharmony_ci &sm1_sysclk_a_en.hw, 7218c2ecf20Sopenharmony_ci &sm1_sysclk_b_en.hw, 7228c2ecf20Sopenharmony_ci}; 7238c2ecf20Sopenharmony_ci 7248c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_aud_top = { 7258c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_mux_data){ 7268c2ecf20Sopenharmony_ci .offset = AUDIO_CLK81_CTRL, 7278c2ecf20Sopenharmony_ci .mask = 0x1, 7288c2ecf20Sopenharmony_ci .shift = 31, 7298c2ecf20Sopenharmony_ci }, 7308c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 7318c2ecf20Sopenharmony_ci .name = "aud_top", 7328c2ecf20Sopenharmony_ci .ops = &clk_regmap_mux_ops, 7338c2ecf20Sopenharmony_ci .parent_hws = sm1_aud_top_parents, 7348c2ecf20Sopenharmony_ci .num_parents = ARRAY_SIZE(sm1_aud_top_parents), 7358c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_NO_REPARENT, 7368c2ecf20Sopenharmony_ci }, 7378c2ecf20Sopenharmony_ci}; 7388c2ecf20Sopenharmony_ci 7398c2ecf20Sopenharmony_cistatic struct clk_regmap resample_b = 7408c2ecf20Sopenharmony_ci AUD_PCLK_GATE(resample_b, AUDIO_CLK_GATE_EN, 26); 7418c2ecf20Sopenharmony_cistatic struct clk_regmap tovad = 7428c2ecf20Sopenharmony_ci AUD_PCLK_GATE(tovad, AUDIO_CLK_GATE_EN, 27); 7438c2ecf20Sopenharmony_cistatic struct clk_regmap locker = 7448c2ecf20Sopenharmony_ci AUD_PCLK_GATE(locker, AUDIO_CLK_GATE_EN, 28); 7458c2ecf20Sopenharmony_cistatic struct clk_regmap spdifin_lb = 7468c2ecf20Sopenharmony_ci AUD_PCLK_GATE(spdifin_lb, AUDIO_CLK_GATE_EN, 29); 7478c2ecf20Sopenharmony_cistatic struct clk_regmap frddr_d = 7488c2ecf20Sopenharmony_ci AUD_PCLK_GATE(frddr_d, AUDIO_CLK_GATE_EN1, 0); 7498c2ecf20Sopenharmony_cistatic struct clk_regmap toddr_d = 7508c2ecf20Sopenharmony_ci AUD_PCLK_GATE(toddr_d, AUDIO_CLK_GATE_EN1, 1); 7518c2ecf20Sopenharmony_cistatic struct clk_regmap loopback_b = 7528c2ecf20Sopenharmony_ci AUD_PCLK_GATE(loopback_b, AUDIO_CLK_GATE_EN1, 2); 7538c2ecf20Sopenharmony_ci 7548c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_a_mclk_sel = 7558c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); 7568c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_b_mclk_sel = 7578c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL); 7588c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_c_mclk_sel = 7598c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL); 7608c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_d_mclk_sel = 7618c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL); 7628c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_e_mclk_sel = 7638c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); 7648c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_f_mclk_sel = 7658c2ecf20Sopenharmony_ci AUD_MST_MCLK_MUX(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); 7668c2ecf20Sopenharmony_ci 7678c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_a_mclk_div = 7688c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); 7698c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_b_mclk_div = 7708c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL); 7718c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_c_mclk_div = 7728c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL); 7738c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_d_mclk_div = 7748c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL); 7758c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_e_mclk_div = 7768c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); 7778c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_f_mclk_div = 7788c2ecf20Sopenharmony_ci AUD_MST_MCLK_DIV(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); 7798c2ecf20Sopenharmony_ci 7808c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_a_mclk = 7818c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); 7828c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_b_mclk = 7838c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_b_mclk, AUDIO_SM1_MCLK_B_CTRL); 7848c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_c_mclk = 7858c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_c_mclk, AUDIO_SM1_MCLK_C_CTRL); 7868c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_d_mclk = 7878c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_d_mclk, AUDIO_SM1_MCLK_D_CTRL); 7888c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_e_mclk = 7898c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); 7908c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_mst_f_mclk = 7918c2ecf20Sopenharmony_ci AUD_MST_MCLK_GATE(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); 7928c2ecf20Sopenharmony_ci 7938c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_tdm_mclk_pad_0 = AUD_TDM_PAD_CTRL( 7948c2ecf20Sopenharmony_ci tdm_mclk_pad_0, AUDIO_SM1_MST_PAD_CTRL0, 0, mclk_pad_ctrl_parent_data); 7958c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_tdm_mclk_pad_1 = AUD_TDM_PAD_CTRL( 7968c2ecf20Sopenharmony_ci tdm_mclk_pad_1, AUDIO_SM1_MST_PAD_CTRL0, 4, mclk_pad_ctrl_parent_data); 7978c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_tdm_lrclk_pad_0 = AUD_TDM_PAD_CTRL( 7988c2ecf20Sopenharmony_ci tdm_lrclk_pad_0, AUDIO_SM1_MST_PAD_CTRL1, 16, lrclk_pad_ctrl_parent_data); 7998c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_tdm_lrclk_pad_1 = AUD_TDM_PAD_CTRL( 8008c2ecf20Sopenharmony_ci tdm_lrclk_pad_1, AUDIO_SM1_MST_PAD_CTRL1, 20, lrclk_pad_ctrl_parent_data); 8018c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_tdm_lrclk_pad_2 = AUD_TDM_PAD_CTRL( 8028c2ecf20Sopenharmony_ci tdm_lrclk_pad_2, AUDIO_SM1_MST_PAD_CTRL1, 24, lrclk_pad_ctrl_parent_data); 8038c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_tdm_sclk_pad_0 = AUD_TDM_PAD_CTRL( 8048c2ecf20Sopenharmony_ci tdm_sclk_pad_0, AUDIO_SM1_MST_PAD_CTRL1, 0, sclk_pad_ctrl_parent_data); 8058c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_tdm_sclk_pad_1 = AUD_TDM_PAD_CTRL( 8068c2ecf20Sopenharmony_ci tdm_sclk_pad_1, AUDIO_SM1_MST_PAD_CTRL1, 4, sclk_pad_ctrl_parent_data); 8078c2ecf20Sopenharmony_cistatic struct clk_regmap sm1_tdm_sclk_pad_2 = AUD_TDM_PAD_CTRL( 8088c2ecf20Sopenharmony_ci tdm_sclk_pad_2, AUDIO_SM1_MST_PAD_CTRL1, 8, sclk_pad_ctrl_parent_data); 8098c2ecf20Sopenharmony_ci 8108c2ecf20Sopenharmony_ci/* 8118c2ecf20Sopenharmony_ci * Array of all clocks provided by this provider 8128c2ecf20Sopenharmony_ci * The input clocks of the controller will be populated at runtime 8138c2ecf20Sopenharmony_ci */ 8148c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data axg_audio_hw_onecell_data = { 8158c2ecf20Sopenharmony_ci .hws = { 8168c2ecf20Sopenharmony_ci [AUD_CLKID_DDR_ARB] = &ddr_arb.hw, 8178c2ecf20Sopenharmony_ci [AUD_CLKID_PDM] = &pdm.hw, 8188c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A] = &tdmin_a.hw, 8198c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B] = &tdmin_b.hw, 8208c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C] = &tdmin_c.hw, 8218c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw, 8228c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw, 8238c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw, 8248c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw, 8258c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_A] = &frddr_a.hw, 8268c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_B] = &frddr_b.hw, 8278c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_C] = &frddr_c.hw, 8288c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_A] = &toddr_a.hw, 8298c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_B] = &toddr_b.hw, 8308c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_C] = &toddr_c.hw, 8318c2ecf20Sopenharmony_ci [AUD_CLKID_LOOPBACK] = &loopback.hw, 8328c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN] = &spdifin.hw, 8338c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT] = &spdifout.hw, 8348c2ecf20Sopenharmony_ci [AUD_CLKID_RESAMPLE] = &resample.hw, 8358c2ecf20Sopenharmony_ci [AUD_CLKID_POWER_DETECT] = &power_detect.hw, 8368c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK_SEL] = &mst_a_mclk_sel.hw, 8378c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK_SEL] = &mst_b_mclk_sel.hw, 8388c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK_SEL] = &mst_c_mclk_sel.hw, 8398c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK_SEL] = &mst_d_mclk_sel.hw, 8408c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK_SEL] = &mst_e_mclk_sel.hw, 8418c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK_SEL] = &mst_f_mclk_sel.hw, 8428c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK_DIV] = &mst_a_mclk_div.hw, 8438c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK_DIV] = &mst_b_mclk_div.hw, 8448c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK_DIV] = &mst_c_mclk_div.hw, 8458c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK_DIV] = &mst_d_mclk_div.hw, 8468c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK_DIV] = &mst_e_mclk_div.hw, 8478c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK_DIV] = &mst_f_mclk_div.hw, 8488c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK] = &mst_a_mclk.hw, 8498c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK] = &mst_b_mclk.hw, 8508c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK] = &mst_c_mclk.hw, 8518c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK] = &mst_d_mclk.hw, 8528c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK] = &mst_e_mclk.hw, 8538c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK] = &mst_f_mclk.hw, 8548c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw, 8558c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw, 8568c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw, 8578c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw, 8588c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw, 8598c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw, 8608c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw, 8618c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw, 8628c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw, 8638c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw, 8648c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw, 8658c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw, 8668c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw, 8678c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw, 8688c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw, 8698c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw, 8708c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw, 8718c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw, 8728c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw, 8738c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw, 8748c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw, 8758c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw, 8768c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw, 8778c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw, 8788c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw, 8798c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw, 8808c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw, 8818c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw, 8828c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw, 8838c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw, 8848c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw, 8858c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw, 8868c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw, 8878c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw, 8888c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw, 8898c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw, 8908c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw, 8918c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw, 8928c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw, 8938c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw, 8948c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw, 8958c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw, 8968c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw, 8978c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw, 8988c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw, 8998c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw, 9008c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw, 9018c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw, 9028c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw, 9038c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw, 9048c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw, 9058c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw, 9068c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw, 9078c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw, 9088c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw, 9098c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw, 9108c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw, 9118c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw, 9128c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw, 9138c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw, 9148c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw, 9158c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw, 9168c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw, 9178c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw, 9188c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw, 9198c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw, 9208c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw, 9218c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw, 9228c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw, 9238c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw, 9248c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw, 9258c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw, 9268c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw, 9278c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK] = &axg_tdmout_a_sclk.hw, 9288c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK] = &axg_tdmout_b_sclk.hw, 9298c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK] = &axg_tdmout_c_sclk.hw, 9308c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw, 9318c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw, 9328c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw, 9338c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw, 9348c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw, 9358c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw, 9368c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw, 9378c2ecf20Sopenharmony_ci [AUD_CLKID_TOP] = &axg_aud_top, 9388c2ecf20Sopenharmony_ci [NR_CLKS] = NULL, 9398c2ecf20Sopenharmony_ci }, 9408c2ecf20Sopenharmony_ci .num = NR_CLKS, 9418c2ecf20Sopenharmony_ci}; 9428c2ecf20Sopenharmony_ci 9438c2ecf20Sopenharmony_ci/* 9448c2ecf20Sopenharmony_ci * Array of all G12A clocks provided by this provider 9458c2ecf20Sopenharmony_ci * The input clocks of the controller will be populated at runtime 9468c2ecf20Sopenharmony_ci */ 9478c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data g12a_audio_hw_onecell_data = { 9488c2ecf20Sopenharmony_ci .hws = { 9498c2ecf20Sopenharmony_ci [AUD_CLKID_DDR_ARB] = &ddr_arb.hw, 9508c2ecf20Sopenharmony_ci [AUD_CLKID_PDM] = &pdm.hw, 9518c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A] = &tdmin_a.hw, 9528c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B] = &tdmin_b.hw, 9538c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C] = &tdmin_c.hw, 9548c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw, 9558c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw, 9568c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw, 9578c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw, 9588c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_A] = &frddr_a.hw, 9598c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_B] = &frddr_b.hw, 9608c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_C] = &frddr_c.hw, 9618c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_A] = &toddr_a.hw, 9628c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_B] = &toddr_b.hw, 9638c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_C] = &toddr_c.hw, 9648c2ecf20Sopenharmony_ci [AUD_CLKID_LOOPBACK] = &loopback.hw, 9658c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN] = &spdifin.hw, 9668c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT] = &spdifout.hw, 9678c2ecf20Sopenharmony_ci [AUD_CLKID_RESAMPLE] = &resample.hw, 9688c2ecf20Sopenharmony_ci [AUD_CLKID_POWER_DETECT] = &power_detect.hw, 9698c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_B] = &spdifout_b.hw, 9708c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK_SEL] = &mst_a_mclk_sel.hw, 9718c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK_SEL] = &mst_b_mclk_sel.hw, 9728c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK_SEL] = &mst_c_mclk_sel.hw, 9738c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK_SEL] = &mst_d_mclk_sel.hw, 9748c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK_SEL] = &mst_e_mclk_sel.hw, 9758c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK_SEL] = &mst_f_mclk_sel.hw, 9768c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK_DIV] = &mst_a_mclk_div.hw, 9778c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK_DIV] = &mst_b_mclk_div.hw, 9788c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK_DIV] = &mst_c_mclk_div.hw, 9798c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK_DIV] = &mst_d_mclk_div.hw, 9808c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK_DIV] = &mst_e_mclk_div.hw, 9818c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK_DIV] = &mst_f_mclk_div.hw, 9828c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK] = &mst_a_mclk.hw, 9838c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK] = &mst_b_mclk.hw, 9848c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK] = &mst_c_mclk.hw, 9858c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK] = &mst_d_mclk.hw, 9868c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK] = &mst_e_mclk.hw, 9878c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK] = &mst_f_mclk.hw, 9888c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw, 9898c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw, 9908c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw, 9918c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_B_CLK_SEL] = &spdifout_b_clk_sel.hw, 9928c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_B_CLK_DIV] = &spdifout_b_clk_div.hw, 9938c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_B_CLK] = &spdifout_b_clk.hw, 9948c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw, 9958c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw, 9968c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw, 9978c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw, 9988c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw, 9998c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw, 10008c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw, 10018c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw, 10028c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw, 10038c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw, 10048c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw, 10058c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw, 10068c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw, 10078c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw, 10088c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw, 10098c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw, 10108c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw, 10118c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw, 10128c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw, 10138c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw, 10148c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw, 10158c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw, 10168c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw, 10178c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw, 10188c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw, 10198c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw, 10208c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw, 10218c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw, 10228c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw, 10238c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw, 10248c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw, 10258c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw, 10268c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw, 10278c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw, 10288c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw, 10298c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw, 10308c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw, 10318c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw, 10328c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw, 10338c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw, 10348c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw, 10358c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw, 10368c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw, 10378c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw, 10388c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw, 10398c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw, 10408c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw, 10418c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw, 10428c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw, 10438c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw, 10448c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw, 10458c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw, 10468c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw, 10478c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw, 10488c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw, 10498c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw, 10508c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw, 10518c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw, 10528c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw, 10538c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw, 10548c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw, 10558c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw, 10568c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw, 10578c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw, 10588c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw, 10598c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw, 10608c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw, 10618c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw, 10628c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw, 10638c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw, 10648c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK] = &g12a_tdmout_a_sclk.hw, 10658c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK] = &g12a_tdmout_b_sclk.hw, 10668c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK] = &g12a_tdmout_c_sclk.hw, 10678c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw, 10688c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw, 10698c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw, 10708c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw, 10718c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw, 10728c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw, 10738c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw, 10748c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_MCLK_PAD0] = &g12a_tdm_mclk_pad_0.hw, 10758c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_MCLK_PAD1] = &g12a_tdm_mclk_pad_1.hw, 10768c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_LRCLK_PAD0] = &g12a_tdm_lrclk_pad_0.hw, 10778c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_LRCLK_PAD1] = &g12a_tdm_lrclk_pad_1.hw, 10788c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_LRCLK_PAD2] = &g12a_tdm_lrclk_pad_2.hw, 10798c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_SCLK_PAD0] = &g12a_tdm_sclk_pad_0.hw, 10808c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_SCLK_PAD1] = &g12a_tdm_sclk_pad_1.hw, 10818c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_SCLK_PAD2] = &g12a_tdm_sclk_pad_2.hw, 10828c2ecf20Sopenharmony_ci [AUD_CLKID_TOP] = &axg_aud_top, 10838c2ecf20Sopenharmony_ci [NR_CLKS] = NULL, 10848c2ecf20Sopenharmony_ci }, 10858c2ecf20Sopenharmony_ci .num = NR_CLKS, 10868c2ecf20Sopenharmony_ci}; 10878c2ecf20Sopenharmony_ci 10888c2ecf20Sopenharmony_ci/* 10898c2ecf20Sopenharmony_ci * Array of all SM1 clocks provided by this provider 10908c2ecf20Sopenharmony_ci * The input clocks of the controller will be populated at runtime 10918c2ecf20Sopenharmony_ci */ 10928c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sm1_audio_hw_onecell_data = { 10938c2ecf20Sopenharmony_ci .hws = { 10948c2ecf20Sopenharmony_ci [AUD_CLKID_DDR_ARB] = &ddr_arb.hw, 10958c2ecf20Sopenharmony_ci [AUD_CLKID_PDM] = &pdm.hw, 10968c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A] = &tdmin_a.hw, 10978c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B] = &tdmin_b.hw, 10988c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C] = &tdmin_c.hw, 10998c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB] = &tdmin_lb.hw, 11008c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A] = &tdmout_a.hw, 11018c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B] = &tdmout_b.hw, 11028c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C] = &tdmout_c.hw, 11038c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_A] = &frddr_a.hw, 11048c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_B] = &frddr_b.hw, 11058c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_C] = &frddr_c.hw, 11068c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_A] = &toddr_a.hw, 11078c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_B] = &toddr_b.hw, 11088c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_C] = &toddr_c.hw, 11098c2ecf20Sopenharmony_ci [AUD_CLKID_LOOPBACK] = &loopback.hw, 11108c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN] = &spdifin.hw, 11118c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT] = &spdifout.hw, 11128c2ecf20Sopenharmony_ci [AUD_CLKID_RESAMPLE] = &resample.hw, 11138c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_B] = &spdifout_b.hw, 11148c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK_SEL] = &sm1_mst_a_mclk_sel.hw, 11158c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK_SEL] = &sm1_mst_b_mclk_sel.hw, 11168c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK_SEL] = &sm1_mst_c_mclk_sel.hw, 11178c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK_SEL] = &sm1_mst_d_mclk_sel.hw, 11188c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK_SEL] = &sm1_mst_e_mclk_sel.hw, 11198c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK_SEL] = &sm1_mst_f_mclk_sel.hw, 11208c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK_DIV] = &sm1_mst_a_mclk_div.hw, 11218c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK_DIV] = &sm1_mst_b_mclk_div.hw, 11228c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK_DIV] = &sm1_mst_c_mclk_div.hw, 11238c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK_DIV] = &sm1_mst_d_mclk_div.hw, 11248c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK_DIV] = &sm1_mst_e_mclk_div.hw, 11258c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK_DIV] = &sm1_mst_f_mclk_div.hw, 11268c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_MCLK] = &sm1_mst_a_mclk.hw, 11278c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_MCLK] = &sm1_mst_b_mclk.hw, 11288c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_MCLK] = &sm1_mst_c_mclk.hw, 11298c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_MCLK] = &sm1_mst_d_mclk.hw, 11308c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_MCLK] = &sm1_mst_e_mclk.hw, 11318c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_MCLK] = &sm1_mst_f_mclk.hw, 11328c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK_SEL] = &spdifout_clk_sel.hw, 11338c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK_DIV] = &spdifout_clk_div.hw, 11348c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_CLK] = &spdifout_clk.hw, 11358c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_B_CLK_SEL] = &spdifout_b_clk_sel.hw, 11368c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_B_CLK_DIV] = &spdifout_b_clk_div.hw, 11378c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFOUT_B_CLK] = &spdifout_b_clk.hw, 11388c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK_SEL] = &spdifin_clk_sel.hw, 11398c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK_DIV] = &spdifin_clk_div.hw, 11408c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_CLK] = &spdifin_clk.hw, 11418c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK_SEL] = &pdm_dclk_sel.hw, 11428c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK_DIV] = &pdm_dclk_div.hw, 11438c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_DCLK] = &pdm_dclk.hw, 11448c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK_SEL] = &pdm_sysclk_sel.hw, 11458c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK_DIV] = &pdm_sysclk_div.hw, 11468c2ecf20Sopenharmony_ci [AUD_CLKID_PDM_SYSCLK] = &pdm_sysclk.hw, 11478c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_PRE_EN] = &mst_a_sclk_pre_en.hw, 11488c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_PRE_EN] = &mst_b_sclk_pre_en.hw, 11498c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_PRE_EN] = &mst_c_sclk_pre_en.hw, 11508c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_PRE_EN] = &mst_d_sclk_pre_en.hw, 11518c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_PRE_EN] = &mst_e_sclk_pre_en.hw, 11528c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_PRE_EN] = &mst_f_sclk_pre_en.hw, 11538c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_DIV] = &mst_a_sclk_div.hw, 11548c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_DIV] = &mst_b_sclk_div.hw, 11558c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_DIV] = &mst_c_sclk_div.hw, 11568c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_DIV] = &mst_d_sclk_div.hw, 11578c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_DIV] = &mst_e_sclk_div.hw, 11588c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_DIV] = &mst_f_sclk_div.hw, 11598c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK_POST_EN] = &mst_a_sclk_post_en.hw, 11608c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK_POST_EN] = &mst_b_sclk_post_en.hw, 11618c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK_POST_EN] = &mst_c_sclk_post_en.hw, 11628c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK_POST_EN] = &mst_d_sclk_post_en.hw, 11638c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK_POST_EN] = &mst_e_sclk_post_en.hw, 11648c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK_POST_EN] = &mst_f_sclk_post_en.hw, 11658c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_SCLK] = &mst_a_sclk.hw, 11668c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_SCLK] = &mst_b_sclk.hw, 11678c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_SCLK] = &mst_c_sclk.hw, 11688c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_SCLK] = &mst_d_sclk.hw, 11698c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_SCLK] = &mst_e_sclk.hw, 11708c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_SCLK] = &mst_f_sclk.hw, 11718c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_LRCLK_DIV] = &mst_a_lrclk_div.hw, 11728c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_LRCLK_DIV] = &mst_b_lrclk_div.hw, 11738c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_LRCLK_DIV] = &mst_c_lrclk_div.hw, 11748c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_LRCLK_DIV] = &mst_d_lrclk_div.hw, 11758c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_LRCLK_DIV] = &mst_e_lrclk_div.hw, 11768c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_LRCLK_DIV] = &mst_f_lrclk_div.hw, 11778c2ecf20Sopenharmony_ci [AUD_CLKID_MST_A_LRCLK] = &mst_a_lrclk.hw, 11788c2ecf20Sopenharmony_ci [AUD_CLKID_MST_B_LRCLK] = &mst_b_lrclk.hw, 11798c2ecf20Sopenharmony_ci [AUD_CLKID_MST_C_LRCLK] = &mst_c_lrclk.hw, 11808c2ecf20Sopenharmony_ci [AUD_CLKID_MST_D_LRCLK] = &mst_d_lrclk.hw, 11818c2ecf20Sopenharmony_ci [AUD_CLKID_MST_E_LRCLK] = &mst_e_lrclk.hw, 11828c2ecf20Sopenharmony_ci [AUD_CLKID_MST_F_LRCLK] = &mst_f_lrclk.hw, 11838c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_SEL] = &tdmin_a_sclk_sel.hw, 11848c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_SEL] = &tdmin_b_sclk_sel.hw, 11858c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_SEL] = &tdmin_c_sclk_sel.hw, 11868c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_SEL] = &tdmin_lb_sclk_sel.hw, 11878c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_SEL] = &tdmout_a_sclk_sel.hw, 11888c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_SEL] = &tdmout_b_sclk_sel.hw, 11898c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_SEL] = &tdmout_c_sclk_sel.hw, 11908c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_PRE_EN] = &tdmin_a_sclk_pre_en.hw, 11918c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_PRE_EN] = &tdmin_b_sclk_pre_en.hw, 11928c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_PRE_EN] = &tdmin_c_sclk_pre_en.hw, 11938c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_PRE_EN] = &tdmin_lb_sclk_pre_en.hw, 11948c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_PRE_EN] = &tdmout_a_sclk_pre_en.hw, 11958c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_PRE_EN] = &tdmout_b_sclk_pre_en.hw, 11968c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_PRE_EN] = &tdmout_c_sclk_pre_en.hw, 11978c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK_POST_EN] = &tdmin_a_sclk_post_en.hw, 11988c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK_POST_EN] = &tdmin_b_sclk_post_en.hw, 11998c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK_POST_EN] = &tdmin_c_sclk_post_en.hw, 12008c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK_POST_EN] = &tdmin_lb_sclk_post_en.hw, 12018c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK_POST_EN] = &tdmout_a_sclk_post_en.hw, 12028c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK_POST_EN] = &tdmout_b_sclk_post_en.hw, 12038c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK_POST_EN] = &tdmout_c_sclk_post_en.hw, 12048c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_SCLK] = &tdmin_a_sclk.hw, 12058c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_SCLK] = &tdmin_b_sclk.hw, 12068c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_SCLK] = &tdmin_c_sclk.hw, 12078c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_SCLK] = &tdmin_lb_sclk.hw, 12088c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_SCLK] = &g12a_tdmout_a_sclk.hw, 12098c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_SCLK] = &g12a_tdmout_b_sclk.hw, 12108c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_SCLK] = &g12a_tdmout_c_sclk.hw, 12118c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_A_LRCLK] = &tdmin_a_lrclk.hw, 12128c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_B_LRCLK] = &tdmin_b_lrclk.hw, 12138c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_C_LRCLK] = &tdmin_c_lrclk.hw, 12148c2ecf20Sopenharmony_ci [AUD_CLKID_TDMIN_LB_LRCLK] = &tdmin_lb_lrclk.hw, 12158c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw, 12168c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw, 12178c2ecf20Sopenharmony_ci [AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw, 12188c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_MCLK_PAD0] = &sm1_tdm_mclk_pad_0.hw, 12198c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_MCLK_PAD1] = &sm1_tdm_mclk_pad_1.hw, 12208c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_LRCLK_PAD0] = &sm1_tdm_lrclk_pad_0.hw, 12218c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_LRCLK_PAD1] = &sm1_tdm_lrclk_pad_1.hw, 12228c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_LRCLK_PAD2] = &sm1_tdm_lrclk_pad_2.hw, 12238c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_SCLK_PAD0] = &sm1_tdm_sclk_pad_0.hw, 12248c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_SCLK_PAD1] = &sm1_tdm_sclk_pad_1.hw, 12258c2ecf20Sopenharmony_ci [AUD_CLKID_TDM_SCLK_PAD2] = &sm1_tdm_sclk_pad_2.hw, 12268c2ecf20Sopenharmony_ci [AUD_CLKID_TOP] = &sm1_aud_top.hw, 12278c2ecf20Sopenharmony_ci [AUD_CLKID_TORAM] = &toram.hw, 12288c2ecf20Sopenharmony_ci [AUD_CLKID_EQDRC] = &eqdrc.hw, 12298c2ecf20Sopenharmony_ci [AUD_CLKID_RESAMPLE_B] = &resample_b.hw, 12308c2ecf20Sopenharmony_ci [AUD_CLKID_TOVAD] = &tovad.hw, 12318c2ecf20Sopenharmony_ci [AUD_CLKID_LOCKER] = &locker.hw, 12328c2ecf20Sopenharmony_ci [AUD_CLKID_SPDIFIN_LB] = &spdifin_lb.hw, 12338c2ecf20Sopenharmony_ci [AUD_CLKID_FRDDR_D] = &frddr_d.hw, 12348c2ecf20Sopenharmony_ci [AUD_CLKID_TODDR_D] = &toddr_d.hw, 12358c2ecf20Sopenharmony_ci [AUD_CLKID_LOOPBACK_B] = &loopback_b.hw, 12368c2ecf20Sopenharmony_ci [AUD_CLKID_CLK81_EN] = &sm1_clk81_en.hw, 12378c2ecf20Sopenharmony_ci [AUD_CLKID_SYSCLK_A_DIV] = &sm1_sysclk_a_div.hw, 12388c2ecf20Sopenharmony_ci [AUD_CLKID_SYSCLK_A_EN] = &sm1_sysclk_a_en.hw, 12398c2ecf20Sopenharmony_ci [AUD_CLKID_SYSCLK_B_DIV] = &sm1_sysclk_b_div.hw, 12408c2ecf20Sopenharmony_ci [AUD_CLKID_SYSCLK_B_EN] = &sm1_sysclk_b_en.hw, 12418c2ecf20Sopenharmony_ci [NR_CLKS] = NULL, 12428c2ecf20Sopenharmony_ci }, 12438c2ecf20Sopenharmony_ci .num = NR_CLKS, 12448c2ecf20Sopenharmony_ci}; 12458c2ecf20Sopenharmony_ci 12468c2ecf20Sopenharmony_ci 12478c2ecf20Sopenharmony_ci/* Convenience table to populate regmap in .probe(). */ 12488c2ecf20Sopenharmony_cistatic struct clk_regmap *const axg_clk_regmaps[] = { 12498c2ecf20Sopenharmony_ci &ddr_arb, 12508c2ecf20Sopenharmony_ci &pdm, 12518c2ecf20Sopenharmony_ci &tdmin_a, 12528c2ecf20Sopenharmony_ci &tdmin_b, 12538c2ecf20Sopenharmony_ci &tdmin_c, 12548c2ecf20Sopenharmony_ci &tdmin_lb, 12558c2ecf20Sopenharmony_ci &tdmout_a, 12568c2ecf20Sopenharmony_ci &tdmout_b, 12578c2ecf20Sopenharmony_ci &tdmout_c, 12588c2ecf20Sopenharmony_ci &frddr_a, 12598c2ecf20Sopenharmony_ci &frddr_b, 12608c2ecf20Sopenharmony_ci &frddr_c, 12618c2ecf20Sopenharmony_ci &toddr_a, 12628c2ecf20Sopenharmony_ci &toddr_b, 12638c2ecf20Sopenharmony_ci &toddr_c, 12648c2ecf20Sopenharmony_ci &loopback, 12658c2ecf20Sopenharmony_ci &spdifin, 12668c2ecf20Sopenharmony_ci &spdifout, 12678c2ecf20Sopenharmony_ci &resample, 12688c2ecf20Sopenharmony_ci &power_detect, 12698c2ecf20Sopenharmony_ci &mst_a_mclk_sel, 12708c2ecf20Sopenharmony_ci &mst_b_mclk_sel, 12718c2ecf20Sopenharmony_ci &mst_c_mclk_sel, 12728c2ecf20Sopenharmony_ci &mst_d_mclk_sel, 12738c2ecf20Sopenharmony_ci &mst_e_mclk_sel, 12748c2ecf20Sopenharmony_ci &mst_f_mclk_sel, 12758c2ecf20Sopenharmony_ci &mst_a_mclk_div, 12768c2ecf20Sopenharmony_ci &mst_b_mclk_div, 12778c2ecf20Sopenharmony_ci &mst_c_mclk_div, 12788c2ecf20Sopenharmony_ci &mst_d_mclk_div, 12798c2ecf20Sopenharmony_ci &mst_e_mclk_div, 12808c2ecf20Sopenharmony_ci &mst_f_mclk_div, 12818c2ecf20Sopenharmony_ci &mst_a_mclk, 12828c2ecf20Sopenharmony_ci &mst_b_mclk, 12838c2ecf20Sopenharmony_ci &mst_c_mclk, 12848c2ecf20Sopenharmony_ci &mst_d_mclk, 12858c2ecf20Sopenharmony_ci &mst_e_mclk, 12868c2ecf20Sopenharmony_ci &mst_f_mclk, 12878c2ecf20Sopenharmony_ci &spdifout_clk_sel, 12888c2ecf20Sopenharmony_ci &spdifout_clk_div, 12898c2ecf20Sopenharmony_ci &spdifout_clk, 12908c2ecf20Sopenharmony_ci &spdifin_clk_sel, 12918c2ecf20Sopenharmony_ci &spdifin_clk_div, 12928c2ecf20Sopenharmony_ci &spdifin_clk, 12938c2ecf20Sopenharmony_ci &pdm_dclk_sel, 12948c2ecf20Sopenharmony_ci &pdm_dclk_div, 12958c2ecf20Sopenharmony_ci &pdm_dclk, 12968c2ecf20Sopenharmony_ci &pdm_sysclk_sel, 12978c2ecf20Sopenharmony_ci &pdm_sysclk_div, 12988c2ecf20Sopenharmony_ci &pdm_sysclk, 12998c2ecf20Sopenharmony_ci &mst_a_sclk_pre_en, 13008c2ecf20Sopenharmony_ci &mst_b_sclk_pre_en, 13018c2ecf20Sopenharmony_ci &mst_c_sclk_pre_en, 13028c2ecf20Sopenharmony_ci &mst_d_sclk_pre_en, 13038c2ecf20Sopenharmony_ci &mst_e_sclk_pre_en, 13048c2ecf20Sopenharmony_ci &mst_f_sclk_pre_en, 13058c2ecf20Sopenharmony_ci &mst_a_sclk_div, 13068c2ecf20Sopenharmony_ci &mst_b_sclk_div, 13078c2ecf20Sopenharmony_ci &mst_c_sclk_div, 13088c2ecf20Sopenharmony_ci &mst_d_sclk_div, 13098c2ecf20Sopenharmony_ci &mst_e_sclk_div, 13108c2ecf20Sopenharmony_ci &mst_f_sclk_div, 13118c2ecf20Sopenharmony_ci &mst_a_sclk_post_en, 13128c2ecf20Sopenharmony_ci &mst_b_sclk_post_en, 13138c2ecf20Sopenharmony_ci &mst_c_sclk_post_en, 13148c2ecf20Sopenharmony_ci &mst_d_sclk_post_en, 13158c2ecf20Sopenharmony_ci &mst_e_sclk_post_en, 13168c2ecf20Sopenharmony_ci &mst_f_sclk_post_en, 13178c2ecf20Sopenharmony_ci &mst_a_sclk, 13188c2ecf20Sopenharmony_ci &mst_b_sclk, 13198c2ecf20Sopenharmony_ci &mst_c_sclk, 13208c2ecf20Sopenharmony_ci &mst_d_sclk, 13218c2ecf20Sopenharmony_ci &mst_e_sclk, 13228c2ecf20Sopenharmony_ci &mst_f_sclk, 13238c2ecf20Sopenharmony_ci &mst_a_lrclk_div, 13248c2ecf20Sopenharmony_ci &mst_b_lrclk_div, 13258c2ecf20Sopenharmony_ci &mst_c_lrclk_div, 13268c2ecf20Sopenharmony_ci &mst_d_lrclk_div, 13278c2ecf20Sopenharmony_ci &mst_e_lrclk_div, 13288c2ecf20Sopenharmony_ci &mst_f_lrclk_div, 13298c2ecf20Sopenharmony_ci &mst_a_lrclk, 13308c2ecf20Sopenharmony_ci &mst_b_lrclk, 13318c2ecf20Sopenharmony_ci &mst_c_lrclk, 13328c2ecf20Sopenharmony_ci &mst_d_lrclk, 13338c2ecf20Sopenharmony_ci &mst_e_lrclk, 13348c2ecf20Sopenharmony_ci &mst_f_lrclk, 13358c2ecf20Sopenharmony_ci &tdmin_a_sclk_sel, 13368c2ecf20Sopenharmony_ci &tdmin_b_sclk_sel, 13378c2ecf20Sopenharmony_ci &tdmin_c_sclk_sel, 13388c2ecf20Sopenharmony_ci &tdmin_lb_sclk_sel, 13398c2ecf20Sopenharmony_ci &tdmout_a_sclk_sel, 13408c2ecf20Sopenharmony_ci &tdmout_b_sclk_sel, 13418c2ecf20Sopenharmony_ci &tdmout_c_sclk_sel, 13428c2ecf20Sopenharmony_ci &tdmin_a_sclk_pre_en, 13438c2ecf20Sopenharmony_ci &tdmin_b_sclk_pre_en, 13448c2ecf20Sopenharmony_ci &tdmin_c_sclk_pre_en, 13458c2ecf20Sopenharmony_ci &tdmin_lb_sclk_pre_en, 13468c2ecf20Sopenharmony_ci &tdmout_a_sclk_pre_en, 13478c2ecf20Sopenharmony_ci &tdmout_b_sclk_pre_en, 13488c2ecf20Sopenharmony_ci &tdmout_c_sclk_pre_en, 13498c2ecf20Sopenharmony_ci &tdmin_a_sclk_post_en, 13508c2ecf20Sopenharmony_ci &tdmin_b_sclk_post_en, 13518c2ecf20Sopenharmony_ci &tdmin_c_sclk_post_en, 13528c2ecf20Sopenharmony_ci &tdmin_lb_sclk_post_en, 13538c2ecf20Sopenharmony_ci &tdmout_a_sclk_post_en, 13548c2ecf20Sopenharmony_ci &tdmout_b_sclk_post_en, 13558c2ecf20Sopenharmony_ci &tdmout_c_sclk_post_en, 13568c2ecf20Sopenharmony_ci &tdmin_a_sclk, 13578c2ecf20Sopenharmony_ci &tdmin_b_sclk, 13588c2ecf20Sopenharmony_ci &tdmin_c_sclk, 13598c2ecf20Sopenharmony_ci &tdmin_lb_sclk, 13608c2ecf20Sopenharmony_ci &axg_tdmout_a_sclk, 13618c2ecf20Sopenharmony_ci &axg_tdmout_b_sclk, 13628c2ecf20Sopenharmony_ci &axg_tdmout_c_sclk, 13638c2ecf20Sopenharmony_ci &tdmin_a_lrclk, 13648c2ecf20Sopenharmony_ci &tdmin_b_lrclk, 13658c2ecf20Sopenharmony_ci &tdmin_c_lrclk, 13668c2ecf20Sopenharmony_ci &tdmin_lb_lrclk, 13678c2ecf20Sopenharmony_ci &tdmout_a_lrclk, 13688c2ecf20Sopenharmony_ci &tdmout_b_lrclk, 13698c2ecf20Sopenharmony_ci &tdmout_c_lrclk, 13708c2ecf20Sopenharmony_ci}; 13718c2ecf20Sopenharmony_ci 13728c2ecf20Sopenharmony_cistatic struct clk_regmap *const g12a_clk_regmaps[] = { 13738c2ecf20Sopenharmony_ci &ddr_arb, 13748c2ecf20Sopenharmony_ci &pdm, 13758c2ecf20Sopenharmony_ci &tdmin_a, 13768c2ecf20Sopenharmony_ci &tdmin_b, 13778c2ecf20Sopenharmony_ci &tdmin_c, 13788c2ecf20Sopenharmony_ci &tdmin_lb, 13798c2ecf20Sopenharmony_ci &tdmout_a, 13808c2ecf20Sopenharmony_ci &tdmout_b, 13818c2ecf20Sopenharmony_ci &tdmout_c, 13828c2ecf20Sopenharmony_ci &frddr_a, 13838c2ecf20Sopenharmony_ci &frddr_b, 13848c2ecf20Sopenharmony_ci &frddr_c, 13858c2ecf20Sopenharmony_ci &toddr_a, 13868c2ecf20Sopenharmony_ci &toddr_b, 13878c2ecf20Sopenharmony_ci &toddr_c, 13888c2ecf20Sopenharmony_ci &loopback, 13898c2ecf20Sopenharmony_ci &spdifin, 13908c2ecf20Sopenharmony_ci &spdifout, 13918c2ecf20Sopenharmony_ci &resample, 13928c2ecf20Sopenharmony_ci &power_detect, 13938c2ecf20Sopenharmony_ci &spdifout_b, 13948c2ecf20Sopenharmony_ci &mst_a_mclk_sel, 13958c2ecf20Sopenharmony_ci &mst_b_mclk_sel, 13968c2ecf20Sopenharmony_ci &mst_c_mclk_sel, 13978c2ecf20Sopenharmony_ci &mst_d_mclk_sel, 13988c2ecf20Sopenharmony_ci &mst_e_mclk_sel, 13998c2ecf20Sopenharmony_ci &mst_f_mclk_sel, 14008c2ecf20Sopenharmony_ci &mst_a_mclk_div, 14018c2ecf20Sopenharmony_ci &mst_b_mclk_div, 14028c2ecf20Sopenharmony_ci &mst_c_mclk_div, 14038c2ecf20Sopenharmony_ci &mst_d_mclk_div, 14048c2ecf20Sopenharmony_ci &mst_e_mclk_div, 14058c2ecf20Sopenharmony_ci &mst_f_mclk_div, 14068c2ecf20Sopenharmony_ci &mst_a_mclk, 14078c2ecf20Sopenharmony_ci &mst_b_mclk, 14088c2ecf20Sopenharmony_ci &mst_c_mclk, 14098c2ecf20Sopenharmony_ci &mst_d_mclk, 14108c2ecf20Sopenharmony_ci &mst_e_mclk, 14118c2ecf20Sopenharmony_ci &mst_f_mclk, 14128c2ecf20Sopenharmony_ci &spdifout_clk_sel, 14138c2ecf20Sopenharmony_ci &spdifout_clk_div, 14148c2ecf20Sopenharmony_ci &spdifout_clk, 14158c2ecf20Sopenharmony_ci &spdifin_clk_sel, 14168c2ecf20Sopenharmony_ci &spdifin_clk_div, 14178c2ecf20Sopenharmony_ci &spdifin_clk, 14188c2ecf20Sopenharmony_ci &pdm_dclk_sel, 14198c2ecf20Sopenharmony_ci &pdm_dclk_div, 14208c2ecf20Sopenharmony_ci &pdm_dclk, 14218c2ecf20Sopenharmony_ci &pdm_sysclk_sel, 14228c2ecf20Sopenharmony_ci &pdm_sysclk_div, 14238c2ecf20Sopenharmony_ci &pdm_sysclk, 14248c2ecf20Sopenharmony_ci &mst_a_sclk_pre_en, 14258c2ecf20Sopenharmony_ci &mst_b_sclk_pre_en, 14268c2ecf20Sopenharmony_ci &mst_c_sclk_pre_en, 14278c2ecf20Sopenharmony_ci &mst_d_sclk_pre_en, 14288c2ecf20Sopenharmony_ci &mst_e_sclk_pre_en, 14298c2ecf20Sopenharmony_ci &mst_f_sclk_pre_en, 14308c2ecf20Sopenharmony_ci &mst_a_sclk_div, 14318c2ecf20Sopenharmony_ci &mst_b_sclk_div, 14328c2ecf20Sopenharmony_ci &mst_c_sclk_div, 14338c2ecf20Sopenharmony_ci &mst_d_sclk_div, 14348c2ecf20Sopenharmony_ci &mst_e_sclk_div, 14358c2ecf20Sopenharmony_ci &mst_f_sclk_div, 14368c2ecf20Sopenharmony_ci &mst_a_sclk_post_en, 14378c2ecf20Sopenharmony_ci &mst_b_sclk_post_en, 14388c2ecf20Sopenharmony_ci &mst_c_sclk_post_en, 14398c2ecf20Sopenharmony_ci &mst_d_sclk_post_en, 14408c2ecf20Sopenharmony_ci &mst_e_sclk_post_en, 14418c2ecf20Sopenharmony_ci &mst_f_sclk_post_en, 14428c2ecf20Sopenharmony_ci &mst_a_sclk, 14438c2ecf20Sopenharmony_ci &mst_b_sclk, 14448c2ecf20Sopenharmony_ci &mst_c_sclk, 14458c2ecf20Sopenharmony_ci &mst_d_sclk, 14468c2ecf20Sopenharmony_ci &mst_e_sclk, 14478c2ecf20Sopenharmony_ci &mst_f_sclk, 14488c2ecf20Sopenharmony_ci &mst_a_lrclk_div, 14498c2ecf20Sopenharmony_ci &mst_b_lrclk_div, 14508c2ecf20Sopenharmony_ci &mst_c_lrclk_div, 14518c2ecf20Sopenharmony_ci &mst_d_lrclk_div, 14528c2ecf20Sopenharmony_ci &mst_e_lrclk_div, 14538c2ecf20Sopenharmony_ci &mst_f_lrclk_div, 14548c2ecf20Sopenharmony_ci &mst_a_lrclk, 14558c2ecf20Sopenharmony_ci &mst_b_lrclk, 14568c2ecf20Sopenharmony_ci &mst_c_lrclk, 14578c2ecf20Sopenharmony_ci &mst_d_lrclk, 14588c2ecf20Sopenharmony_ci &mst_e_lrclk, 14598c2ecf20Sopenharmony_ci &mst_f_lrclk, 14608c2ecf20Sopenharmony_ci &tdmin_a_sclk_sel, 14618c2ecf20Sopenharmony_ci &tdmin_b_sclk_sel, 14628c2ecf20Sopenharmony_ci &tdmin_c_sclk_sel, 14638c2ecf20Sopenharmony_ci &tdmin_lb_sclk_sel, 14648c2ecf20Sopenharmony_ci &tdmout_a_sclk_sel, 14658c2ecf20Sopenharmony_ci &tdmout_b_sclk_sel, 14668c2ecf20Sopenharmony_ci &tdmout_c_sclk_sel, 14678c2ecf20Sopenharmony_ci &tdmin_a_sclk_pre_en, 14688c2ecf20Sopenharmony_ci &tdmin_b_sclk_pre_en, 14698c2ecf20Sopenharmony_ci &tdmin_c_sclk_pre_en, 14708c2ecf20Sopenharmony_ci &tdmin_lb_sclk_pre_en, 14718c2ecf20Sopenharmony_ci &tdmout_a_sclk_pre_en, 14728c2ecf20Sopenharmony_ci &tdmout_b_sclk_pre_en, 14738c2ecf20Sopenharmony_ci &tdmout_c_sclk_pre_en, 14748c2ecf20Sopenharmony_ci &tdmin_a_sclk_post_en, 14758c2ecf20Sopenharmony_ci &tdmin_b_sclk_post_en, 14768c2ecf20Sopenharmony_ci &tdmin_c_sclk_post_en, 14778c2ecf20Sopenharmony_ci &tdmin_lb_sclk_post_en, 14788c2ecf20Sopenharmony_ci &tdmout_a_sclk_post_en, 14798c2ecf20Sopenharmony_ci &tdmout_b_sclk_post_en, 14808c2ecf20Sopenharmony_ci &tdmout_c_sclk_post_en, 14818c2ecf20Sopenharmony_ci &tdmin_a_sclk, 14828c2ecf20Sopenharmony_ci &tdmin_b_sclk, 14838c2ecf20Sopenharmony_ci &tdmin_c_sclk, 14848c2ecf20Sopenharmony_ci &tdmin_lb_sclk, 14858c2ecf20Sopenharmony_ci &g12a_tdmout_a_sclk, 14868c2ecf20Sopenharmony_ci &g12a_tdmout_b_sclk, 14878c2ecf20Sopenharmony_ci &g12a_tdmout_c_sclk, 14888c2ecf20Sopenharmony_ci &tdmin_a_lrclk, 14898c2ecf20Sopenharmony_ci &tdmin_b_lrclk, 14908c2ecf20Sopenharmony_ci &tdmin_c_lrclk, 14918c2ecf20Sopenharmony_ci &tdmin_lb_lrclk, 14928c2ecf20Sopenharmony_ci &tdmout_a_lrclk, 14938c2ecf20Sopenharmony_ci &tdmout_b_lrclk, 14948c2ecf20Sopenharmony_ci &tdmout_c_lrclk, 14958c2ecf20Sopenharmony_ci &spdifout_b_clk_sel, 14968c2ecf20Sopenharmony_ci &spdifout_b_clk_div, 14978c2ecf20Sopenharmony_ci &spdifout_b_clk, 14988c2ecf20Sopenharmony_ci &g12a_tdm_mclk_pad_0, 14998c2ecf20Sopenharmony_ci &g12a_tdm_mclk_pad_1, 15008c2ecf20Sopenharmony_ci &g12a_tdm_lrclk_pad_0, 15018c2ecf20Sopenharmony_ci &g12a_tdm_lrclk_pad_1, 15028c2ecf20Sopenharmony_ci &g12a_tdm_lrclk_pad_2, 15038c2ecf20Sopenharmony_ci &g12a_tdm_sclk_pad_0, 15048c2ecf20Sopenharmony_ci &g12a_tdm_sclk_pad_1, 15058c2ecf20Sopenharmony_ci &g12a_tdm_sclk_pad_2, 15068c2ecf20Sopenharmony_ci &toram, 15078c2ecf20Sopenharmony_ci &eqdrc, 15088c2ecf20Sopenharmony_ci}; 15098c2ecf20Sopenharmony_ci 15108c2ecf20Sopenharmony_cistatic struct clk_regmap *const sm1_clk_regmaps[] = { 15118c2ecf20Sopenharmony_ci &ddr_arb, 15128c2ecf20Sopenharmony_ci &pdm, 15138c2ecf20Sopenharmony_ci &tdmin_a, 15148c2ecf20Sopenharmony_ci &tdmin_b, 15158c2ecf20Sopenharmony_ci &tdmin_c, 15168c2ecf20Sopenharmony_ci &tdmin_lb, 15178c2ecf20Sopenharmony_ci &tdmout_a, 15188c2ecf20Sopenharmony_ci &tdmout_b, 15198c2ecf20Sopenharmony_ci &tdmout_c, 15208c2ecf20Sopenharmony_ci &frddr_a, 15218c2ecf20Sopenharmony_ci &frddr_b, 15228c2ecf20Sopenharmony_ci &frddr_c, 15238c2ecf20Sopenharmony_ci &toddr_a, 15248c2ecf20Sopenharmony_ci &toddr_b, 15258c2ecf20Sopenharmony_ci &toddr_c, 15268c2ecf20Sopenharmony_ci &loopback, 15278c2ecf20Sopenharmony_ci &spdifin, 15288c2ecf20Sopenharmony_ci &spdifout, 15298c2ecf20Sopenharmony_ci &resample, 15308c2ecf20Sopenharmony_ci &spdifout_b, 15318c2ecf20Sopenharmony_ci &sm1_mst_a_mclk_sel, 15328c2ecf20Sopenharmony_ci &sm1_mst_b_mclk_sel, 15338c2ecf20Sopenharmony_ci &sm1_mst_c_mclk_sel, 15348c2ecf20Sopenharmony_ci &sm1_mst_d_mclk_sel, 15358c2ecf20Sopenharmony_ci &sm1_mst_e_mclk_sel, 15368c2ecf20Sopenharmony_ci &sm1_mst_f_mclk_sel, 15378c2ecf20Sopenharmony_ci &sm1_mst_a_mclk_div, 15388c2ecf20Sopenharmony_ci &sm1_mst_b_mclk_div, 15398c2ecf20Sopenharmony_ci &sm1_mst_c_mclk_div, 15408c2ecf20Sopenharmony_ci &sm1_mst_d_mclk_div, 15418c2ecf20Sopenharmony_ci &sm1_mst_e_mclk_div, 15428c2ecf20Sopenharmony_ci &sm1_mst_f_mclk_div, 15438c2ecf20Sopenharmony_ci &sm1_mst_a_mclk, 15448c2ecf20Sopenharmony_ci &sm1_mst_b_mclk, 15458c2ecf20Sopenharmony_ci &sm1_mst_c_mclk, 15468c2ecf20Sopenharmony_ci &sm1_mst_d_mclk, 15478c2ecf20Sopenharmony_ci &sm1_mst_e_mclk, 15488c2ecf20Sopenharmony_ci &sm1_mst_f_mclk, 15498c2ecf20Sopenharmony_ci &spdifout_clk_sel, 15508c2ecf20Sopenharmony_ci &spdifout_clk_div, 15518c2ecf20Sopenharmony_ci &spdifout_clk, 15528c2ecf20Sopenharmony_ci &spdifin_clk_sel, 15538c2ecf20Sopenharmony_ci &spdifin_clk_div, 15548c2ecf20Sopenharmony_ci &spdifin_clk, 15558c2ecf20Sopenharmony_ci &pdm_dclk_sel, 15568c2ecf20Sopenharmony_ci &pdm_dclk_div, 15578c2ecf20Sopenharmony_ci &pdm_dclk, 15588c2ecf20Sopenharmony_ci &pdm_sysclk_sel, 15598c2ecf20Sopenharmony_ci &pdm_sysclk_div, 15608c2ecf20Sopenharmony_ci &pdm_sysclk, 15618c2ecf20Sopenharmony_ci &mst_a_sclk_pre_en, 15628c2ecf20Sopenharmony_ci &mst_b_sclk_pre_en, 15638c2ecf20Sopenharmony_ci &mst_c_sclk_pre_en, 15648c2ecf20Sopenharmony_ci &mst_d_sclk_pre_en, 15658c2ecf20Sopenharmony_ci &mst_e_sclk_pre_en, 15668c2ecf20Sopenharmony_ci &mst_f_sclk_pre_en, 15678c2ecf20Sopenharmony_ci &mst_a_sclk_div, 15688c2ecf20Sopenharmony_ci &mst_b_sclk_div, 15698c2ecf20Sopenharmony_ci &mst_c_sclk_div, 15708c2ecf20Sopenharmony_ci &mst_d_sclk_div, 15718c2ecf20Sopenharmony_ci &mst_e_sclk_div, 15728c2ecf20Sopenharmony_ci &mst_f_sclk_div, 15738c2ecf20Sopenharmony_ci &mst_a_sclk_post_en, 15748c2ecf20Sopenharmony_ci &mst_b_sclk_post_en, 15758c2ecf20Sopenharmony_ci &mst_c_sclk_post_en, 15768c2ecf20Sopenharmony_ci &mst_d_sclk_post_en, 15778c2ecf20Sopenharmony_ci &mst_e_sclk_post_en, 15788c2ecf20Sopenharmony_ci &mst_f_sclk_post_en, 15798c2ecf20Sopenharmony_ci &mst_a_sclk, 15808c2ecf20Sopenharmony_ci &mst_b_sclk, 15818c2ecf20Sopenharmony_ci &mst_c_sclk, 15828c2ecf20Sopenharmony_ci &mst_d_sclk, 15838c2ecf20Sopenharmony_ci &mst_e_sclk, 15848c2ecf20Sopenharmony_ci &mst_f_sclk, 15858c2ecf20Sopenharmony_ci &mst_a_lrclk_div, 15868c2ecf20Sopenharmony_ci &mst_b_lrclk_div, 15878c2ecf20Sopenharmony_ci &mst_c_lrclk_div, 15888c2ecf20Sopenharmony_ci &mst_d_lrclk_div, 15898c2ecf20Sopenharmony_ci &mst_e_lrclk_div, 15908c2ecf20Sopenharmony_ci &mst_f_lrclk_div, 15918c2ecf20Sopenharmony_ci &mst_a_lrclk, 15928c2ecf20Sopenharmony_ci &mst_b_lrclk, 15938c2ecf20Sopenharmony_ci &mst_c_lrclk, 15948c2ecf20Sopenharmony_ci &mst_d_lrclk, 15958c2ecf20Sopenharmony_ci &mst_e_lrclk, 15968c2ecf20Sopenharmony_ci &mst_f_lrclk, 15978c2ecf20Sopenharmony_ci &tdmin_a_sclk_sel, 15988c2ecf20Sopenharmony_ci &tdmin_b_sclk_sel, 15998c2ecf20Sopenharmony_ci &tdmin_c_sclk_sel, 16008c2ecf20Sopenharmony_ci &tdmin_lb_sclk_sel, 16018c2ecf20Sopenharmony_ci &tdmout_a_sclk_sel, 16028c2ecf20Sopenharmony_ci &tdmout_b_sclk_sel, 16038c2ecf20Sopenharmony_ci &tdmout_c_sclk_sel, 16048c2ecf20Sopenharmony_ci &tdmin_a_sclk_pre_en, 16058c2ecf20Sopenharmony_ci &tdmin_b_sclk_pre_en, 16068c2ecf20Sopenharmony_ci &tdmin_c_sclk_pre_en, 16078c2ecf20Sopenharmony_ci &tdmin_lb_sclk_pre_en, 16088c2ecf20Sopenharmony_ci &tdmout_a_sclk_pre_en, 16098c2ecf20Sopenharmony_ci &tdmout_b_sclk_pre_en, 16108c2ecf20Sopenharmony_ci &tdmout_c_sclk_pre_en, 16118c2ecf20Sopenharmony_ci &tdmin_a_sclk_post_en, 16128c2ecf20Sopenharmony_ci &tdmin_b_sclk_post_en, 16138c2ecf20Sopenharmony_ci &tdmin_c_sclk_post_en, 16148c2ecf20Sopenharmony_ci &tdmin_lb_sclk_post_en, 16158c2ecf20Sopenharmony_ci &tdmout_a_sclk_post_en, 16168c2ecf20Sopenharmony_ci &tdmout_b_sclk_post_en, 16178c2ecf20Sopenharmony_ci &tdmout_c_sclk_post_en, 16188c2ecf20Sopenharmony_ci &tdmin_a_sclk, 16198c2ecf20Sopenharmony_ci &tdmin_b_sclk, 16208c2ecf20Sopenharmony_ci &tdmin_c_sclk, 16218c2ecf20Sopenharmony_ci &tdmin_lb_sclk, 16228c2ecf20Sopenharmony_ci &g12a_tdmout_a_sclk, 16238c2ecf20Sopenharmony_ci &g12a_tdmout_b_sclk, 16248c2ecf20Sopenharmony_ci &g12a_tdmout_c_sclk, 16258c2ecf20Sopenharmony_ci &tdmin_a_lrclk, 16268c2ecf20Sopenharmony_ci &tdmin_b_lrclk, 16278c2ecf20Sopenharmony_ci &tdmin_c_lrclk, 16288c2ecf20Sopenharmony_ci &tdmin_lb_lrclk, 16298c2ecf20Sopenharmony_ci &tdmout_a_lrclk, 16308c2ecf20Sopenharmony_ci &tdmout_b_lrclk, 16318c2ecf20Sopenharmony_ci &tdmout_c_lrclk, 16328c2ecf20Sopenharmony_ci &spdifout_b_clk_sel, 16338c2ecf20Sopenharmony_ci &spdifout_b_clk_div, 16348c2ecf20Sopenharmony_ci &spdifout_b_clk, 16358c2ecf20Sopenharmony_ci &sm1_tdm_mclk_pad_0, 16368c2ecf20Sopenharmony_ci &sm1_tdm_mclk_pad_1, 16378c2ecf20Sopenharmony_ci &sm1_tdm_lrclk_pad_0, 16388c2ecf20Sopenharmony_ci &sm1_tdm_lrclk_pad_1, 16398c2ecf20Sopenharmony_ci &sm1_tdm_lrclk_pad_2, 16408c2ecf20Sopenharmony_ci &sm1_tdm_sclk_pad_0, 16418c2ecf20Sopenharmony_ci &sm1_tdm_sclk_pad_1, 16428c2ecf20Sopenharmony_ci &sm1_tdm_sclk_pad_2, 16438c2ecf20Sopenharmony_ci &sm1_aud_top, 16448c2ecf20Sopenharmony_ci &toram, 16458c2ecf20Sopenharmony_ci &eqdrc, 16468c2ecf20Sopenharmony_ci &resample_b, 16478c2ecf20Sopenharmony_ci &tovad, 16488c2ecf20Sopenharmony_ci &locker, 16498c2ecf20Sopenharmony_ci &spdifin_lb, 16508c2ecf20Sopenharmony_ci &frddr_d, 16518c2ecf20Sopenharmony_ci &toddr_d, 16528c2ecf20Sopenharmony_ci &loopback_b, 16538c2ecf20Sopenharmony_ci &sm1_clk81_en, 16548c2ecf20Sopenharmony_ci &sm1_sysclk_a_div, 16558c2ecf20Sopenharmony_ci &sm1_sysclk_a_en, 16568c2ecf20Sopenharmony_ci &sm1_sysclk_b_div, 16578c2ecf20Sopenharmony_ci &sm1_sysclk_b_en, 16588c2ecf20Sopenharmony_ci}; 16598c2ecf20Sopenharmony_ci 16608c2ecf20Sopenharmony_cistatic int devm_clk_get_enable(struct device *dev, char *id) 16618c2ecf20Sopenharmony_ci{ 16628c2ecf20Sopenharmony_ci struct clk *clk; 16638c2ecf20Sopenharmony_ci int ret; 16648c2ecf20Sopenharmony_ci 16658c2ecf20Sopenharmony_ci clk = devm_clk_get(dev, id); 16668c2ecf20Sopenharmony_ci if (IS_ERR(clk)) { 16678c2ecf20Sopenharmony_ci ret = PTR_ERR(clk); 16688c2ecf20Sopenharmony_ci if (ret != -EPROBE_DEFER) 16698c2ecf20Sopenharmony_ci dev_err(dev, "failed to get %s", id); 16708c2ecf20Sopenharmony_ci return ret; 16718c2ecf20Sopenharmony_ci } 16728c2ecf20Sopenharmony_ci 16738c2ecf20Sopenharmony_ci ret = clk_prepare_enable(clk); 16748c2ecf20Sopenharmony_ci if (ret) { 16758c2ecf20Sopenharmony_ci dev_err(dev, "failed to enable %s", id); 16768c2ecf20Sopenharmony_ci return ret; 16778c2ecf20Sopenharmony_ci } 16788c2ecf20Sopenharmony_ci 16798c2ecf20Sopenharmony_ci ret = devm_add_action_or_reset(dev, 16808c2ecf20Sopenharmony_ci (void(*)(void *))clk_disable_unprepare, 16818c2ecf20Sopenharmony_ci clk); 16828c2ecf20Sopenharmony_ci if (ret) { 16838c2ecf20Sopenharmony_ci dev_err(dev, "failed to add reset action on %s", id); 16848c2ecf20Sopenharmony_ci return ret; 16858c2ecf20Sopenharmony_ci } 16868c2ecf20Sopenharmony_ci 16878c2ecf20Sopenharmony_ci return 0; 16888c2ecf20Sopenharmony_ci} 16898c2ecf20Sopenharmony_ci 16908c2ecf20Sopenharmony_cistruct axg_audio_reset_data { 16918c2ecf20Sopenharmony_ci struct reset_controller_dev rstc; 16928c2ecf20Sopenharmony_ci struct regmap *map; 16938c2ecf20Sopenharmony_ci unsigned int offset; 16948c2ecf20Sopenharmony_ci}; 16958c2ecf20Sopenharmony_ci 16968c2ecf20Sopenharmony_cistatic void axg_audio_reset_reg_and_bit(struct axg_audio_reset_data *rst, 16978c2ecf20Sopenharmony_ci unsigned long id, 16988c2ecf20Sopenharmony_ci unsigned int *reg, 16998c2ecf20Sopenharmony_ci unsigned int *bit) 17008c2ecf20Sopenharmony_ci{ 17018c2ecf20Sopenharmony_ci unsigned int stride = regmap_get_reg_stride(rst->map); 17028c2ecf20Sopenharmony_ci 17038c2ecf20Sopenharmony_ci *reg = (id / (stride * BITS_PER_BYTE)) * stride; 17048c2ecf20Sopenharmony_ci *reg += rst->offset; 17058c2ecf20Sopenharmony_ci *bit = id % (stride * BITS_PER_BYTE); 17068c2ecf20Sopenharmony_ci} 17078c2ecf20Sopenharmony_ci 17088c2ecf20Sopenharmony_cistatic int axg_audio_reset_update(struct reset_controller_dev *rcdev, 17098c2ecf20Sopenharmony_ci unsigned long id, bool assert) 17108c2ecf20Sopenharmony_ci{ 17118c2ecf20Sopenharmony_ci struct axg_audio_reset_data *rst = 17128c2ecf20Sopenharmony_ci container_of(rcdev, struct axg_audio_reset_data, rstc); 17138c2ecf20Sopenharmony_ci unsigned int offset, bit; 17148c2ecf20Sopenharmony_ci 17158c2ecf20Sopenharmony_ci axg_audio_reset_reg_and_bit(rst, id, &offset, &bit); 17168c2ecf20Sopenharmony_ci 17178c2ecf20Sopenharmony_ci regmap_update_bits(rst->map, offset, BIT(bit), 17188c2ecf20Sopenharmony_ci assert ? BIT(bit) : 0); 17198c2ecf20Sopenharmony_ci 17208c2ecf20Sopenharmony_ci return 0; 17218c2ecf20Sopenharmony_ci} 17228c2ecf20Sopenharmony_ci 17238c2ecf20Sopenharmony_cistatic int axg_audio_reset_status(struct reset_controller_dev *rcdev, 17248c2ecf20Sopenharmony_ci unsigned long id) 17258c2ecf20Sopenharmony_ci{ 17268c2ecf20Sopenharmony_ci struct axg_audio_reset_data *rst = 17278c2ecf20Sopenharmony_ci container_of(rcdev, struct axg_audio_reset_data, rstc); 17288c2ecf20Sopenharmony_ci unsigned int val, offset, bit; 17298c2ecf20Sopenharmony_ci 17308c2ecf20Sopenharmony_ci axg_audio_reset_reg_and_bit(rst, id, &offset, &bit); 17318c2ecf20Sopenharmony_ci 17328c2ecf20Sopenharmony_ci regmap_read(rst->map, offset, &val); 17338c2ecf20Sopenharmony_ci 17348c2ecf20Sopenharmony_ci return !!(val & BIT(bit)); 17358c2ecf20Sopenharmony_ci} 17368c2ecf20Sopenharmony_ci 17378c2ecf20Sopenharmony_cistatic int axg_audio_reset_assert(struct reset_controller_dev *rcdev, 17388c2ecf20Sopenharmony_ci unsigned long id) 17398c2ecf20Sopenharmony_ci{ 17408c2ecf20Sopenharmony_ci return axg_audio_reset_update(rcdev, id, true); 17418c2ecf20Sopenharmony_ci} 17428c2ecf20Sopenharmony_ci 17438c2ecf20Sopenharmony_cistatic int axg_audio_reset_deassert(struct reset_controller_dev *rcdev, 17448c2ecf20Sopenharmony_ci unsigned long id) 17458c2ecf20Sopenharmony_ci{ 17468c2ecf20Sopenharmony_ci return axg_audio_reset_update(rcdev, id, false); 17478c2ecf20Sopenharmony_ci} 17488c2ecf20Sopenharmony_ci 17498c2ecf20Sopenharmony_cistatic int axg_audio_reset_toggle(struct reset_controller_dev *rcdev, 17508c2ecf20Sopenharmony_ci unsigned long id) 17518c2ecf20Sopenharmony_ci{ 17528c2ecf20Sopenharmony_ci int ret; 17538c2ecf20Sopenharmony_ci 17548c2ecf20Sopenharmony_ci ret = axg_audio_reset_assert(rcdev, id); 17558c2ecf20Sopenharmony_ci if (ret) 17568c2ecf20Sopenharmony_ci return ret; 17578c2ecf20Sopenharmony_ci 17588c2ecf20Sopenharmony_ci return axg_audio_reset_deassert(rcdev, id); 17598c2ecf20Sopenharmony_ci} 17608c2ecf20Sopenharmony_ci 17618c2ecf20Sopenharmony_cistatic const struct reset_control_ops axg_audio_rstc_ops = { 17628c2ecf20Sopenharmony_ci .assert = axg_audio_reset_assert, 17638c2ecf20Sopenharmony_ci .deassert = axg_audio_reset_deassert, 17648c2ecf20Sopenharmony_ci .reset = axg_audio_reset_toggle, 17658c2ecf20Sopenharmony_ci .status = axg_audio_reset_status, 17668c2ecf20Sopenharmony_ci}; 17678c2ecf20Sopenharmony_ci 17688c2ecf20Sopenharmony_cistatic const struct regmap_config axg_audio_regmap_cfg = { 17698c2ecf20Sopenharmony_ci .reg_bits = 32, 17708c2ecf20Sopenharmony_ci .val_bits = 32, 17718c2ecf20Sopenharmony_ci .reg_stride = 4, 17728c2ecf20Sopenharmony_ci .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL, 17738c2ecf20Sopenharmony_ci}; 17748c2ecf20Sopenharmony_ci 17758c2ecf20Sopenharmony_cistruct audioclk_data { 17768c2ecf20Sopenharmony_ci struct clk_regmap *const *regmap_clks; 17778c2ecf20Sopenharmony_ci unsigned int regmap_clk_num; 17788c2ecf20Sopenharmony_ci struct clk_hw_onecell_data *hw_onecell_data; 17798c2ecf20Sopenharmony_ci unsigned int reset_offset; 17808c2ecf20Sopenharmony_ci unsigned int reset_num; 17818c2ecf20Sopenharmony_ci}; 17828c2ecf20Sopenharmony_ci 17838c2ecf20Sopenharmony_cistatic int axg_audio_clkc_probe(struct platform_device *pdev) 17848c2ecf20Sopenharmony_ci{ 17858c2ecf20Sopenharmony_ci struct device *dev = &pdev->dev; 17868c2ecf20Sopenharmony_ci const struct audioclk_data *data; 17878c2ecf20Sopenharmony_ci struct axg_audio_reset_data *rst; 17888c2ecf20Sopenharmony_ci struct regmap *map; 17898c2ecf20Sopenharmony_ci void __iomem *regs; 17908c2ecf20Sopenharmony_ci struct clk_hw *hw; 17918c2ecf20Sopenharmony_ci int ret, i; 17928c2ecf20Sopenharmony_ci 17938c2ecf20Sopenharmony_ci data = of_device_get_match_data(dev); 17948c2ecf20Sopenharmony_ci if (!data) 17958c2ecf20Sopenharmony_ci return -EINVAL; 17968c2ecf20Sopenharmony_ci 17978c2ecf20Sopenharmony_ci regs = devm_platform_ioremap_resource(pdev, 0); 17988c2ecf20Sopenharmony_ci if (IS_ERR(regs)) 17998c2ecf20Sopenharmony_ci return PTR_ERR(regs); 18008c2ecf20Sopenharmony_ci 18018c2ecf20Sopenharmony_ci map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg); 18028c2ecf20Sopenharmony_ci if (IS_ERR(map)) { 18038c2ecf20Sopenharmony_ci dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map)); 18048c2ecf20Sopenharmony_ci return PTR_ERR(map); 18058c2ecf20Sopenharmony_ci } 18068c2ecf20Sopenharmony_ci 18078c2ecf20Sopenharmony_ci /* Get the mandatory peripheral clock */ 18088c2ecf20Sopenharmony_ci ret = devm_clk_get_enable(dev, "pclk"); 18098c2ecf20Sopenharmony_ci if (ret) 18108c2ecf20Sopenharmony_ci return ret; 18118c2ecf20Sopenharmony_ci 18128c2ecf20Sopenharmony_ci ret = device_reset(dev); 18138c2ecf20Sopenharmony_ci if (ret) { 18148c2ecf20Sopenharmony_ci dev_err(dev, "failed to reset device\n"); 18158c2ecf20Sopenharmony_ci return ret; 18168c2ecf20Sopenharmony_ci } 18178c2ecf20Sopenharmony_ci 18188c2ecf20Sopenharmony_ci /* Populate regmap for the regmap backed clocks */ 18198c2ecf20Sopenharmony_ci for (i = 0; i < data->regmap_clk_num; i++) 18208c2ecf20Sopenharmony_ci data->regmap_clks[i]->map = map; 18218c2ecf20Sopenharmony_ci 18228c2ecf20Sopenharmony_ci /* Take care to skip the registered input clocks */ 18238c2ecf20Sopenharmony_ci for (i = AUD_CLKID_DDR_ARB; i < data->hw_onecell_data->num; i++) { 18248c2ecf20Sopenharmony_ci const char *name; 18258c2ecf20Sopenharmony_ci 18268c2ecf20Sopenharmony_ci hw = data->hw_onecell_data->hws[i]; 18278c2ecf20Sopenharmony_ci /* array might be sparse */ 18288c2ecf20Sopenharmony_ci if (!hw) 18298c2ecf20Sopenharmony_ci continue; 18308c2ecf20Sopenharmony_ci 18318c2ecf20Sopenharmony_ci name = hw->init->name; 18328c2ecf20Sopenharmony_ci 18338c2ecf20Sopenharmony_ci ret = devm_clk_hw_register(dev, hw); 18348c2ecf20Sopenharmony_ci if (ret) { 18358c2ecf20Sopenharmony_ci dev_err(dev, "failed to register clock %s\n", name); 18368c2ecf20Sopenharmony_ci return ret; 18378c2ecf20Sopenharmony_ci } 18388c2ecf20Sopenharmony_ci } 18398c2ecf20Sopenharmony_ci 18408c2ecf20Sopenharmony_ci ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, 18418c2ecf20Sopenharmony_ci data->hw_onecell_data); 18428c2ecf20Sopenharmony_ci if (ret) 18438c2ecf20Sopenharmony_ci return ret; 18448c2ecf20Sopenharmony_ci 18458c2ecf20Sopenharmony_ci /* Stop here if there is no reset */ 18468c2ecf20Sopenharmony_ci if (!data->reset_num) 18478c2ecf20Sopenharmony_ci return 0; 18488c2ecf20Sopenharmony_ci 18498c2ecf20Sopenharmony_ci rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL); 18508c2ecf20Sopenharmony_ci if (!rst) 18518c2ecf20Sopenharmony_ci return -ENOMEM; 18528c2ecf20Sopenharmony_ci 18538c2ecf20Sopenharmony_ci rst->map = map; 18548c2ecf20Sopenharmony_ci rst->offset = data->reset_offset; 18558c2ecf20Sopenharmony_ci rst->rstc.nr_resets = data->reset_num; 18568c2ecf20Sopenharmony_ci rst->rstc.ops = &axg_audio_rstc_ops; 18578c2ecf20Sopenharmony_ci rst->rstc.of_node = dev->of_node; 18588c2ecf20Sopenharmony_ci rst->rstc.owner = THIS_MODULE; 18598c2ecf20Sopenharmony_ci 18608c2ecf20Sopenharmony_ci return devm_reset_controller_register(dev, &rst->rstc); 18618c2ecf20Sopenharmony_ci} 18628c2ecf20Sopenharmony_ci 18638c2ecf20Sopenharmony_cistatic const struct audioclk_data axg_audioclk_data = { 18648c2ecf20Sopenharmony_ci .regmap_clks = axg_clk_regmaps, 18658c2ecf20Sopenharmony_ci .regmap_clk_num = ARRAY_SIZE(axg_clk_regmaps), 18668c2ecf20Sopenharmony_ci .hw_onecell_data = &axg_audio_hw_onecell_data, 18678c2ecf20Sopenharmony_ci}; 18688c2ecf20Sopenharmony_ci 18698c2ecf20Sopenharmony_cistatic const struct audioclk_data g12a_audioclk_data = { 18708c2ecf20Sopenharmony_ci .regmap_clks = g12a_clk_regmaps, 18718c2ecf20Sopenharmony_ci .regmap_clk_num = ARRAY_SIZE(g12a_clk_regmaps), 18728c2ecf20Sopenharmony_ci .hw_onecell_data = &g12a_audio_hw_onecell_data, 18738c2ecf20Sopenharmony_ci .reset_offset = AUDIO_SW_RESET, 18748c2ecf20Sopenharmony_ci .reset_num = 26, 18758c2ecf20Sopenharmony_ci}; 18768c2ecf20Sopenharmony_ci 18778c2ecf20Sopenharmony_cistatic const struct audioclk_data sm1_audioclk_data = { 18788c2ecf20Sopenharmony_ci .regmap_clks = sm1_clk_regmaps, 18798c2ecf20Sopenharmony_ci .regmap_clk_num = ARRAY_SIZE(sm1_clk_regmaps), 18808c2ecf20Sopenharmony_ci .hw_onecell_data = &sm1_audio_hw_onecell_data, 18818c2ecf20Sopenharmony_ci .reset_offset = AUDIO_SM1_SW_RESET0, 18828c2ecf20Sopenharmony_ci .reset_num = 39, 18838c2ecf20Sopenharmony_ci}; 18848c2ecf20Sopenharmony_ci 18858c2ecf20Sopenharmony_cistatic const struct of_device_id clkc_match_table[] = { 18868c2ecf20Sopenharmony_ci { 18878c2ecf20Sopenharmony_ci .compatible = "amlogic,axg-audio-clkc", 18888c2ecf20Sopenharmony_ci .data = &axg_audioclk_data 18898c2ecf20Sopenharmony_ci }, { 18908c2ecf20Sopenharmony_ci .compatible = "amlogic,g12a-audio-clkc", 18918c2ecf20Sopenharmony_ci .data = &g12a_audioclk_data 18928c2ecf20Sopenharmony_ci }, { 18938c2ecf20Sopenharmony_ci .compatible = "amlogic,sm1-audio-clkc", 18948c2ecf20Sopenharmony_ci .data = &sm1_audioclk_data 18958c2ecf20Sopenharmony_ci }, {} 18968c2ecf20Sopenharmony_ci}; 18978c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(of, clkc_match_table); 18988c2ecf20Sopenharmony_ci 18998c2ecf20Sopenharmony_cistatic struct platform_driver axg_audio_driver = { 19008c2ecf20Sopenharmony_ci .probe = axg_audio_clkc_probe, 19018c2ecf20Sopenharmony_ci .driver = { 19028c2ecf20Sopenharmony_ci .name = "axg-audio-clkc", 19038c2ecf20Sopenharmony_ci .of_match_table = clkc_match_table, 19048c2ecf20Sopenharmony_ci }, 19058c2ecf20Sopenharmony_ci}; 19068c2ecf20Sopenharmony_cimodule_platform_driver(axg_audio_driver); 19078c2ecf20Sopenharmony_ci 19088c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Amlogic AXG/G12A/SM1 Audio Clock driver"); 19098c2ecf20Sopenharmony_ciMODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>"); 19108c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2"); 1911