diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-11-28 21:33:27 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-11-28 21:33:27 +0000 |
commit | bc84b0cc02af4574ab38e7f18685cfbf4d67d9fe (patch) | |
tree | a39c5b2520da69b744087ae726c2c216a1e57ea7 /sys | |
parent | cd7d64dcba4c2305ad008862cb72015f0da459f5 (diff) |
check the jack detect override bit before creating jack sense mixer
items. BIOSes can set the jack detect override bit to tell us that
the jack detection circuirty isn't actually attached.
should remove the _sense controls that never change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/azalia.c | 15 | ||||
-rw-r--r-- | sys/dev/pci/azalia.h | 4 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index 0bf2196ff29..6e41212dd58 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.75 2008/11/27 23:30:58 jakemsr Exp $ */ +/* $OpenBSD: azalia.c,v 1.76 2008/11/28 21:33:26 jakemsr Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -1910,9 +1910,16 @@ azalia_widget_init_pin(widget_t *this, const codec_t *codec) if (codec->nsense_pins < AZ_MAX_SENSE_PINS && this->d.pin.cap & COP_PINCAP_PRESENCE && CORB_CD_PORT(this->d.pin.config) == CORB_CD_JACK) { - wcodec = &codec->az->codecs[codec->az->codecno]; - wcodec->sense_pins[codec->nsense_pins] = this->nid; - wcodec->nsense_pins++; + /* check override bit */ + err = codec->comresp(codec, this->nid, + CORB_GET_CONFIGURATION_DEFAULT, 0, &result); + if (err) + return err; + if (!(CORB_CD_MISC(result) & CORB_CD_PRESENCEOV)) { + wcodec = &codec->az->codecs[codec->az->codecno]; + wcodec->sense_pins[codec->nsense_pins] = this->nid; + wcodec->nsense_pins++; + } } return 0; } diff --git a/sys/dev/pci/azalia.h b/sys/dev/pci/azalia.h index 7d88afab525..154a09a0f76 100644 --- a/sys/dev/pci/azalia.h +++ b/sys/dev/pci/azalia.h @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.h,v 1.23 2008/11/28 04:03:37 jakemsr Exp $ */ +/* $OpenBSD: azalia.h,v 1.24 2008/11/28 21:33:26 jakemsr Exp $ */ /* $NetBSD: azalia.h,v 1.6 2006/01/16 14:15:26 kent Exp $ */ /*- @@ -401,6 +401,8 @@ #define CORB_CD_ASSOCIATION(x) ((x >> 4) & 0xf) #define CORB_CD_ASSOCIATION_MAX 0x0f #define CORB_CD_MISC_MASK 0x00000f00 +#define CORB_CD_MISC(x) ((x >> 8) & 0xf) +#define CORB_CD_PRESENCEOV 0x1 #define CORB_CD_COLOR(x) ((x >> 12) & 0xf) #define CORB_CD_COLOR_UNKNOWN 0x0 #define CORB_CD_BLACK 0x1 |