diff options
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 36519aef55d9..92d5d917b73b 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -116,6 +116,7 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec) | |||
116 | static inline const char* get_dai_name(int type) | 116 | static inline const char* get_dai_name(int type) |
117 | { | 117 | { |
118 | switch(type) { | 118 | switch(type) { |
119 | case SND_SOC_DAI_AC97_BUS: | ||
119 | case SND_SOC_DAI_AC97: | 120 | case SND_SOC_DAI_AC97: |
120 | return "AC97"; | 121 | return "AC97"; |
121 | case SND_SOC_DAI_I2S: | 122 | case SND_SOC_DAI_I2S: |
@@ -1099,7 +1100,8 @@ int snd_soc_register_card(struct snd_soc_device *socdev) | |||
1099 | continue; | 1100 | continue; |
1100 | } | 1101 | } |
1101 | } | 1102 | } |
1102 | if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97) | 1103 | if (socdev->machine->dai_link[i].codec_dai->type == |
1104 | SND_SOC_DAI_AC97_BUS) | ||
1103 | ac97 = 1; | 1105 | ac97 = 1; |
1104 | } | 1106 | } |
1105 | snprintf(codec->card->shortname, sizeof(codec->card->shortname), | 1107 | snprintf(codec->card->shortname, sizeof(codec->card->shortname), |
@@ -1148,11 +1150,21 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card); | |||
1148 | void snd_soc_free_pcms(struct snd_soc_device *socdev) | 1150 | void snd_soc_free_pcms(struct snd_soc_device *socdev) |
1149 | { | 1151 | { |
1150 | struct snd_soc_codec *codec = socdev->codec; | 1152 | struct snd_soc_codec *codec = socdev->codec; |
1153 | #ifdef CONFIG_SND_SOC_AC97_BUS | ||
1154 | struct snd_soc_codec_dai *codec_dai; | ||
1155 | int i; | ||
1156 | #endif | ||
1151 | 1157 | ||
1152 | mutex_lock(&codec->mutex); | 1158 | mutex_lock(&codec->mutex); |
1153 | #ifdef CONFIG_SND_SOC_AC97_BUS | 1159 | #ifdef CONFIG_SND_SOC_AC97_BUS |
1154 | if (codec->ac97) | 1160 | for(i = 0; i < codec->num_dai; i++) { |
1155 | soc_ac97_dev_unregister(codec); | 1161 | codec_dai = &codec->dai[i]; |
1162 | if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) { | ||
1163 | soc_ac97_dev_unregister(codec); | ||
1164 | goto free_card; | ||
1165 | } | ||
1166 | } | ||
1167 | free_card: | ||
1156 | #endif | 1168 | #endif |
1157 | 1169 | ||
1158 | if (codec->card) | 1170 | if (codec->card) |