18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0+ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Amlogic Meson-AXG Clock Controller Driver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2016 Baylibre SAS. 68c2ecf20Sopenharmony_ci * Author: Michael Turquette <mturquette@baylibre.com> 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Copyright (c) 2018 Amlogic, inc. 98c2ecf20Sopenharmony_ci * Author: Qiufang Dai <qiufang.dai@amlogic.com> 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci#include <linux/clk-provider.h> 128c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 138c2ecf20Sopenharmony_ci#include <linux/reset-controller.h> 148c2ecf20Sopenharmony_ci#include <linux/mfd/syscon.h> 158c2ecf20Sopenharmony_ci#include "meson-aoclk.h" 168c2ecf20Sopenharmony_ci#include "axg-aoclk.h" 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#include "clk-regmap.h" 198c2ecf20Sopenharmony_ci#include "clk-dualdiv.h" 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/* 228c2ecf20Sopenharmony_ci * AO Configuration Clock registers offsets 238c2ecf20Sopenharmony_ci * Register offsets from the data sheet must be multiplied by 4. 248c2ecf20Sopenharmony_ci */ 258c2ecf20Sopenharmony_ci#define AO_RTI_PWR_CNTL_REG1 0x0C 268c2ecf20Sopenharmony_ci#define AO_RTI_PWR_CNTL_REG0 0x10 278c2ecf20Sopenharmony_ci#define AO_RTI_GEN_CNTL_REG0 0x40 288c2ecf20Sopenharmony_ci#define AO_OSCIN_CNTL 0x58 298c2ecf20Sopenharmony_ci#define AO_CRT_CLK_CNTL1 0x68 308c2ecf20Sopenharmony_ci#define AO_SAR_CLK 0x90 318c2ecf20Sopenharmony_ci#define AO_RTC_ALT_CLK_CNTL0 0x94 328c2ecf20Sopenharmony_ci#define AO_RTC_ALT_CLK_CNTL1 0x98 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#define AXG_AO_GATE(_name, _bit) \ 358c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_##_name = { \ 368c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data) { \ 378c2ecf20Sopenharmony_ci .offset = (AO_RTI_GEN_CNTL_REG0), \ 388c2ecf20Sopenharmony_ci .bit_idx = (_bit), \ 398c2ecf20Sopenharmony_ci }, \ 408c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data) { \ 418c2ecf20Sopenharmony_ci .name = "axg_ao_" #_name, \ 428c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, \ 438c2ecf20Sopenharmony_ci .parent_data = &(const struct clk_parent_data) { \ 448c2ecf20Sopenharmony_ci .fw_name = "mpeg-clk", \ 458c2ecf20Sopenharmony_ci }, \ 468c2ecf20Sopenharmony_ci .num_parents = 1, \ 478c2ecf20Sopenharmony_ci .flags = CLK_IGNORE_UNUSED, \ 488c2ecf20Sopenharmony_ci }, \ 498c2ecf20Sopenharmony_ci} 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ciAXG_AO_GATE(remote, 0); 528c2ecf20Sopenharmony_ciAXG_AO_GATE(i2c_master, 1); 538c2ecf20Sopenharmony_ciAXG_AO_GATE(i2c_slave, 2); 548c2ecf20Sopenharmony_ciAXG_AO_GATE(uart1, 3); 558c2ecf20Sopenharmony_ciAXG_AO_GATE(uart2, 5); 568c2ecf20Sopenharmony_ciAXG_AO_GATE(ir_blaster, 6); 578c2ecf20Sopenharmony_ciAXG_AO_GATE(saradc, 7); 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_cts_oscin = { 608c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data){ 618c2ecf20Sopenharmony_ci .offset = AO_RTI_PWR_CNTL_REG0, 628c2ecf20Sopenharmony_ci .bit_idx = 14, 638c2ecf20Sopenharmony_ci }, 648c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 658c2ecf20Sopenharmony_ci .name = "cts_oscin", 668c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ro_ops, 678c2ecf20Sopenharmony_ci .parent_data = &(const struct clk_parent_data) { 688c2ecf20Sopenharmony_ci .fw_name = "xtal", 698c2ecf20Sopenharmony_ci }, 708c2ecf20Sopenharmony_ci .num_parents = 1, 718c2ecf20Sopenharmony_ci }, 728c2ecf20Sopenharmony_ci}; 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_32k_pre = { 758c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data){ 768c2ecf20Sopenharmony_ci .offset = AO_RTC_ALT_CLK_CNTL0, 778c2ecf20Sopenharmony_ci .bit_idx = 31, 788c2ecf20Sopenharmony_ci }, 798c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 808c2ecf20Sopenharmony_ci .name = "axg_ao_32k_pre", 818c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, 828c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 838c2ecf20Sopenharmony_ci &axg_aoclk_cts_oscin.hw 848c2ecf20Sopenharmony_ci }, 858c2ecf20Sopenharmony_ci .num_parents = 1, 868c2ecf20Sopenharmony_ci }, 878c2ecf20Sopenharmony_ci}; 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_cistatic const struct meson_clk_dualdiv_param axg_32k_div_table[] = { 908c2ecf20Sopenharmony_ci { 918c2ecf20Sopenharmony_ci .dual = 1, 928c2ecf20Sopenharmony_ci .n1 = 733, 938c2ecf20Sopenharmony_ci .m1 = 8, 948c2ecf20Sopenharmony_ci .n2 = 732, 958c2ecf20Sopenharmony_ci .m2 = 11, 968c2ecf20Sopenharmony_ci }, {} 978c2ecf20Sopenharmony_ci}; 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_32k_div = { 1008c2ecf20Sopenharmony_ci .data = &(struct meson_clk_dualdiv_data){ 1018c2ecf20Sopenharmony_ci .n1 = { 1028c2ecf20Sopenharmony_ci .reg_off = AO_RTC_ALT_CLK_CNTL0, 1038c2ecf20Sopenharmony_ci .shift = 0, 1048c2ecf20Sopenharmony_ci .width = 12, 1058c2ecf20Sopenharmony_ci }, 1068c2ecf20Sopenharmony_ci .n2 = { 1078c2ecf20Sopenharmony_ci .reg_off = AO_RTC_ALT_CLK_CNTL0, 1088c2ecf20Sopenharmony_ci .shift = 12, 1098c2ecf20Sopenharmony_ci .width = 12, 1108c2ecf20Sopenharmony_ci }, 1118c2ecf20Sopenharmony_ci .m1 = { 1128c2ecf20Sopenharmony_ci .reg_off = AO_RTC_ALT_CLK_CNTL1, 1138c2ecf20Sopenharmony_ci .shift = 0, 1148c2ecf20Sopenharmony_ci .width = 12, 1158c2ecf20Sopenharmony_ci }, 1168c2ecf20Sopenharmony_ci .m2 = { 1178c2ecf20Sopenharmony_ci .reg_off = AO_RTC_ALT_CLK_CNTL1, 1188c2ecf20Sopenharmony_ci .shift = 12, 1198c2ecf20Sopenharmony_ci .width = 12, 1208c2ecf20Sopenharmony_ci }, 1218c2ecf20Sopenharmony_ci .dual = { 1228c2ecf20Sopenharmony_ci .reg_off = AO_RTC_ALT_CLK_CNTL0, 1238c2ecf20Sopenharmony_ci .shift = 28, 1248c2ecf20Sopenharmony_ci .width = 1, 1258c2ecf20Sopenharmony_ci }, 1268c2ecf20Sopenharmony_ci .table = axg_32k_div_table, 1278c2ecf20Sopenharmony_ci }, 1288c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 1298c2ecf20Sopenharmony_ci .name = "axg_ao_32k_div", 1308c2ecf20Sopenharmony_ci .ops = &meson_clk_dualdiv_ops, 1318c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 1328c2ecf20Sopenharmony_ci &axg_aoclk_32k_pre.hw 1338c2ecf20Sopenharmony_ci }, 1348c2ecf20Sopenharmony_ci .num_parents = 1, 1358c2ecf20Sopenharmony_ci }, 1368c2ecf20Sopenharmony_ci}; 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_32k_sel = { 1398c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_mux_data) { 1408c2ecf20Sopenharmony_ci .offset = AO_RTC_ALT_CLK_CNTL1, 1418c2ecf20Sopenharmony_ci .mask = 0x1, 1428c2ecf20Sopenharmony_ci .shift = 24, 1438c2ecf20Sopenharmony_ci .flags = CLK_MUX_ROUND_CLOSEST, 1448c2ecf20Sopenharmony_ci }, 1458c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 1468c2ecf20Sopenharmony_ci .name = "axg_ao_32k_sel", 1478c2ecf20Sopenharmony_ci .ops = &clk_regmap_mux_ops, 1488c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 1498c2ecf20Sopenharmony_ci &axg_aoclk_32k_div.hw, 1508c2ecf20Sopenharmony_ci &axg_aoclk_32k_pre.hw, 1518c2ecf20Sopenharmony_ci }, 1528c2ecf20Sopenharmony_ci .num_parents = 2, 1538c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 1548c2ecf20Sopenharmony_ci }, 1558c2ecf20Sopenharmony_ci}; 1568c2ecf20Sopenharmony_ci 1578c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_32k = { 1588c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data){ 1598c2ecf20Sopenharmony_ci .offset = AO_RTC_ALT_CLK_CNTL0, 1608c2ecf20Sopenharmony_ci .bit_idx = 30, 1618c2ecf20Sopenharmony_ci }, 1628c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 1638c2ecf20Sopenharmony_ci .name = "axg_ao_32k", 1648c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, 1658c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 1668c2ecf20Sopenharmony_ci &axg_aoclk_32k_sel.hw 1678c2ecf20Sopenharmony_ci }, 1688c2ecf20Sopenharmony_ci .num_parents = 1, 1698c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 1708c2ecf20Sopenharmony_ci }, 1718c2ecf20Sopenharmony_ci}; 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_cts_rtc_oscin = { 1748c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_mux_data) { 1758c2ecf20Sopenharmony_ci .offset = AO_RTI_PWR_CNTL_REG0, 1768c2ecf20Sopenharmony_ci .mask = 0x1, 1778c2ecf20Sopenharmony_ci .shift = 10, 1788c2ecf20Sopenharmony_ci .flags = CLK_MUX_ROUND_CLOSEST, 1798c2ecf20Sopenharmony_ci }, 1808c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 1818c2ecf20Sopenharmony_ci .name = "axg_ao_cts_rtc_oscin", 1828c2ecf20Sopenharmony_ci .ops = &clk_regmap_mux_ops, 1838c2ecf20Sopenharmony_ci .parent_data = (const struct clk_parent_data []) { 1848c2ecf20Sopenharmony_ci { .hw = &axg_aoclk_32k.hw }, 1858c2ecf20Sopenharmony_ci { .fw_name = "ext_32k-0", }, 1868c2ecf20Sopenharmony_ci }, 1878c2ecf20Sopenharmony_ci .num_parents = 2, 1888c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 1898c2ecf20Sopenharmony_ci }, 1908c2ecf20Sopenharmony_ci}; 1918c2ecf20Sopenharmony_ci 1928c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_clk81 = { 1938c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_mux_data) { 1948c2ecf20Sopenharmony_ci .offset = AO_RTI_PWR_CNTL_REG0, 1958c2ecf20Sopenharmony_ci .mask = 0x1, 1968c2ecf20Sopenharmony_ci .shift = 8, 1978c2ecf20Sopenharmony_ci .flags = CLK_MUX_ROUND_CLOSEST, 1988c2ecf20Sopenharmony_ci }, 1998c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 2008c2ecf20Sopenharmony_ci .name = "axg_ao_clk81", 2018c2ecf20Sopenharmony_ci .ops = &clk_regmap_mux_ro_ops, 2028c2ecf20Sopenharmony_ci .parent_data = (const struct clk_parent_data []) { 2038c2ecf20Sopenharmony_ci { .fw_name = "mpeg-clk", }, 2048c2ecf20Sopenharmony_ci { .hw = &axg_aoclk_cts_rtc_oscin.hw }, 2058c2ecf20Sopenharmony_ci }, 2068c2ecf20Sopenharmony_ci .num_parents = 2, 2078c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 2088c2ecf20Sopenharmony_ci }, 2098c2ecf20Sopenharmony_ci}; 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_saradc_mux = { 2128c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_mux_data) { 2138c2ecf20Sopenharmony_ci .offset = AO_SAR_CLK, 2148c2ecf20Sopenharmony_ci .mask = 0x3, 2158c2ecf20Sopenharmony_ci .shift = 9, 2168c2ecf20Sopenharmony_ci }, 2178c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 2188c2ecf20Sopenharmony_ci .name = "axg_ao_saradc_mux", 2198c2ecf20Sopenharmony_ci .ops = &clk_regmap_mux_ops, 2208c2ecf20Sopenharmony_ci .parent_data = (const struct clk_parent_data []) { 2218c2ecf20Sopenharmony_ci { .fw_name = "xtal", }, 2228c2ecf20Sopenharmony_ci { .hw = &axg_aoclk_clk81.hw }, 2238c2ecf20Sopenharmony_ci }, 2248c2ecf20Sopenharmony_ci .num_parents = 2, 2258c2ecf20Sopenharmony_ci }, 2268c2ecf20Sopenharmony_ci}; 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_saradc_div = { 2298c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_div_data) { 2308c2ecf20Sopenharmony_ci .offset = AO_SAR_CLK, 2318c2ecf20Sopenharmony_ci .shift = 0, 2328c2ecf20Sopenharmony_ci .width = 8, 2338c2ecf20Sopenharmony_ci }, 2348c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 2358c2ecf20Sopenharmony_ci .name = "axg_ao_saradc_div", 2368c2ecf20Sopenharmony_ci .ops = &clk_regmap_divider_ops, 2378c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 2388c2ecf20Sopenharmony_ci &axg_aoclk_saradc_mux.hw 2398c2ecf20Sopenharmony_ci }, 2408c2ecf20Sopenharmony_ci .num_parents = 1, 2418c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 2428c2ecf20Sopenharmony_ci }, 2438c2ecf20Sopenharmony_ci}; 2448c2ecf20Sopenharmony_ci 2458c2ecf20Sopenharmony_cistatic struct clk_regmap axg_aoclk_saradc_gate = { 2468c2ecf20Sopenharmony_ci .data = &(struct clk_regmap_gate_data) { 2478c2ecf20Sopenharmony_ci .offset = AO_SAR_CLK, 2488c2ecf20Sopenharmony_ci .bit_idx = 8, 2498c2ecf20Sopenharmony_ci }, 2508c2ecf20Sopenharmony_ci .hw.init = &(struct clk_init_data){ 2518c2ecf20Sopenharmony_ci .name = "axg_ao_saradc_gate", 2528c2ecf20Sopenharmony_ci .ops = &clk_regmap_gate_ops, 2538c2ecf20Sopenharmony_ci .parent_hws = (const struct clk_hw *[]) { 2548c2ecf20Sopenharmony_ci &axg_aoclk_saradc_div.hw 2558c2ecf20Sopenharmony_ci }, 2568c2ecf20Sopenharmony_ci .num_parents = 1, 2578c2ecf20Sopenharmony_ci .flags = CLK_SET_RATE_PARENT, 2588c2ecf20Sopenharmony_ci }, 2598c2ecf20Sopenharmony_ci}; 2608c2ecf20Sopenharmony_ci 2618c2ecf20Sopenharmony_cistatic const unsigned int axg_aoclk_reset[] = { 2628c2ecf20Sopenharmony_ci [RESET_AO_REMOTE] = 16, 2638c2ecf20Sopenharmony_ci [RESET_AO_I2C_MASTER] = 18, 2648c2ecf20Sopenharmony_ci [RESET_AO_I2C_SLAVE] = 19, 2658c2ecf20Sopenharmony_ci [RESET_AO_UART1] = 17, 2668c2ecf20Sopenharmony_ci [RESET_AO_UART2] = 22, 2678c2ecf20Sopenharmony_ci [RESET_AO_IR_BLASTER] = 23, 2688c2ecf20Sopenharmony_ci}; 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_cistatic struct clk_regmap *axg_aoclk_regmap[] = { 2718c2ecf20Sopenharmony_ci &axg_aoclk_remote, 2728c2ecf20Sopenharmony_ci &axg_aoclk_i2c_master, 2738c2ecf20Sopenharmony_ci &axg_aoclk_i2c_slave, 2748c2ecf20Sopenharmony_ci &axg_aoclk_uart1, 2758c2ecf20Sopenharmony_ci &axg_aoclk_uart2, 2768c2ecf20Sopenharmony_ci &axg_aoclk_ir_blaster, 2778c2ecf20Sopenharmony_ci &axg_aoclk_saradc, 2788c2ecf20Sopenharmony_ci &axg_aoclk_cts_oscin, 2798c2ecf20Sopenharmony_ci &axg_aoclk_32k_pre, 2808c2ecf20Sopenharmony_ci &axg_aoclk_32k_div, 2818c2ecf20Sopenharmony_ci &axg_aoclk_32k_sel, 2828c2ecf20Sopenharmony_ci &axg_aoclk_32k, 2838c2ecf20Sopenharmony_ci &axg_aoclk_cts_rtc_oscin, 2848c2ecf20Sopenharmony_ci &axg_aoclk_clk81, 2858c2ecf20Sopenharmony_ci &axg_aoclk_saradc_mux, 2868c2ecf20Sopenharmony_ci &axg_aoclk_saradc_div, 2878c2ecf20Sopenharmony_ci &axg_aoclk_saradc_gate, 2888c2ecf20Sopenharmony_ci}; 2898c2ecf20Sopenharmony_ci 2908c2ecf20Sopenharmony_cistatic const struct clk_hw_onecell_data axg_aoclk_onecell_data = { 2918c2ecf20Sopenharmony_ci .hws = { 2928c2ecf20Sopenharmony_ci [CLKID_AO_REMOTE] = &axg_aoclk_remote.hw, 2938c2ecf20Sopenharmony_ci [CLKID_AO_I2C_MASTER] = &axg_aoclk_i2c_master.hw, 2948c2ecf20Sopenharmony_ci [CLKID_AO_I2C_SLAVE] = &axg_aoclk_i2c_slave.hw, 2958c2ecf20Sopenharmony_ci [CLKID_AO_UART1] = &axg_aoclk_uart1.hw, 2968c2ecf20Sopenharmony_ci [CLKID_AO_UART2] = &axg_aoclk_uart2.hw, 2978c2ecf20Sopenharmony_ci [CLKID_AO_IR_BLASTER] = &axg_aoclk_ir_blaster.hw, 2988c2ecf20Sopenharmony_ci [CLKID_AO_SAR_ADC] = &axg_aoclk_saradc.hw, 2998c2ecf20Sopenharmony_ci [CLKID_AO_CLK81] = &axg_aoclk_clk81.hw, 3008c2ecf20Sopenharmony_ci [CLKID_AO_SAR_ADC_SEL] = &axg_aoclk_saradc_mux.hw, 3018c2ecf20Sopenharmony_ci [CLKID_AO_SAR_ADC_DIV] = &axg_aoclk_saradc_div.hw, 3028c2ecf20Sopenharmony_ci [CLKID_AO_SAR_ADC_CLK] = &axg_aoclk_saradc_gate.hw, 3038c2ecf20Sopenharmony_ci [CLKID_AO_CTS_OSCIN] = &axg_aoclk_cts_oscin.hw, 3048c2ecf20Sopenharmony_ci [CLKID_AO_32K_PRE] = &axg_aoclk_32k_pre.hw, 3058c2ecf20Sopenharmony_ci [CLKID_AO_32K_DIV] = &axg_aoclk_32k_div.hw, 3068c2ecf20Sopenharmony_ci [CLKID_AO_32K_SEL] = &axg_aoclk_32k_sel.hw, 3078c2ecf20Sopenharmony_ci [CLKID_AO_32K] = &axg_aoclk_32k.hw, 3088c2ecf20Sopenharmony_ci [CLKID_AO_CTS_RTC_OSCIN] = &axg_aoclk_cts_rtc_oscin.hw, 3098c2ecf20Sopenharmony_ci }, 3108c2ecf20Sopenharmony_ci .num = NR_CLKS, 3118c2ecf20Sopenharmony_ci}; 3128c2ecf20Sopenharmony_ci 3138c2ecf20Sopenharmony_cistatic const struct meson_aoclk_data axg_aoclkc_data = { 3148c2ecf20Sopenharmony_ci .reset_reg = AO_RTI_GEN_CNTL_REG0, 3158c2ecf20Sopenharmony_ci .num_reset = ARRAY_SIZE(axg_aoclk_reset), 3168c2ecf20Sopenharmony_ci .reset = axg_aoclk_reset, 3178c2ecf20Sopenharmony_ci .num_clks = ARRAY_SIZE(axg_aoclk_regmap), 3188c2ecf20Sopenharmony_ci .clks = axg_aoclk_regmap, 3198c2ecf20Sopenharmony_ci .hw_data = &axg_aoclk_onecell_data, 3208c2ecf20Sopenharmony_ci}; 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_cistatic const struct of_device_id axg_aoclkc_match_table[] = { 3238c2ecf20Sopenharmony_ci { 3248c2ecf20Sopenharmony_ci .compatible = "amlogic,meson-axg-aoclkc", 3258c2ecf20Sopenharmony_ci .data = &axg_aoclkc_data, 3268c2ecf20Sopenharmony_ci }, 3278c2ecf20Sopenharmony_ci { } 3288c2ecf20Sopenharmony_ci}; 3298c2ecf20Sopenharmony_ci 3308c2ecf20Sopenharmony_cistatic struct platform_driver axg_aoclkc_driver = { 3318c2ecf20Sopenharmony_ci .probe = meson_aoclkc_probe, 3328c2ecf20Sopenharmony_ci .driver = { 3338c2ecf20Sopenharmony_ci .name = "axg-aoclkc", 3348c2ecf20Sopenharmony_ci .of_match_table = axg_aoclkc_match_table, 3358c2ecf20Sopenharmony_ci }, 3368c2ecf20Sopenharmony_ci}; 3378c2ecf20Sopenharmony_ci 3388c2ecf20Sopenharmony_cibuiltin_platform_driver(axg_aoclkc_driver); 339