Skip to content

Commit

Permalink
ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_prefix
Browse files Browse the repository at this point in the history
It is assuming that the card related information is located on
"card" node, but graph case doesn't have it.
This patch adds node parameter to adjust for graph support

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Nov 11, 2016
1 parent 1ad8ec5 commit b6defcc
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion include/sound/soc.h
Original file line number Diff line number Diff line change
@@ -1651,7 +1651,11 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
unsigned int *rx_mask,
unsigned int *slots,
unsigned int *slot_width);
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
#define snd_soc_of_parse_audio_prefix(card, codec_conf, of_node, propname) \
snd_soc_of_parse_audio_prefix_from_node(card, NULL, codec_conf, \
of_node, propname)
void snd_soc_of_parse_audio_prefix_from_node(struct snd_soc_card *card,
struct device_node *np,
struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node,
const char *propname);
9 changes: 6 additions & 3 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
@@ -3595,15 +3595,18 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot);

void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
void snd_soc_of_parse_audio_prefix_from_node(struct snd_soc_card *card,
struct device_node *np,
struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node,
const char *propname)
{
struct device_node *np = card->dev->of_node;
const char *str;
int ret;

if (!np)
np = card->dev->of_node;

ret = of_property_read_string(np, propname, &str);
if (ret < 0) {
/* no prefix is not error */
@@ -3613,7 +3616,7 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
codec_conf->of_node = of_node;
codec_conf->name_prefix = str;
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix);
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix_from_node);

int snd_soc_of_parse_audio_routing_from_node(struct snd_soc_card *card,
struct device_node *np,

0 comments on commit b6defcc

Please sign in to comment.