aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ad1980.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/ad1980.c')
-rw-r--r--sound/soc/codecs/ad1980.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 5fd4a29a2fe0..2860eef8610c 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -186,18 +186,6 @@ static const struct snd_soc_dapm_route ad1980_dapm_routes[] = {
186 { "HP_OUT_R", NULL, "Playback" }, 186 { "HP_OUT_R", NULL, "Playback" },
187}; 187};
188 188
189static unsigned int ac97_read(struct snd_soc_codec *codec,
190 unsigned int reg)
191{
192 return snd_soc_read(codec, reg);
193}
194
195static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
196 unsigned int val)
197{
198 return snd_soc_write(codec, reg, val);
199}
200
201static struct snd_soc_dai_driver ad1980_dai = { 189static struct snd_soc_dai_driver ad1980_dai = {
202 .name = "ad1980-hifi", 190 .name = "ad1980-hifi",
203 .playback = { 191 .playback = {
@@ -222,7 +210,7 @@ static int ad1980_reset(struct snd_soc_codec *codec, int try_warm)
222 do { 210 do {
223 if (try_warm && soc_ac97_ops->warm_reset) { 211 if (try_warm && soc_ac97_ops->warm_reset) {
224 soc_ac97_ops->warm_reset(ac97); 212 soc_ac97_ops->warm_reset(ac97);
225 if (ac97_read(codec, AC97_RESET) == 0x0090) 213 if (snd_soc_read(codec, AC97_RESET) == 0x0090)
226 return 1; 214 return 1;
227 } 215 }
228 216
@@ -233,9 +221,9 @@ static int ad1980_reset(struct snd_soc_codec *codec, int try_warm)
233 * case the first nibble of data is eaten by the addr. (Tag is 221 * case the first nibble of data is eaten by the addr. (Tag is
234 * always 16 bit) 222 * always 16 bit)
235 */ 223 */
236 ac97_write(codec, AC97_AD_SERIAL_CFG, 0x9900); 224 snd_soc_write(codec, AC97_AD_SERIAL_CFG, 0x9900);
237 225
238 if (ac97_read(codec, AC97_RESET) == 0x0090) 226 if (snd_soc_read(codec, AC97_RESET) == 0x0090)
239 return 0; 227 return 0;
240 } while (retry_cnt++ < 10); 228 } while (retry_cnt++ < 10);
241 229
@@ -273,12 +261,12 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
273 goto reset_err; 261 goto reset_err;
274 262
275 /* Read out vendor ID to make sure it is ad1980 */ 263 /* Read out vendor ID to make sure it is ad1980 */
276 if (ac97_read(codec, AC97_VENDOR_ID1) != 0x4144) { 264 if (snd_soc_read(codec, AC97_VENDOR_ID1) != 0x4144) {
277 ret = -ENODEV; 265 ret = -ENODEV;
278 goto reset_err; 266 goto reset_err;
279 } 267 }
280 268
281 vendor_id2 = ac97_read(codec, AC97_VENDOR_ID2); 269 vendor_id2 = snd_soc_read(codec, AC97_VENDOR_ID2);
282 270
283 if (vendor_id2 != 0x5370) { 271 if (vendor_id2 != 0x5370) {
284 if (vendor_id2 != 0x5374) { 272 if (vendor_id2 != 0x5374) {
@@ -291,15 +279,15 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
291 } 279 }
292 280
293 /* unmute captures and playbacks volume */ 281 /* unmute captures and playbacks volume */
294 ac97_write(codec, AC97_MASTER, 0x0000); 282 snd_soc_write(codec, AC97_MASTER, 0x0000);
295 ac97_write(codec, AC97_PCM, 0x0000); 283 snd_soc_write(codec, AC97_PCM, 0x0000);
296 ac97_write(codec, AC97_REC_GAIN, 0x0000); 284 snd_soc_write(codec, AC97_REC_GAIN, 0x0000);
297 ac97_write(codec, AC97_CENTER_LFE_MASTER, 0x0000); 285 snd_soc_write(codec, AC97_CENTER_LFE_MASTER, 0x0000);
298 ac97_write(codec, AC97_SURROUND_MASTER, 0x0000); 286 snd_soc_write(codec, AC97_SURROUND_MASTER, 0x0000);
299 287
300 /*power on LFE/CENTER/Surround DACs*/ 288 /*power on LFE/CENTER/Surround DACs*/
301 ext_status = ac97_read(codec, AC97_EXTENDED_STATUS); 289 ext_status = snd_soc_read(codec, AC97_EXTENDED_STATUS);
302 ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800); 290 snd_soc_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800);
303 291
304 return 0; 292 return 0;
305 293