提交 73c847b6 编写于 作者: S Srinivas Kandagatla 提交者: Mark Brown

ASoC: qcom: pass direction to dma allocation

This patch updates the internal dma allocation callbacks to take the
stream direction so that it can allocate channels suitable for that
stream direction. Before the capture support this was not necessary.
Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: NKenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 ec5b8287
......@@ -133,7 +133,8 @@ static struct snd_soc_dai_driver apq8016_lpass_cpu_dai_driver[] = {
},
};
static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata)
static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata,
int direction)
{
struct lpass_variant *v = drvdata->variant;
int chan = find_first_zero_bit(&drvdata->rdma_ch_bit_map,
......
......@@ -63,7 +63,7 @@ static struct snd_soc_dai_driver ipq806x_lpass_cpu_dai_driver = {
.ops = &asoc_qcom_lpass_cpu_dai_ops,
};
static int ipq806x_lpass_alloc_dma_channel(struct lpass_data *drvdata)
static int ipq806x_lpass_alloc_dma_channel(struct lpass_data *drvdata, int dir)
{
return IPQ806X_LPAIF_RDMA_CHAN_MI2S;
}
......
......@@ -457,7 +457,8 @@ static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime)
return -ENOMEM;
if (v->alloc_dma_channel)
data->rdma_ch = v->alloc_dma_channel(drvdata);
data->rdma_ch = v->alloc_dma_channel(drvdata,
SNDRV_PCM_STREAM_PLAYBACK);
if (IS_ERR_VALUE(data->rdma_ch))
return data->rdma_ch;
......
......@@ -84,7 +84,7 @@ struct lpass_variant {
/* SOC specific intialization like clocks */
int (*init)(struct platform_device *pdev);
int (*exit)(struct platform_device *pdev);
int (*alloc_dma_channel)(struct lpass_data *data);
int (*alloc_dma_channel)(struct lpass_data *data, int direction);
int (*free_dma_channel)(struct lpass_data *data, int ch);
/* SOC specific dais */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册