All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Patrick Lai <plai@codeaurora.org>,
	alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>
Cc: Banajit Goswami <bgoswami@codeaurora.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	kwestfie@codeaurora.org,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: [PATCH v1 04/14] ASoC: qcom: pass direction to dma allocation
Date: Wed, 10 Feb 2016 10:18:39 +0000	[thread overview]
Message-ID: <1455099519-490-1-git-send-email-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <1455099418-311-1-git-send-email-srinivas.kandagatla@linaro.org>

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 1c3eb65..2aaca47 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

  parent reply	other threads:[~2016-02-10 10:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 10:16 [PATCH v1 00/14] ASoC: qcom: Add capture support Srinivas Kandagatla
2016-02-10 10:18 ` [PATCH v1 01/14] ASoC: qcom: use snd_dma_alloc/free* apis Srinivas Kandagatla
2016-02-20 17:15   ` Applied "ASoC: qcom: use snd_dma_alloc/free* apis" to the asoc tree Mark Brown
2016-02-10 10:18 ` [PATCH v1 02/14] ASoC: qcom: add wrdma register details to lpass_variant Srinivas Kandagatla
2016-02-20 17:15   ` Applied "ASoC: qcom: add wrdma register details to lpass_variant" to the asoc tree Mark Brown
2016-02-10 10:18 ` [PATCH v1 03/14] ASoC: qcom: rename rdmactl_audif_start to dmactrl_audif_start Srinivas Kandagatla
2016-02-10 10:18 ` Srinivas Kandagatla [this message]
2016-02-20 17:15   ` Applied "ASoC: qcom: pass direction to dma allocation" to the asoc tree Mark Brown
2016-02-10 10:18 ` [PATCH v1 05/14] ASoC: qcom: ipq806x: add error in dma allocation Srinivas Kandagatla
2016-02-20 17:14   ` Applied "ASoC: qcom: ipq806x: add error in dma allocation." to the asoc tree Mark Brown
2016-02-10 10:19 ` [PATCH v1 06/14] ASoC: qcom: rename rdma_ch_bit_map to dma_ch_bit_map Srinivas Kandagatla
2016-02-10 10:19 ` [PATCH v1 07/14] ASoC: qcom: ipq806x: add wrdma related register offsets Srinivas Kandagatla
2016-02-10 10:19 ` [PATCH v1 08/14] ASoC: qcom: apq8016: add wrdma support Srinivas Kandagatla
2016-02-20 17:13   ` Applied "ASoC: qcom: apq8016: add wrdma support" to the asoc tree Mark Brown
2016-02-10 10:19 ` [PATCH v1 09/14] ASoC: qcom: add mic related i2s control register defines Srinivas Kandagatla
2016-02-20 17:14   ` Applied "ASoC: qcom: add mic related i2s control register defines" to the asoc tree Mark Brown
2016-02-10 10:19 ` [PATCH v1 10/14] ASoC: qcom: add wrdma register definitions Srinivas Kandagatla
2016-02-10 10:19 ` [PATCH v1 11/14] ASoC: qcom: add generic bit masks for RDMA and WRDMA Srinivas Kandagatla
2016-02-10 10:19 ` [PATCH v1 12/14] ASoC: qcom: apq8016: set the correct max register for regmap Srinivas Kandagatla
2016-02-10 10:20 ` [PATCH v1 13/14] ASoC: qcom: add mic support Srinivas Kandagatla
2016-02-10 20:10   ` Kenneth Westfield
2016-02-11 11:34     ` Srinivas Kandagatla
2016-02-10 10:20 ` [PATCH v1 14/14] ASoC: qcom: apq8016-sbc: " Srinivas Kandagatla
2016-02-10 10:22 ` [PATCH v1 00/14] ASoC: qcom: Add capture support Mark Brown
2016-02-10 10:39   ` Srinivas Kandagatla
2016-02-10 11:51     ` Mark Brown
2016-02-10 11:51       ` Mark Brown
2016-02-10 20:10 ` Kenneth Westfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455099519-490-1-git-send-email-srinivas.kandagatla@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=kwestfie@codeaurora.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=plai@codeaurora.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.