Skip to content

Commit f0d67fd

Browse files
stephan-ghbroonie
authored andcommitted
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 <[email protected]> Tested-by: Srinivas Kandagatla <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Cc: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 47ea884 commit f0d67fd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sound/soc/qcom/common.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,23 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
1818
int ret, num_links;
1919

2020
ret = snd_soc_of_parse_card_name(card, "model");
21+
if (ret == 0 && !card->name)
22+
/* Deprecated, only for compatibility with old device trees */
23+
ret = snd_soc_of_parse_card_name(card, "qcom,model");
2124
if (ret) {
2225
dev_err(dev, "Error parsing card name: %d\n", ret);
2326
return ret;
2427
}
2528

2629
/* DAPM routes */
2730
if (of_property_read_bool(dev->of_node, "audio-routing")) {
28-
ret = snd_soc_of_parse_audio_routing(card,
29-
"audio-routing");
31+
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
32+
if (ret)
33+
return ret;
34+
}
35+
/* Deprecated, only for compatibility with old device trees */
36+
if (of_property_read_bool(dev->of_node, "qcom,audio-routing")) {
37+
ret = snd_soc_of_parse_audio_routing(card, "qcom,audio-routing");
3038
if (ret)
3139
return ret;
3240
}

0 commit comments

Comments
 (0)