diff options
author | Xiubo Li <Li.Xiubo@freescale.com> | 2014-01-24 02:43:02 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-03 07:45:34 -0500 |
commit | 2772555b6c5ba79783c04ea6c60549530d737e2e (patch) | |
tree | 277ef9c7f05b311b5cec72c350683af7fcf8884c | |
parent | 30d0341e7da0c012f64fb290dd1153360fb49a8d (diff) |
ASoC: simple-card: Add snd_card's name parsing from DT node support
If the DT is used and the CPU DAI device has only one DAI, the card
name will be like :
ALSA device list:
0: 40031000.sai-sgtl5000
And this name maybe a little ugly to some customers, so here the
card name parsing from DT node is supported.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/generic/simple-card.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 65833feb995f..0890fcdc9251 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -143,6 +143,9 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
143 | char *name; | 143 | char *name; |
144 | int ret; | 144 | int ret; |
145 | 145 | ||
146 | /* parsing the card name from DT */ | ||
147 | snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name"); | ||
148 | |||
146 | /* get CPU/CODEC common format via simple-audio-card,format */ | 149 | /* get CPU/CODEC common format via simple-audio-card,format */ |
147 | priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") & | 150 | priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") & |
148 | (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK); | 151 | (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK); |
@@ -187,7 +190,8 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
187 | GFP_KERNEL); | 190 | GFP_KERNEL); |
188 | sprintf(name, "%s-%s", dai_link->cpu_dai_name, | 191 | sprintf(name, "%s-%s", dai_link->cpu_dai_name, |
189 | dai_link->codec_dai_name); | 192 | dai_link->codec_dai_name); |
190 | priv->snd_card.name = name; | 193 | if (!priv->snd_card.name) |
194 | priv->snd_card.name = name; | ||
191 | dai_link->name = dai_link->stream_name = name; | 195 | dai_link->name = dai_link->stream_name = name; |
192 | 196 | ||
193 | /* simple-card assumes platform == cpu */ | 197 | /* simple-card assumes platform == cpu */ |