ASoC: qcom: pass direction to dma allocation
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Thu, 11 Feb 2016 12:17:37 +0000 (12:17 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 19 Feb 2016 16:20:18 +0000 (01:20 +0900)
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: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/lpass-apq8016.c
sound/soc/qcom/lpass-ipq806x.c
sound/soc/qcom/lpass-platform.c
sound/soc/qcom/lpass.h

index 6cc7e72b6ff3b04d88eb2e758a03f6c581c00669..99061f42953e76e430a0e473a59cdee75aa26553 100644 (file)
@@ -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,
index 7a416795271130113a875cbf5b4fbea70e813cd9..119048c016eca5642039822c5abfea3df79ab78f 100644 (file)
@@ -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;
 }
index 7245c2ed4e8bd7ef968dbae8b9e38a1b5798d766..69c5ad8e2bd728840e9f2922274c72204361cb5f 100644 (file)
@@ -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;
index 412399acfe3d869bfd9ceaea58ffa7514330e577..8475b609f8ce0db12d8fa24ce12a819f56c2149b 100644 (file)
@@ -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 */