Lines Matching +full:pdm +full:- +full:clk +full:- +full:map

1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
7 #include <linux/clk.h>
8 #include <linux/clk-provider.h>
15 #include <linux/reset-controller.h>
18 #include "meson-clkc-utils.h"
19 #include "axg-audio.h"
20 #include "clk-regmap.h"
21 #include "clk-phase.h"
22 #include "sclk-div.h"
24 #include <dt-bindings/clock/axg-audio-clkc.h>
232 { .name = "aud_mst_a_sclk", .index = -1, },
233 { .name = "aud_mst_b_sclk", .index = -1, },
234 { .name = "aud_mst_c_sclk", .index = -1, },
235 { .name = "aud_mst_d_sclk", .index = -1, },
236 { .name = "aud_mst_e_sclk", .index = -1, },
237 { .name = "aud_mst_f_sclk", .index = -1, },
252 { .name = "aud_mst_a_lrclk", .index = -1, },
253 { .name = "aud_mst_b_lrclk", .index = -1, },
254 { .name = "aud_mst_c_lrclk", .index = -1, },
255 { .name = "aud_mst_d_lrclk", .index = -1, },
256 { .name = "aud_mst_e_lrclk", .index = -1, },
257 { .name = "aud_mst_f_lrclk", .index = -1, },
294 { .name = "aud_mst_a_mclk", .index = -1, },
295 { .name = "aud_mst_b_mclk", .index = -1, },
296 { .name = "aud_mst_c_mclk", .index = -1, },
297 { .name = "aud_mst_d_mclk", .index = -1, },
298 { .name = "aud_mst_e_mclk", .index = -1, },
299 { .name = "aud_mst_f_mclk", .index = -1, },
304 { .name = "aud_mst_a_sclk", .index = -1, },
305 { .name = "aud_mst_b_sclk", .index = -1, },
306 { .name = "aud_mst_c_sclk", .index = -1, },
307 { .name = "aud_mst_d_sclk", .index = -1, },
308 { .name = "aud_mst_e_sclk", .index = -1, },
309 { .name = "aud_mst_f_sclk", .index = -1, },
314 { .name = "aud_mst_a_lrclk", .index = -1, },
315 { .name = "aud_mst_b_lrclk", .index = -1, },
316 { .name = "aud_mst_c_lrclk", .index = -1, },
317 { .name = "aud_mst_d_lrclk", .index = -1, },
318 { .name = "aud_mst_e_lrclk", .index = -1, },
319 { .name = "aud_mst_f_lrclk", .index = -1, },
329 static struct clk_regmap pdm = variable
330 AUD_PCLK_GATE(pdm, AUDIO_CLK_GATE_EN, 1);
835 [AUD_CLKID_PDM] = &pdm.hw,
964 [AUD_CLKID_PDM] = &pdm.hw,
1105 [AUD_CLKID_PDM] = &pdm.hw,
1264 &pdm,
1388 &pdm,
1526 &pdm,
1683 struct regmap *map; member
1692 unsigned int stride = regmap_get_reg_stride(rst->map); in axg_audio_reset_reg_and_bit()
1695 *reg += rst->offset; in axg_audio_reset_reg_and_bit()
1708 regmap_update_bits(rst->map, offset, BIT(bit), in axg_audio_reset_update()
1723 regmap_read(rst->map, offset, &val); in axg_audio_reset_status()
1776 struct device *dev = &pdev->dev; in axg_audio_clkc_probe()
1779 struct regmap *map; in axg_audio_clkc_probe() local
1782 struct clk *clk; in axg_audio_clkc_probe() local
1787 return -EINVAL; in axg_audio_clkc_probe()
1793 axg_audio_regmap_cfg.max_register = data->max_register; in axg_audio_clkc_probe()
1794 map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg); in axg_audio_clkc_probe()
1795 if (IS_ERR(map)) { in axg_audio_clkc_probe()
1796 dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map)); in axg_audio_clkc_probe()
1797 return PTR_ERR(map); in axg_audio_clkc_probe()
1801 clk = devm_clk_get_enabled(dev, "pclk"); in axg_audio_clkc_probe()
1802 if (IS_ERR(clk)) in axg_audio_clkc_probe()
1803 return PTR_ERR(clk); in axg_audio_clkc_probe()
1812 for (i = 0; i < data->regmap_clk_num; i++) in axg_audio_clkc_probe()
1813 data->regmap_clks[i]->map = map; in axg_audio_clkc_probe()
1816 for (i = AUD_CLKID_DDR_ARB; i < data->hw_clks.num; i++) { in axg_audio_clkc_probe()
1819 hw = data->hw_clks.hws[i]; in axg_audio_clkc_probe()
1824 name = hw->init->name; in axg_audio_clkc_probe()
1833 ret = devm_of_clk_add_hw_provider(dev, meson_clk_hw_get, (void *)&data->hw_clks); in axg_audio_clkc_probe()
1838 if (!data->reset_num) in axg_audio_clkc_probe()
1843 return -ENOMEM; in axg_audio_clkc_probe()
1845 rst->map = map; in axg_audio_clkc_probe()
1846 rst->offset = data->reset_offset; in axg_audio_clkc_probe()
1847 rst->rstc.nr_resets = data->reset_num; in axg_audio_clkc_probe()
1848 rst->rstc.ops = &axg_audio_rstc_ops; in axg_audio_clkc_probe()
1849 rst->rstc.of_node = dev->of_node; in axg_audio_clkc_probe()
1850 rst->rstc.owner = THIS_MODULE; in axg_audio_clkc_probe()
1852 return devm_reset_controller_register(dev, &rst->rstc); in axg_audio_clkc_probe()
1891 .compatible = "amlogic,axg-audio-clkc",
1894 .compatible = "amlogic,g12a-audio-clkc",
1897 .compatible = "amlogic,sm1-audio-clkc",
1906 .name = "axg-audio-clkc",