diff options
author | Ariff Abdullah <ariff@FreeBSD.org> | 2007-10-26 20:49:59 +0000 |
---|---|---|
committer | Ariff Abdullah <ariff@FreeBSD.org> | 2007-10-26 20:49:59 +0000 |
commit | 554314911cee72b5cebdbbe72f612d07690565c9 (patch) | |
tree | c2b5c47f7f2534437764e7d72d39b91bc3df2a0b /sys/dev/sound/pcm/ac97.c | |
parent | f29120c085d47db057be0b73ac322502d93f53e3 (diff) | |
download | src-554314911cee72b5cebdbbe72f612d07690565c9.tar.gz src-554314911cee72b5cebdbbe72f612d07690565c9.zip |
Remap and virtualize mixer controls for HP nx6110 with
AD1981B AC97 codec, unifying master volume control.
* Remap "phout" --> SOUND_MIXER_VOLUME (internal speakers)
* Virtual "vol" --> { "phout", "ogain" (headphone) }
Tested by: Frederic Chardon
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=173039
Diffstat (limited to 'sys/dev/sound/pcm/ac97.c')
-rw-r--r-- | sys/dev/sound/pcm/ac97.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c index 9fcad10be506..22c14e81dd86 100644 --- a/sys/dev/sound/pcm/ac97.c +++ b/sys/dev/sound/pcm/ac97.c @@ -932,10 +932,12 @@ ac97mix_init(struct snd_mixer *m) switch (codec->id) { case 0x41445374: /* AD1981B */ - if (codec->subvendor == 0x02d91014) { + switch (codec->subvendor) { + case 0x02d91014: /* * IBM Thinkcentre: - * Tie "ogain" and "phone" to "vol" since its + * + * Tie "ogain" and "phout" to "vol" since its * master volume is basically useless and can't * control anything. */ @@ -953,6 +955,28 @@ ac97mix_init(struct snd_mixer *m) mix_setrealdev(m, SOUND_MIXER_VOLUME, SOUND_MIXER_NONE); } + break; + case 0x099c103c: + /* + * HP nx6110: + * + * By default, "vol" is controlling internal speakers + * (not a master volume!) and "ogain" is controlling + * headphone. Enable dummy "phout" so it can be + * remapped to internal speakers and virtualize + * "vol" to control both. + */ + codec->mix[SOUND_MIXER_OGAIN].enable = 1; + codec->mix[SOUND_MIXER_PHONEOUT].enable = 1; + mix_setrealdev(m, SOUND_MIXER_PHONEOUT, + SOUND_MIXER_VOLUME); + mix_setrealdev(m, SOUND_MIXER_VOLUME, + SOUND_MIXER_NONE); + mix_setparentchild(m, SOUND_MIXER_VOLUME, + SOUND_MASK_OGAIN | SOUND_MASK_PHONEOUT); + break; + default: + break; } break; case 0x434d4941: /* CMI9738 */ |