Lines Matching +full:mi2s +full:- +full:bit +full:- +full:clk0

1 // SPDX-License-Identifier: GPL-2.0-only
5 * lpass-sc7180.c -- ALSA SoC platform-machine driver for QTi LPASS
15 #include <dt-bindings/sound/sc7180-lpass.h>
19 #include "lpass-lpaif-reg.h"
25 .name = "Primary MI2S",
49 .name = "Secondary MI2S",
81 struct lpass_variant *v = drvdata->variant; in sc7180_lpass_alloc_dma_channel()
86 chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map, in sc7180_lpass_alloc_dma_channel()
87 v->hdmi_rdma_channels); in sc7180_lpass_alloc_dma_channel()
89 if (chan >= v->hdmi_rdma_channels) in sc7180_lpass_alloc_dma_channel()
90 return -EBUSY; in sc7180_lpass_alloc_dma_channel()
92 set_bit(chan, &drvdata->hdmi_dma_ch_bit_map); in sc7180_lpass_alloc_dma_channel()
95 chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, in sc7180_lpass_alloc_dma_channel()
96 v->rdma_channels); in sc7180_lpass_alloc_dma_channel()
98 if (chan >= v->rdma_channels) in sc7180_lpass_alloc_dma_channel()
99 return -EBUSY; in sc7180_lpass_alloc_dma_channel()
101 chan = find_next_zero_bit(&drvdata->dma_ch_bit_map, in sc7180_lpass_alloc_dma_channel()
102 v->wrdma_channel_start + in sc7180_lpass_alloc_dma_channel()
103 v->wrdma_channels, in sc7180_lpass_alloc_dma_channel()
104 v->wrdma_channel_start); in sc7180_lpass_alloc_dma_channel()
106 if (chan >= v->wrdma_channel_start + v->wrdma_channels) in sc7180_lpass_alloc_dma_channel()
107 return -EBUSY; in sc7180_lpass_alloc_dma_channel()
110 set_bit(chan, &drvdata->dma_ch_bit_map); in sc7180_lpass_alloc_dma_channel()
118 clear_bit(chan, &drvdata->hdmi_dma_ch_bit_map); in sc7180_lpass_free_dma_channel()
120 clear_bit(chan, &drvdata->dma_ch_bit_map); in sc7180_lpass_free_dma_channel()
128 struct lpass_variant *variant = drvdata->variant; in sc7180_lpass_init()
129 struct device *dev = &pdev->dev; in sc7180_lpass_init()
132 drvdata->clks = devm_kcalloc(dev, variant->num_clks, in sc7180_lpass_init()
133 sizeof(*drvdata->clks), GFP_KERNEL); in sc7180_lpass_init()
134 drvdata->num_clks = variant->num_clks; in sc7180_lpass_init()
136 for (i = 0; i < drvdata->num_clks; i++) in sc7180_lpass_init()
137 drvdata->clks[i].id = variant->clk_name[i]; in sc7180_lpass_init()
139 ret = devm_clk_bulk_get(dev, drvdata->num_clks, drvdata->clks); in sc7180_lpass_init()
145 ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); in sc7180_lpass_init()
158 clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); in sc7180_lpass_exit()
265 "pcnoc-sway-clk",
266 "audio-core",
267 "pcnoc-mport-clk",
277 "mi2s-bit-clk0",
278 "mi2s-bit-clk1",
287 {.compatible = "qcom,sc7180-lpass-cpu", .data = &sc7180_data},
294 .name = "sc7180-lpass-cpu",