linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoc: q6afe: add support to get port direction
@ 2020-06-12 12:37 Srinivas Kandagatla
  2020-06-12 12:37 ` [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks Srinivas Kandagatla
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Srinivas Kandagatla @ 2020-06-12 12:37 UTC (permalink / raw)
  To: broonie
  Cc: vkoul, perex, tiwai, alsa-devel, lgirdwood, linux-kernel,
	Srinivas Kandagatla, John Stultz

This patch adds support to q6afe_is_rx_port() to get direction
of DSP BE dai port, this is useful for setting dailink
directions correctly.

Fixes: c25e295cd77b (ASoC: qcom: Add support to parse common audio device nodes")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/qcom/qdsp6/q6afe.c | 8 ++++++++
 sound/soc/qcom/qdsp6/q6afe.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
index e0945f7a58c8..0ce4eb60f984 100644
--- a/sound/soc/qcom/qdsp6/q6afe.c
+++ b/sound/soc/qcom/qdsp6/q6afe.c
@@ -800,6 +800,14 @@ int q6afe_get_port_id(int index)
 }
 EXPORT_SYMBOL_GPL(q6afe_get_port_id);
 
+int q6afe_is_rx_port(int index)
+{
+	if (index < 0 || index >= AFE_PORT_MAX)
+		return -EINVAL;
+
+	return port_maps[index].is_rx;
+}
+EXPORT_SYMBOL_GPL(q6afe_is_rx_port);
 static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
 			    struct q6afe_port *port)
 {
diff --git a/sound/soc/qcom/qdsp6/q6afe.h b/sound/soc/qcom/qdsp6/q6afe.h
index c7ed5422baff..1a0f80a14afe 100644
--- a/sound/soc/qcom/qdsp6/q6afe.h
+++ b/sound/soc/qcom/qdsp6/q6afe.h
@@ -198,6 +198,7 @@ int q6afe_port_start(struct q6afe_port *port);
 int q6afe_port_stop(struct q6afe_port *port);
 void q6afe_port_put(struct q6afe_port *port);
 int q6afe_get_port_id(int index);
+int q6afe_is_rx_port(int index);
 void q6afe_hdmi_port_prepare(struct q6afe_port *port,
 			    struct q6afe_hdmi_cfg *cfg);
 void q6afe_slim_port_prepare(struct q6afe_port *port,
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks
  2020-06-12 12:37 [PATCH 1/2] ASoc: q6afe: add support to get port direction Srinivas Kandagatla
@ 2020-06-12 12:37 ` Srinivas Kandagatla
  2020-06-12 12:59   ` Vinod Koul
  2020-06-12 23:57   ` John Stultz
  2020-06-12 12:59 ` [PATCH 1/2] ASoc: q6afe: add support to get port direction Vinod Koul
  2020-06-15 15:05 ` Mark Brown
  2 siblings, 2 replies; 6+ messages in thread
From: Srinivas Kandagatla @ 2020-06-12 12:37 UTC (permalink / raw)
  To: broonie
  Cc: vkoul, perex, tiwai, alsa-devel, lgirdwood, linux-kernel,
	Srinivas Kandagatla, John Stultz

Currently both FE and BE dai-links are configured bi-directional,
However the DSP BE dais are only single directional,
so set the directions as supported by the BE dais.

Fixes: c25e295cd77b (ASoC: qcom: Add support to parse common audio device nodes")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/qcom/common.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index 6c20bdd850f3..8ada4ecba847 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -4,6 +4,7 @@
 
 #include <linux/module.h>
 #include "common.h"
+#include "qdsp6/q6afe.h"
 
 int qcom_snd_parse_of(struct snd_soc_card *card)
 {
@@ -101,6 +102,15 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
 			}
 			link->no_pcm = 1;
 			link->ignore_pmdown_time = 1;
+
+			if (q6afe_is_rx_port(link->id)) {
+				link->dpcm_playback = 1;
+				link->dpcm_capture = 0;
+			} else {
+				link->dpcm_playback = 0;
+				link->dpcm_capture = 1;
+			}
+
 		} else {
 			dlc = devm_kzalloc(dev, sizeof(*dlc), GFP_KERNEL);
 			if (!dlc)
@@ -113,12 +123,12 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
 			link->codecs->dai_name = "snd-soc-dummy-dai";
 			link->codecs->name = "snd-soc-dummy";
 			link->dynamic = 1;
+			link->dpcm_playback = 1;
+			link->dpcm_capture = 1;
 		}
 
 		link->ignore_suspend = 1;
 		link->nonatomic = 1;
