Commit 3998b70f authored by Liam Girdwood's avatar Liam Girdwood Committed by Jaroslav Kysela

[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: default avatarLiam Girdwood <liam.girdwood@wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 1fdab81e
...@@ -374,6 +374,9 @@ ...@@ -374,6 +374,9 @@
#define AC97_HAS_NO_PC_BEEP (1<<12) /* no PC Beep volume */ #define AC97_HAS_NO_PC_BEEP (1<<12) /* no PC Beep volume */
#define AC97_HAS_NO_VIDEO (1<<13) /* no Video volume */ #define AC97_HAS_NO_VIDEO (1<<13) /* no Video volume */
#define AC97_HAS_NO_CD (1<<14) /* no CD volume */ #define AC97_HAS_NO_CD (1<<14) /* no CD volume */
#define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */
#define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */
#define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */
/* rates indexes */ /* rates indexes */
#define AC97_RATES_FRONT_DAC 0 #define AC97_RATES_FRONT_DAC 0
......
...@@ -1307,6 +1307,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97) ...@@ -1307,6 +1307,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
} }
/* build master tone controls */ /* build master tone controls */
if (!(ac97->flags & AC97_HAS_NO_TONE)) {
if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_TONE)) { if (snd_ac97_try_volume_mix(ac97, AC97_MASTER_TONE)) {
for (idx = 0; idx < 2; idx++) { for (idx = 0; idx < 2; idx++) {
if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_tone[idx], ac97))) < 0) if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_tone[idx], ac97))) < 0)
...@@ -1318,6 +1319,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97) ...@@ -1318,6 +1319,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
} }
snd_ac97_write_cache(ac97, AC97_MASTER_TONE, 0x0f0f); snd_ac97_write_cache(ac97, AC97_MASTER_TONE, 0x0f0f);
} }
}
/* build PC Speaker controls */ /* build PC Speaker controls */
if (!(ac97->flags & AC97_HAS_NO_PC_BEEP) && if (!(ac97->flags & AC97_HAS_NO_PC_BEEP) &&
...@@ -1339,12 +1341,14 @@ static int snd_ac97_mixer_build(ac97_t * ac97) ...@@ -1339,12 +1341,14 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
} }
/* build MIC controls */ /* build MIC controls */
if (!(ac97->flags & AC97_HAS_NO_MIC)) {
if (snd_ac97_try_volume_mix(ac97, AC97_MIC)) { if (snd_ac97_try_volume_mix(ac97, AC97_MIC)) {
if ((err = snd_ac97_cmix_new(card, "Mic Playback", AC97_MIC, ac97)) < 0) if ((err = snd_ac97_cmix_new(card, "Mic Playback", AC97_MIC, ac97)) < 0)
return err; return err;
if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_mic_boost, ac97))) < 0) if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_mic_boost, ac97))) < 0)
return err; return err;
} }
}
/* build Line controls */ /* build Line controls */
if (snd_ac97_try_volume_mix(ac97, AC97_LINE)) { if (snd_ac97_try_volume_mix(ac97, AC97_LINE)) {
...@@ -1402,6 +1406,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97) ...@@ -1402,6 +1406,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
} }
snd_ac97_write_cache(ac97, AC97_PCM, init_val); snd_ac97_write_cache(ac97, AC97_PCM, init_val);
} else { } else {
if (!(ac97->flags & AC97_HAS_NO_STD_PCM)) {
if (ac97->flags & AC97_HAS_NO_PCM_VOL) if (ac97->flags & AC97_HAS_NO_PCM_VOL)
err = snd_ac97_cmute_new(card, "PCM Playback Switch", AC97_PCM, ac97); err = snd_ac97_cmute_new(card, "PCM Playback Switch", AC97_PCM, ac97);
else else
...@@ -1409,6 +1414,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97) ...@@ -1409,6 +1414,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
if (err < 0) if (err < 0)
return err; return err;
} }
}
/* build Capture controls */ /* build Capture controls */
if (!(ac97->flags & AC97_HAS_NO_REC_GAIN)) { if (!(ac97->flags & AC97_HAS_NO_REC_GAIN)) {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment