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

1 // SPDX-License-Identifier: GPL-2.0-only
5 * lpass-sc7180.c -- ALSA SoC platform-machine driver for QTi LPASS
16 #include <dt-bindings/sound/sc7180-lpass.h>
20 #include "lpass-lpaif-reg.h"
26 .name = "Primary MI2S",
49 .name = "Secondary MI2S",
79 const struct lpass_variant *v = drvdata->variant; in sc7180_lpass_alloc_dma_channel()
84 chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map, in sc7180_lpass_alloc_dma_channel()
85 v->hdmi_rdma_channels); in sc7180_lpass_alloc_dma_channel()
87 if (chan >= v->hdmi_rdma_channels) in sc7180_lpass_alloc_dma_channel()
88 return -EBUSY; in sc7180_lpass_alloc_dma_channel()
90 set_bit(chan, &drvdata->hdmi_dma_ch_bit_map); in sc7180_lpass_alloc_dma_channel()
93 chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, in sc7180_lpass_alloc_dma_channel()
94 v->rdma_channels); in sc7180_lpass_alloc_dma_channel()
96 if (chan >= v->rdma_channels) in sc7180_lpass_alloc_dma_channel()
97 return -EBUSY; in sc7180_lpass_alloc_dma_channel()
99 chan = find_next_zero_bit(&drvdata->dma_ch_bit_map, in sc7180_lpass_alloc_dma_channel()
100 v->wrdma_channel_start + in sc7180_lpass_alloc_dma_channel()
101 v->wrdma_channels, in sc7180_lpass_alloc_dma_channel()
102 v->wrdma_channel_start); in sc7180_lpass_alloc_dma_channel()
104 if (chan >= v->wrdma_channel_start + v->wrdma_channels) in sc7180_lpass_alloc_dma_channel()
105 return -EBUSY; in sc7180_lpass_alloc_dma_channel()
108 set_bit(chan, &drvdata->dma_ch_bit_map); in sc7180_lpass_alloc_dma_channel()
116 clear_bit(chan, &drvdata->hdmi_dma_ch_bit_map); in sc7180_lpass_free_dma_channel()
118 clear_bit(chan, &drvdata->dma_ch_bit_map); in sc7180_lpass_free_dma_channel()
126 const struct lpass_variant *variant = drvdata->variant; in sc7180_lpass_init()
127 struct device *dev = &pdev->dev; in sc7180_lpass_init()
130 drvdata->clks = devm_kcalloc(dev, variant->num_clks, in sc7180_lpass_init()
131 sizeof(*drvdata->clks), GFP_KERNEL); in sc7180_lpass_init()
132 if (!drvdata->clks) in sc7180_lpass_init()
133 return -ENOMEM; in sc7180_lpass_init()
135 drvdata->num_clks = variant->num_clks; in sc7180_lpass_init()
137 for (i = 0; i < drvdata->num_clks; i++) in sc7180_lpass_init()
138 drvdata->clks[i].id = variant->clk_name[i]; in sc7180_lpass_init()
140 ret = devm_clk_bulk_get(dev, drvdata->num_clks, drvdata->clks); in sc7180_lpass_init()
146 ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); in sc7180_lpass_init()
159 clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); in sc7180_lpass_exit()
167 return clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); in sc7180_lpass_dev_resume()
174 clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); in sc7180_lpass_dev_suspend()
284 "pcnoc-sway-clk",
285 "audio-core",
286 "pcnoc-mport-clk",
296 "mi2s-bit-clk0",
297 "mi2s-bit-clk1",
306 {.compatible = "qcom,sc7180-lpass-cpu", .data = &sc7180_data},
313 .name = "sc7180-lpass-cpu",