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 5/7] ASoC: qcom: common: Parse properties with "qcom," prefix
Date: Thu, 23 Jul 2020 20:39:02 +0200	[thread overview]
Message-ID: <20200723183904.321040-6-stephan@gerhold.net> (raw)
In-Reply-To: <20200723183904.321040-1-stephan@gerhold.net>

The apq8016_sbc device tree binding uses a "qcom," vendor prefix
for all device tree properties, while qcom_snd_parse_of() uses the
same properties without a prefix.

In the future it would be nice to make this consistent, however,
for backwards compatibility we need to parse both names to allow
apq8016_sbc to use the common qcom_snd_parse_of() function.

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

diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index 54f5bc60246f..84dba0d69e6b 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -18,6 +18,9 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
 	int ret, num_links;
 
 	ret = snd_soc_of_parse_card_name(card, "model");
+	if (ret == 0 && !card->name)
+		/* Deprecated, only for compatibility with old device trees */
+		ret = snd_soc_of_parse_card_name(card, "qcom,model");
 	if (ret) {
 		dev_err(dev, "Error parsing card name: %d\n", ret);
 		return ret;
@@ -25,8 +28,13 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
 
 	/* DAPM routes */
 	if (of_property_read_bool(dev->of_node, "audio-routing")) {
-		ret = snd_soc_of_parse_audio_routing(card,
-				"audio-routing");
+		ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
+		if (ret)
+			return ret;
+	}
+	/* Deprecated, only for compatibility with old device trees */
+	if (of_property_read_bool(dev->of_node, "qcom,audio-routing")) {
+		ret = snd_soc_of_parse_audio_routing(card, "qcom,audio-routing");
 		if (ret)
 			return ret;
 	}
-- 
2.27.0


  parent reply	other threads:[~2020-07-23 18:41 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 ` [PATCH 2/7] ASoC: qcom: common: Use snd_soc_dai_link_set_capabilities() Stephan Gerhold
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 ` Stephan Gerhold [this message]
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-6-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.