aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm9713.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm9713.c')
-rw-r--r--sound/soc/codecs/wm9713.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 9e6b2fd7262b..4863636e9d56 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1094,33 +1094,33 @@ int wm9713_reset(struct snd_soc_codec *codec, int try_warm)
1094} 1094}
1095EXPORT_SYMBOL_GPL(wm9713_reset); 1095EXPORT_SYMBOL_GPL(wm9713_reset);
1096 1096
1097static int wm9713_dapm_event(struct snd_soc_codec *codec, int event) 1097static int wm9713_set_bias_level(struct snd_soc_codec *codec,
1098 enum snd_soc_bias_level level)
1098{ 1099{
1099 u16 reg; 1100 u16 reg;
1100 1101
1101 switch (event) { 1102 switch (level) {
1102 case SNDRV_CTL_POWER_D0: /* full On */ 1103 case SND_SOC_BIAS_ON:
1103 /* enable thermal shutdown */ 1104 /* enable thermal shutdown */
1104 reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x1bff; 1105 reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x1bff;
1105 ac97_write(codec, AC97_EXTENDED_MID, reg); 1106 ac97_write(codec, AC97_EXTENDED_MID, reg);
1106 break; 1107 break;
1107 case SNDRV_CTL_POWER_D1: /* partial On */ 1108 case SND_SOC_BIAS_PREPARE:
1108 case SNDRV_CTL_POWER_D2: /* partial On */
1109 break; 1109 break;
1110 case SNDRV_CTL_POWER_D3hot: /* Off, with power */ 1110 case SND_SOC_BIAS_STANDBY:
1111 /* enable master bias and vmid */ 1111 /* enable master bias and vmid */
1112 reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x3bff; 1112 reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x3bff;
1113 ac97_write(codec, AC97_EXTENDED_MID, reg); 1113 ac97_write(codec, AC97_EXTENDED_MID, reg);
1114 ac97_write(codec, AC97_POWERDOWN, 0x0000); 1114 ac97_write(codec, AC97_POWERDOWN, 0x0000);
1115 break; 1115 break;
1116 case SNDRV_CTL_POWER_D3cold: /* Off, without power */ 1116 case SND_SOC_BIAS_OFF:
1117 /* disable everything including AC link */ 1117 /* disable everything including AC link */
1118 ac97_write(codec, AC97_EXTENDED_MID, 0xffff); 1118 ac97_write(codec, AC97_EXTENDED_MID, 0xffff);
1119 ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); 1119 ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff);
1120 ac97_write(codec, AC97_POWERDOWN, 0xffff); 1120 ac97_write(codec, AC97_POWERDOWN, 0xffff);
1121 break; 1121 break;
1122 } 1122 }
1123 codec->dapm_state = event; 1123 codec->bias_level = level;
1124 return 0; 1124 return 0;
1125} 1125}
1126 1126
@@ -1157,7 +1157,7 @@ static int wm9713_soc_resume(struct platform_device *pdev)
1157 return ret; 1157 return ret;
1158 } 1158 }
1159 1159
1160 wm9713_dapm_event(codec, SNDRV_CTL_POWER_D3hot); 1160 wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1161 1161
1162 /* do we need to re-start the PLL ? */ 1162 /* do we need to re-start the PLL ? */
1163 if (wm9713->pll_out) 1163 if (wm9713->pll_out)
@@ -1173,8 +1173,8 @@ static int wm9713_soc_resume(struct platform_device *pdev)
1173 } 1173 }
1174 } 1174 }
1175 1175
1176 if (codec->suspend_dapm_state == SNDRV_CTL_POWER_D0) 1176 if (codec->suspend_bias_level == SND_SOC_BIAS_ON)
1177 wm9713_dapm_event(codec, SNDRV_CTL_POWER_D0); 1177 wm9713_set_bias_level(codec, SND_SOC_BIAS_ON);
1178 1178
1179 return ret; 1179 return ret;
1180} 1180}
@@ -1213,7 +1213,7 @@ static int wm9713_soc_probe(struct platform_device *pdev)
1213 codec->num_dai = ARRAY_SIZE(wm9713_dai); 1213 codec->num_dai = ARRAY_SIZE(wm9713_dai);
1214 codec->write = ac97_write; 1214 codec->write = ac97_write;
1215 codec->read = ac97_read; 1215 codec->read = ac97_read;
1216 codec->dapm_event = wm9713_dapm_event; 1216 codec->set_bias_level = wm9713_set_bias_level;
1217 INIT_LIST_HEAD(&codec->dapm_widgets); 1217 INIT_LIST_HEAD(&codec->dapm_widgets);
1218 INIT_LIST_HEAD(&codec->dapm_paths); 1218 INIT_LIST_HEAD(&codec->dapm_paths);
1219 1219
@@ -1235,7 +1235,7 @@ static int wm9713_soc_probe(struct platform_device *pdev)
1235 goto reset_err; 1235 goto reset_err;
1236 } 1236 }
1237 1237
1238 wm9713_dapm_event(codec, SNDRV_CTL_POWER_D3hot); 1238 wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1239 1239
1240 /* unmute the adc - move to kcontrol */ 1240 /* unmute the adc - move to kcontrol */
1241 reg = ac97_read(codec, AC97_CD) & 0x7fff; 1241 reg = ac97_read(codec, AC97_CD) & 0x7fff;