-		link->dpcm_playback = 1;
-		link->dpcm_capture = 1;
 		link->stream_name = link->name;
 		link++;
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ASoc: q6afe: add support to get port direction
  2020-06-12 12:37 [PATCH 1/2] ASoc: q6afe: add support to get port direction Srinivas Kandagatla
  2020-06-12 12:37 ` [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks Srinivas Kandagatla
@ 2020-06-12 12:59 ` Vinod Koul
  2020-06-15 15:05 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2020-06-12 12:59 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: broonie, perex, tiwai, alsa-devel, lgirdwood, linux-kernel, John Stultz

On 12-06-20, 13:37, Srinivas Kandagatla wrote:
> This patch adds support to q6afe_is_rx_port() to get direction
> of DSP BE dai port, this is useful for setting dailink
> directions correctly.

Reviewed-by: Vinod Koul <vkoul@kernel.org>

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks
  2020-06-12 12:37 ` [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks Srinivas Kandagatla
@ 2020-06-12 12:59   ` Vinod Koul
  2020-06-12 23:57   ` John Stultz
  1 sibling, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2020-06-12 12:59 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: broonie, perex, tiwai, alsa-devel, lgirdwood, linux-kernel, John Stultz

On 12-06-20, 13:37, Srinivas Kandagatla wrote:
> Currently both FE and BE dai-links are configured bi-directional,
> However the DSP BE dais are only single directional,
> so set the directions as supported by the BE dais.

Reviewed-by: Vinod Koul <vkoul@kernel.org>

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks
  2020-06-12 12:37 ` [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks Srinivas Kandagatla
  2020-06-12 12:59   ` Vinod Koul
@ 2020-06-12 23:57   ` John Stultz
  1 sibling, 0 replies; 6+ messages in thread
From: John Stultz @ 2020-06-12 23:57 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Mark Brown, Vinod Koul, Jaroslav Kysela, Takashi Iwai,
	Linux-ALSA, Liam Girdwood, lkml

On Fri, Jun 12, 2020 at 5:38 AM Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> Currently both FE and BE dai-links are configured bi-directional,
> However the DSP BE dais are only single directional,
> so set the directions as supported by the BE dais.
>
> Fixes: c25e295cd77b (ASoC: qcom: Add support to parse common audio device nodes")
> Reported-by: John Stultz <john.stultz@linaro.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---

Yep, this resolves the recent issue for me!  Thanks so much for the quick fix!

Tested-by: John Stultz <john.stultz@linaro.org>

thanks again!
-john

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ASoc: q6afe: add support to get port direction
  2020-06-12 12:37 [PATCH 1/2] ASoc: q6afe: add support to get port direction Srinivas Kandagatla
  2020-06-12 12:37 ` [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks Srinivas Kandagatla
  2020-06-12 12:59 ` [PATCH 1/2] ASoc: q6afe: add support to get port direction Vinod Koul
@ 2020-06-15 15:05 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2020-06-15 15:05 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: linux-kernel, John Stultz, vkoul, lgirdwood, tiwai, alsa-devel

On Fri, 12 Jun 2020 13:37:10 +0100, Srinivas Kandagatla wrote:
> This patch adds support to q6afe_is_rx_port() to get direction
> of DSP BE dai port, this is useful for setting dailink
> directions correctly.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoc: q6afe: add support to get port direction
      commit: 4a95737440d426e93441d49d11abf4c6526d4666
[2/2] ASoC: qcom: common: set correct directions for dailinks
      commit: a2120089251f1fe221305e88df99af16f940e236

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-06-15 15:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 12:37 [PATCH 1/2] ASoc: q6afe: add support to get port direction Srinivas Kandagatla
2020-06-12 12:37 ` [PATCH 2/2] ASoC: qcom: common: set correct directions for dailinks Srinivas Kandagatla
2020-06-12 12:59   ` Vinod Koul
2020-06-12 23:57   ` John Stultz
2020-06-12 12:59 ` [PATCH 1/2] ASoc: q6afe: add support to get port direction Vinod Koul
2020-06-15 15:05 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).