All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org,
	Banajit Goswami <bgoswami@codeaurora.org>,
	Stephan Gerhold <stephan@gerhold.net>,
	Patrick Lai <plai@codeaurora.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	~postmarketos/upstreaming@lists.sr.ht,
	Cheng-Yi Chiang <cychiang@chromium.org>
Subject: [PATCH 2/7] ASoC: qcom: common: Use snd_soc_dai_link_set_capabilities()
Date: Thu, 23 Jul 2020 20:38:59 +0200	[thread overview]
Message-ID: <20200723183904.321040-3-stephan@gerhold.net> (raw)
In-Reply-To: <20200723183904.321040-1-stephan@gerhold.net>

Commit a2120089251f ("ASoC: qcom: common: set correct directions for dailinks")
introduced a call to q6afe_is_rx_port() to set the dpcm_playback/capture
parameters correctly. This is necessary because those parameters are now
validated to match the capabilities of the DAIs. [1]

The disadvantage of introducing the call to q6afe_is_rx_port() is that
it makes the qcom_snd_parse_of() helper dependent on the QDSP6 driver.
When the ADSP is bypassed (e.g. in apq8016-sbc) QDSP6 is not used.

There is a generic solution for this now: The correct direction for the links
is already defined by the DAI capabilities (e.g. rx ports only support playback).

Commit 25612477d20b ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper")
introduced the snd_soc_dai_link_set_capabilities() function that we can use
to set dpcm_playback/dpcm_capture according to the capabilities of the DAIs.

Use that for both FE/BE DAI links to avoid the dependency on the QDSP6 driver.

[1]: https://lore.kernel.org/alsa-devel/20200616085409.GA110999@gerhold.net/

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 sound/soc/qcom/common.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index d677e83828af..030df6026562 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -4,7 +4,6 @@
 
 #include <linux/module.h>
 #include "common.h"
-#include "qdsp6/q6afe.h"
 
 int qcom_snd_parse_of(struct snd_soc_card *card)
 {
@@ -102,15 +101,6 @@ 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)
@@ -123,10 +113,9 @@ 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;
 		}
 
+		snd_soc_dai_link_set_capabilities(link);
 		link->ignore_suspend = 1;
 		link->nonatomic = 1;
 		link->stream_name = link->name;
-- 
2.27.0


  parent reply	other threads:[~2020-07-23 18:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 18:38 [PATCH 0/7] ASoC: qcom: Use qcom_snd_parse_of() for apq8016_sbc Stephan Gerhold
2020-07-23 18:38 ` [PATCH 1/7] ASoC: qcom: Use devm for resource management Stephan Gerhold
2020-07-23 18:38 ` Stephan Gerhold [this message]
2020-07-23 18:39 ` [PATCH 3/7] ASoC: q6afe: Remove unused q6afe_is_rx_port() function Stephan Gerhold
2020-07-23 18:39 ` [PATCH 4/7] ASoC: qcom: common: Support parsing links without DPCM Stephan Gerhold
2020-07-23 18:39 ` [PATCH 5/7] ASoC: qcom: common: Parse properties with "qcom," prefix Stephan Gerhold
2020-07-23 18:39 ` [PATCH 6/7] ASoC: qcom: apq8016_sbc: Use qcom_snd_parse_of() Stephan Gerhold
2020-07-23 18:39 ` [PATCH 7/7] ASoC: qcom: common: Avoid printing errors for -EPROBE_DEFER Stephan Gerhold
2020-07-24 11:21 ` [PATCH 0/7] ASoC: qcom: Use qcom_snd_parse_of() for apq8016_sbc Srinivas Kandagatla
2020-07-24 14:37 ` Mark Brown

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=20200723183904.321040-3-stephan@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=cychiang@chromium.org \
    --cc=lgirdwood@gmail.com \
    --cc=plai@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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.