Skip to content

Commit

Permalink
ASoC: qcom: common: Parse properties with "qcom," prefix
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
stephan-gh authored and broonie committed Jul 24, 2020
1 parent 47ea884 commit f0d67fd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sound/soc/qcom/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,23 @@ 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;
}

/* 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;
}
Expand Down

0 comments on commit f0d67fd

Please sign in to comment.