diff options
author | Stephan Gerhold <stephan@gerhold.net> | 2020-07-23 21:39:02 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-07-24 17:01:18 +0300 |
commit | f0d67fdba5dcf48865fc79f2d63b49bd75d36671 (patch) | |
tree | e399170cd3d79e0d2ecae88f460c2f78e6364666 /sound | |
parent | 47ea88488209226e03559bb8baaa0156b4025fee (diff) | |
download | linux-f0d67fdba5dcf48865fc79f2d63b49bd75d36671.tar.xz |
ASoC: qcom: common: Parse properties with "qcom," prefix
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.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200723183904.321040-6-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/qcom/common.c | 12 |
1 files 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; } |