diff options
author | ariff <ariff@FreeBSD.org> | 2007-01-28 03:16:54 +0000 |
---|---|---|
committer | ariff <ariff@FreeBSD.org> | 2007-01-28 03:16:54 +0000 |
commit | 8490eade816b7bbf068f5d7121cc51dc2d810eeb (patch) | |
tree | b3f39b9f614530a518e67993aad7130a2cf55a35 | |
parent | 5003c27b1e54ef768aea2710cd0e5b627d4102c6 (diff) | |
download | FreeBSD-src-8490eade816b7bbf068f5d7121cc51dc2d810eeb.zip FreeBSD-src-8490eade816b7bbf068f5d7121cc51dc2d810eeb.tar.gz |
Add speaker control for HP xw4300. This hardware doesn't respond to
unsolicited pin sense event and need manual control to turn off speaker
volume while attaching headphone.
Tested by: Ingeborg Hellemo <Ingeborg.Hellemo@cc.uit.no>
Disable global Acer + ALC883 headphone automute settings since there are
few models that does not respect this and causing broken behaviour.
Reported/Tested by: Pavel Argentov <argentoff@rtelekom.ru>
-rw-r--r-- | sys/dev/sound/pci/hda/hdac.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index 0d67fb7..ac51abc 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -80,7 +80,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20070105_0038" +#define HDA_DRV_TEST_REV "20070128_0039" #define HDA_WIDGET_PARSER_REV 1 SND_DECLARE_FILE("$FreeBSD$"); @@ -172,6 +172,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HP_NX7400_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x30a2) #define HP_NX6310_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x30aa) #define HP_NX6325_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x30b0) +#define HP_XW4300_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x3013) #define HP_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0xffff) /* What is wrong with XN 2563 anyway? (Got the picture ?) */ #define HP_NX6325_SUBVENDORX 0x103c30b0 @@ -529,8 +530,10 @@ static const struct { 13, { 14, -1 }, -1 }, { LENOVO_ALL_SUBVENDOR, HDA_CODEC_AD1986A, HDAC_HP_SWITCH_CTL, 1, 26, { 27, -1 }, -1 }, +#if 0 { ACER_ALL_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL, 0, 20, { 21, -1 }, -1 }, +#endif }; #define HDAC_HP_SWITCH_LEN \ (sizeof(hdac_hp_switch) / sizeof(hdac_hp_switch[0])) @@ -3607,6 +3610,18 @@ hdac_vendor_patch_parse(struct hdac_devinfo *devinfo) if (w->nid != 5) w->enable = 0; } + if (subvendor == HP_XW4300_SUBVENDOR) { + ctl = hdac_audio_ctl_amp_get(devinfo, 16, 0, 1); + if (ctl != NULL && ctl->widget != NULL) { + ctl->ossmask = SOUND_MASK_SPEAKER; + ctl->widget->ctlflags |= SOUND_MASK_SPEAKER; + } + ctl = hdac_audio_ctl_amp_get(devinfo, 17, 0, 1); + if (ctl != NULL && ctl->widget != NULL) { + ctl->ossmask = SOUND_MASK_SPEAKER; + ctl->widget->ctlflags |= SOUND_MASK_SPEAKER; + } + } break; case HDA_CODEC_ALC861: ctl = hdac_audio_ctl_amp_get(devinfo, 28, 1, 1); @@ -4358,7 +4373,7 @@ hdac_audio_ctl_commit(struct hdac_devinfo *devinfo) printf(" childnid=%d", ctl->childwidget->nid); printf(" Bind to NONE\n"); - } + } ); if (ctl->step > 0) { ctl->ossval = (ctl->left * 100) / ctl->step; |