diff options
author | ariff <ariff@FreeBSD.org> | 2007-10-26 20:49:59 +0000 |
---|---|---|
committer | ariff <ariff@FreeBSD.org> | 2007-10-26 20:49:59 +0000 |
commit | 69326388218cd5b94b8d74edbdb9fac55920faba (patch) | |
tree | c2b5c47f7f2534437764e7d72d39b91bc3df2a0b | |
parent | 99175bc44a99cb62fdc17fd9f872f4878ee472e6 (diff) | |
download | FreeBSD-src-69326388218cd5b94b8d74edbdb9fac55920faba.zip FreeBSD-src-69326388218cd5b94b8d74edbdb9fac55920faba.tar.gz |
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
-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 9fcad10..22c14e8 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 */ |