Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1331900

[PATCH v3 04/14] ASoC: qcom: pass direction to dma allocation

From Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Newsgroups linux.kernel
Subject [PATCH v3 04/14] ASoC: qcom: pass direction to dma allocation
Date 2016-02-11 13:20 +0100
Message-ID <r0Yo3-8d-55@gated-at.bofh.it> (permalink)
References <r0Yo1-8d-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 sound/soc/qcom/lpass-apq8016.c  | 3 ++-
 sound/soc/qcom/lpass-ipq806x.c  | 2 +-
 sound/soc/qcom/lpass-platform.c | 3 ++-
 sound/soc/qcom/lpass.h          | 2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c
index 6cc7e72..99061f4 100644
--- a/sound/soc/qcom/lpass-apq8016.c
+++ b/sound/soc/qcom/lpass-apq8016.c
@@ -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,
diff --git a/sound/soc/qcom/lpass-ipq806x.c b/sound/soc/qcom/lpass-ipq806x.c
index 7a41679..119048c 100644
--- a/sound/soc/qcom/lpass-ipq806x.c
+++ b/sound/soc/qcom/lpass-ipq806x.c
@@ -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;
 }
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index 7245c2e..69c5ad8 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -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;
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 412399a..8475b60 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -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 */
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/14] ASoC: qcom: Add capture support. Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-11 13:20 +0100
  [PATCH v3 09/14] ASoC: qcom: add mic related i2s control register defines Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-11 13:20 +0100
  [PATCH v3 01/14] ASoC: qcom: use snd_dma_alloc/free* apis Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-11 13:20 +0100
  [PATCH v3 06/14] ASoC: qcom: rename rdma_ch_bit_map to dma_ch_bit_map Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-11 13:20 +0100
  [PATCH v3 05/14] ASoC: qcom: ipq806x: add error in dma allocation. Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-11 13:20 +0100
  [PATCH v3 04/14] ASoC: qcom: pass direction to dma allocation Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-11 13:20 +0100
  [PATCH v3 10/14] ASoC: qcom: add wrdma register definitions Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-11 13:20 +0100
  [PATCH v3 07/14] ASoC: qcom: ipq806x: add wrdma related register offsets Srinivas Kandagatla <srinivas.kandagatla@linaro.org> - 2016-02-11 13:30 +0100

csiph-web