diff options
author | Sean Bruno <sbruno@FreeBSD.org> | 2019-07-17 04:13:46 +0000 |
---|---|---|
committer | Sean Bruno <sbruno@FreeBSD.org> | 2019-07-17 04:13:46 +0000 |
commit | fceeeec75ff6093ff0ac5b0cd9cdc9eb677ac979 (patch) | |
tree | a4491a0c5d64fbdd8866dd9d486bd2d83b8a4744 /sys | |
parent | 31b67520d4b9259e5c564b929724cdf04608570b (diff) | |
download | src-fceeeec75ff6093ff0ac5b0cd9cdc9eb677ac979.tar.gz src-fceeeec75ff6093ff0ac5b0cd9cdc9eb677ac979.zip |
I add the ability to accept the default pin widget configuration to help
with various laptops using hdaa(4) sound devices. We don't seem to know
the "correct" configurations for these devices and the defaults are far
superiour, e.g. they work if you don't nuke the default configs.
PR: 200526
Differential Revision: https://reviews.freebsd.org/D17772
Notes
Notes:
svn path=/head/; revision=350078
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/pci/hda/hdaa.c | 16 | ||||
-rw-r--r-- | sys/dev/sound/pci/hda/hdaa.h | 1 |
2 files changed, 12 insertions, 5 deletions
diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index 31c1c1f4ed90..5a926a125de5 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -5034,11 +5034,13 @@ hdaa_audio_prepare_pin_ctrl(struct hdaa_devinfo *devinfo) pincap = w->wclass.pin.cap; /* Disable everything. */ - w->wclass.pin.ctrl &= ~( - HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | - HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); + if (devinfo->init_clear) { + w->wclass.pin.ctrl &= ~( + HDA_CMD_SET_PIN_WIDGET_CTRL_HPHN_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_IN_ENABLE | + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK); + } if (w->enable == 0) { /* Pin is unused so left it disabled. */ @@ -6671,6 +6673,10 @@ hdaa_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "reconfig", CTLTYPE_INT | CTLFLAG_RW, dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "init_clear", CTLFLAG_RW, + &devinfo->init_clear, 1,"Clear initial pin widget configuration"); bus_generic_attach(dev); return (0); } diff --git a/sys/dev/sound/pci/hda/hdaa.h b/sys/dev/sound/pci/hda/hdaa.h index ca6b30d750d0..4fdc3fcead26 100644 --- a/sys/dev/sound/pci/hda/hdaa.h +++ b/sys/dev/sound/pci/hda/hdaa.h @@ -214,6 +214,7 @@ struct hdaa_devinfo { struct hdaa_chan *chans; struct callout poll_jack; int poll_ival; + uint32_t init_clear; }; #define HDAA_CHN_RUNNING 0x00000001 |