wm8900.c (85a3685852d9ac7d92be9d824533c915a4597fa4) wm8900.c (bd1204cb51f15d202f95222e873a94ed5d07b784)
1/*
2 * wm8900.c -- WM8900 ALSA Soc Audio driver
3 *
4 * Copyright 2007, 2008 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 1124 unchanged lines hidden (view full) ---

1133 if (ret != 0) {
1134 dev_err(codec->dev, "Failed to stop FLL\n");
1135 return ret;
1136 }
1137
1138 wm8900->fll_out = fll_out;
1139 wm8900->fll_in = fll_in;
1140
1/*
2 * wm8900.c -- WM8900 ALSA Soc Audio driver
3 *
4 * Copyright 2007, 2008 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 1124 unchanged lines hidden (view full) ---

1133 if (ret != 0) {
1134 dev_err(codec->dev, "Failed to stop FLL\n");
1135 return ret;
1136 }
1137
1138 wm8900->fll_out = fll_out;
1139 wm8900->fll_in = fll_in;
1140
1141 wm8900_set_bias_level(codec, SND_SOC_BIAS_OFF);
1141 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
1142
1143 return 0;
1144}
1145
1146static int wm8900_resume(struct snd_soc_codec *codec)
1147{
1148 struct wm8900_priv *wm8900 = snd_soc_codec_get_drvdata(codec);
1149 int ret;
1150
1151 wm8900_reset(codec);
1152
1153 ret = regcache_sync(wm8900->regmap);
1154 if (ret != 0) {
1155 dev_err(codec->dev, "Failed to restore cache: %d\n", ret);
1156 return ret;
1157 }
1158
1142
1143 return 0;
1144}
1145
1146static int wm8900_resume(struct snd_soc_codec *codec)
1147{
1148 struct wm8900_priv *wm8900 = snd_soc_codec_get_drvdata(codec);
1149 int ret;
1150
1151 wm8900_reset(codec);
1152
1153 ret = regcache_sync(wm8900->regmap);
1154 if (ret != 0) {
1155 dev_err(codec->dev, "Failed to restore cache: %d\n", ret);
1156 return ret;
1157 }
1158
1159 wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1159 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1160
1161 /* Restart the FLL? */
1162 if (wm8900->fll_out) {
1163 int fll_out = wm8900->fll_out;
1164 int fll_in = wm8900->fll_in;
1165
1166 wm8900->fll_in = 0;
1167 wm8900->fll_out = 0;

--- 16 unchanged lines hidden (view full) ---

1184 if (reg != 0x8900) {
1185 dev_err(codec->dev, "Device is not a WM8900 - ID %x\n", reg);
1186 return -ENODEV;
1187 }
1188
1189 wm8900_reset(codec);
1190
1191 /* Turn the chip on */
1160
1161 /* Restart the FLL? */
1162 if (wm8900->fll_out) {
1163 int fll_out = wm8900->fll_out;
1164 int fll_in = wm8900->fll_in;
1165
1166 wm8900->fll_in = 0;
1167 wm8900->fll_out = 0;

--- 16 unchanged lines hidden (view full) ---

1184 if (reg != 0x8900) {
1185 dev_err(codec->dev, "Device is not a WM8900 - ID %x\n", reg);
1186 return -ENODEV;
1187 }
1188
1189 wm8900_reset(codec);
1190
1191 /* Turn the chip on */
1192 wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1192 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1193
1194 /* Latch the volume update bits */
1195 snd_soc_update_bits(codec, WM8900_REG_LINVOL, 0x100, 0x100);
1196 snd_soc_update_bits(codec, WM8900_REG_RINVOL, 0x100, 0x100);
1197 snd_soc_update_bits(codec, WM8900_REG_LOUT1CTL, 0x100, 0x100);
1198 snd_soc_update_bits(codec, WM8900_REG_ROUT1CTL, 0x100, 0x100);
1199 snd_soc_update_bits(codec, WM8900_REG_LOUT2CTL, 0x100, 0x100);
1200 snd_soc_update_bits(codec, WM8900_REG_ROUT2CTL, 0x100, 0x100);

--- 158 unchanged lines hidden ---
1193
1194 /* Latch the volume update bits */
1195 snd_soc_update_bits(codec, WM8900_REG_LINVOL, 0x100, 0x100);
1196 snd_soc_update_bits(codec, WM8900_REG_RINVOL, 0x100, 0x100);
1197 snd_soc_update_bits(codec, WM8900_REG_LOUT1CTL, 0x100, 0x100);
1198 snd_soc_update_bits(codec, WM8900_REG_ROUT1CTL, 0x100, 0x100);
1199 snd_soc_update_bits(codec, WM8900_REG_LOUT2CTL, 0x100, 0x100);
1200 snd_soc_update_bits(codec, WM8900_REG_ROUT2CTL, 0x100, 0x100);

--- 158 unchanged lines hidden ---