Lines Matching +full:wcd +full:- +full:capture
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
5 * lpass-sc7180.c -- ALSA SoC platform-machine driver for QTi LPASS
13 #include <dt-bindings/sound/sc7180-lpass.h>
15 #include "lpass-lpaif-reg.h"
31 .capture = {
32 .stream_name = "Primary Capture",
72 .stream_name = "WCD Playback",
84 .capture = {
85 .stream_name = "WCD Capture",
97 .capture = {
98 .stream_name = "DMIC Capture",
113 const struct lpass_variant *v = drvdata->variant; in sc7280_lpass_alloc_dma_channel()
119 chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, in sc7280_lpass_alloc_dma_channel()
120 v->rdma_channels); in sc7280_lpass_alloc_dma_channel()
122 if (chan >= v->rdma_channels) in sc7280_lpass_alloc_dma_channel()
123 return -EBUSY; in sc7280_lpass_alloc_dma_channel()
125 chan = find_next_zero_bit(&drvdata->dma_ch_bit_map, in sc7280_lpass_alloc_dma_channel()
126 v->wrdma_channel_start + in sc7280_lpass_alloc_dma_channel()
127 v->wrdma_channels, in sc7280_lpass_alloc_dma_channel()
128 v->wrdma_channel_start); in sc7280_lpass_alloc_dma_channel()
130 if (chan >= v->wrdma_channel_start + v->wrdma_channels) in sc7280_lpass_alloc_dma_channel()
131 return -EBUSY; in sc7280_lpass_alloc_dma_channel()
133 set_bit(chan, &drvdata->dma_ch_bit_map); in sc7280_lpass_alloc_dma_channel()
136 chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map, in sc7280_lpass_alloc_dma_channel()
137 v->hdmi_rdma_channels); in sc7280_lpass_alloc_dma_channel()
138 if (chan >= v->hdmi_rdma_channels) in sc7280_lpass_alloc_dma_channel()
139 return -EBUSY; in sc7280_lpass_alloc_dma_channel()
140 set_bit(chan, &drvdata->hdmi_dma_ch_bit_map); in sc7280_lpass_alloc_dma_channel()
143 chan = find_first_zero_bit(&drvdata->rxtx_dma_ch_bit_map, in sc7280_lpass_alloc_dma_channel()
144 v->rxtx_rdma_channels); in sc7280_lpass_alloc_dma_channel()
145 if (chan >= v->rxtx_rdma_channels) in sc7280_lpass_alloc_dma_channel()
146 return -EBUSY; in sc7280_lpass_alloc_dma_channel()
149 chan = find_next_zero_bit(&drvdata->rxtx_dma_ch_bit_map, in sc7280_lpass_alloc_dma_channel()
150 v->rxtx_wrdma_channel_start + in sc7280_lpass_alloc_dma_channel()
151 v->rxtx_wrdma_channels, in sc7280_lpass_alloc_dma_channel()
152 v->rxtx_wrdma_channel_start); in sc7280_lpass_alloc_dma_channel()
153 if (chan >= v->rxtx_wrdma_channel_start + v->rxtx_wrdma_channels) in sc7280_lpass_alloc_dma_channel()
154 return -EBUSY; in sc7280_lpass_alloc_dma_channel()
155 set_bit(chan, &drvdata->rxtx_dma_ch_bit_map); in sc7280_lpass_alloc_dma_channel()
158 chan = find_next_zero_bit(&drvdata->va_dma_ch_bit_map, in sc7280_lpass_alloc_dma_channel()
159 v->va_wrdma_channel_start + in sc7280_lpass_alloc_dma_channel()
160 v->va_wrdma_channels, in sc7280_lpass_alloc_dma_channel()
161 v->va_wrdma_channel_start); in sc7280_lpass_alloc_dma_channel()
162 if (chan >= v->va_wrdma_channel_start + v->va_wrdma_channels) in sc7280_lpass_alloc_dma_channel()
163 return -EBUSY; in sc7280_lpass_alloc_dma_channel()
164 set_bit(chan, &drvdata->va_dma_ch_bit_map); in sc7280_lpass_alloc_dma_channel()
177 clear_bit(chan, &drvdata->dma_ch_bit_map); in sc7280_lpass_free_dma_channel()
180 clear_bit(chan, &drvdata->hdmi_dma_ch_bit_map); in sc7280_lpass_free_dma_channel()
184 clear_bit(chan, &drvdata->rxtx_dma_ch_bit_map); in sc7280_lpass_free_dma_channel()
187 clear_bit(chan, &drvdata->va_dma_ch_bit_map); in sc7280_lpass_free_dma_channel()
199 const struct lpass_variant *variant = drvdata->variant; in sc7280_lpass_init()
200 struct device *dev = &pdev->dev; in sc7280_lpass_init()
203 drvdata->clks = devm_kcalloc(dev, variant->num_clks, in sc7280_lpass_init()
204 sizeof(*drvdata->clks), GFP_KERNEL); in sc7280_lpass_init()
205 if (!drvdata->clks) in sc7280_lpass_init()
206 return -ENOMEM; in sc7280_lpass_init()
208 drvdata->num_clks = variant->num_clks; in sc7280_lpass_init()
210 for (i = 0; i < drvdata->num_clks; i++) in sc7280_lpass_init()
211 drvdata->clks[i].id = variant->clk_name[i]; in sc7280_lpass_init()
213 ret = devm_clk_bulk_get(dev, drvdata->num_clks, drvdata->clks); in sc7280_lpass_init()
219 ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); in sc7280_lpass_init()
232 clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); in sc7280_lpass_exit()
240 return clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); in sc7280_lpass_dev_resume()
247 clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); in sc7280_lpass_dev_suspend()
436 {.compatible = "qcom,sc7280-lpass-cpu", .data = &sc7280_data},
443 .name = "sc7280-lpass-cpu",