aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ac97/ac97_codec.c
diff options
context:
space:
mode:
authorLiam Girdwood <liam.girdwood@wolfsonmicro.com>2005-07-29 05:41:55 -0400
committerJaroslav Kysela <perex@suse.cz>2005-08-30 02:43:05 -0400
commit3998b70fd0ab40a276147a0f55816d383fcbeb54 (patch)
treef2730dcfca4393a29f24dc3c89724d7f8fc8ddde /sound/pci/ac97/ac97_codec.c
parent1fdab81e675c6ef76a49b8aabb7eaf4be51d1b80 (diff)
[ALSA] WM97xx AC97 codec controls
AC97 Codec o Enhanced current WM97xx support to provide additional controls and use the kcontrol suffix naming convention. o Added AC97_HAS_NO_MIC, AC97_HAS_NO_TONE and AC97_HAS_NO_STD_PCM. o Cleaned up WM97xx related comments. o Removed some wm9713 double mono controls and replaced with stereo controls. Signed-off-by: Liam Girdwood <liam.girdwood@wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ac97/ac97_codec.c')
-rw-r--r--sound/pci/ac97/ac97_codec.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 6983eea226da..cbf790270c30 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -1307,16 +1307,18 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
1307 } 1307 }
1308 1308
1309 /* build master tone controls */ 1309 /* build master tone controls */
1310 if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_TONE)) { 1310 if (!(ac97->flags & AC97_HAS_NO_TONE)) {
1311 for (idx = 0; idx < 2; idx++) { 1311 if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_TONE)) {
1312 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_tone[idx], ac97))) < 0) 1312 for (idx = 0; idx < 2; idx++) {
1313 return err; 1313 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_tone[idx], ac97))) < 0)
1314 if (ac97->id == AC97_ID_YMF753) { 1314 return err;
1315 kctl->private_value &= ~(0xff << 16); 1315 if (ac97->id == AC97_ID_YMF753) {
1316 kctl->private_value |= 7 << 16; 1316 kctl->private_value &= ~(0xff << 16);
1317 kctl->private_value |= 7 << 16;
1318 }
1317 } 1319 }
1320 snd_ac97_write_cache(ac97, AC97_MASTER_TONE, 0x0f0f);
1318 } 1321 }
1319 snd_ac97_write_cache(ac97, AC97_MASTER_TONE, 0x0f0f);
1320 } 1322 }
1321 1323
1322 /* build PC Speaker controls */ 1324 /* build PC Speaker controls */
@@ -1339,11 +1341,13 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
1339 } 1341 }
1340 1342
1341 /* build MIC controls */ 1343 /* build MIC controls */
1342 if (snd_ac97_try_volume_mix(ac97, AC97_MIC)) { 1344 if (!(ac97->flags & AC97_HAS_NO_MIC)) {
1343 if ((err = snd_ac97_cmix_new(card, "Mic Playback", AC97_MIC, ac97)) < 0) 1345 if (snd_ac97_try_volume_mix(ac97, AC97_MIC)) {
1344 return err; 1346 if ((err = snd_ac97_cmix_new(card, "Mic Playback", AC97_MIC, ac97)) < 0)
1345 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_mic_boost, ac97))) < 0) 1347 return err;
1346 return err; 1348 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_mic_boost, ac97))) < 0)
1349 return err;
1350 }
1347 } 1351 }
1348 1352
1349 /* build Line controls */ 1353 /* build Line controls */
@@ -1402,12 +1406,14 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
1402 } 1406 }
1403 snd_ac97_write_cache(ac97, AC97_PCM, init_val); 1407 snd_ac97_write_cache(ac97, AC97_PCM, init_val);
1404 } else { 1408 } else {
1405 if (ac97->flags & AC97_HAS_NO_PCM_VOL) 1409 if (!(ac97->flags & AC97_HAS_NO_STD_PCM)) {
1406 err = snd_ac97_cmute_new(card, "PCM Playback Switch", AC97_PCM, ac97); 1410 if (ac97->flags & AC97_HAS_NO_PCM_VOL)
1407 else 1411 err = snd_ac97_cmute_new(card, "PCM Playback Switch", AC97_PCM, ac97);
1408 err = snd_ac97_cmix_new(card, "PCM Playback", AC97_PCM, ac97); 1412 else
1409 if (err < 0) 1413 err = snd_ac97_cmix_new(card, "PCM Playback", AC97_PCM, ac97);
1410 return err; 1414 if (err < 0)
1415 return err;
1416 }
1411 } 1417 }
1412 1418
1413 /* build Capture controls */ 1419 /* build Capture controls */