diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-12-31 12:47:31 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-12-31 12:47:31 +0000 |
commit | e9752d163533429190145e2f552a1a4dbddd1c8a (patch) | |
tree | 6a74ed2d37d87023361f3223d16ca6d53c39c2fc /sys/dev/pci/azalia.c | |
parent | 1509944c1b6be222482afb1c9fe49e89df83a48f (diff) |
actually find the speakers and headphones
Diffstat (limited to 'sys/dev/pci/azalia.c')
-rw-r--r-- | sys/dev/pci/azalia.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index 9460f2de206..10418dfab01 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.101 2008/12/31 11:54:55 jakemsr Exp $ */ +/* $OpenBSD: azalia.c,v 1.102 2008/12/31 12:47:30 jakemsr Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -2130,6 +2130,27 @@ azalia_widget_init_pin(widget_t *this, const codec_t *codec) wcodec->nsense_pins++; } } + + if (this->d.pin.device == CORB_CD_HEADPHONE && + (this->d.pin.cap & COP_PINCAP_OUTPUT) && + (CORB_CD_PORT(this->d.pin.config) == CORB_CD_JACK || + CORB_CD_PORT(this->d.pin.config) == CORB_CD_BOTH)) { + if (codec->headphones == -1 || + (this->d.pin.association < + codec->w[codec->headphones].d.pin.association)) + wcodec->headphones = this->nid; + } + + if (this->d.pin.device == CORB_CD_SPEAKER && + (this->d.pin.cap & COP_PINCAP_OUTPUT) && + (CORB_CD_PORT(this->d.pin.config) == CORB_CD_FIXED || + CORB_CD_PORT(this->d.pin.config) == CORB_CD_BOTH)) { + if (codec->speaker == -1 || + (this->d.pin.association < + codec->w[codec->speaker].d.pin.association)) + wcodec->speaker = this->nid; + } + return 0; } |