diff options
author | Deanna Phillips <deanna@cvs.openbsd.org> | 2007-09-10 05:30:15 +0000 |
---|---|---|
committer | Deanna Phillips <deanna@cvs.openbsd.org> | 2007-09-10 05:30:15 +0000 |
commit | 76dfc8621235634d2c3d44715179d170e739abea (patch) | |
tree | 88701529d769acfb480693599dc7293a04e3b19d | |
parent | d30ce321dc4bc7744861a22a8c40019d8fbfea18 (diff) |
Some pin widgets default to off, so make sure they're all enabled, not
just the bidirectional ones.
This could fix some no-sound problems on codecs using the generic
functions.
Code from kent@netbsd
-rw-r--r-- | sys/dev/pci/azalia.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index 06c43d5a2c6..779847ab653 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.30 2007/09/06 22:47:46 deanna Exp $ */ +/* $OpenBSD: azalia.c,v 1.31 2007/09/10 05:30:14 deanna Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -1643,6 +1643,30 @@ azalia_widget_init_pin(widget_t *this, const codec_t *codec) if (err) return err; this->d.pin.cap = result; + + /* input pin */ + if ((this->d.pin.cap & COP_PINCAP_INPUT) && + (this->d.pin.cap & COP_PINCAP_OUTPUT) == 0) { + err = codec->comresp(codec, this->nid, + CORB_GET_PIN_WIDGET_CONTROL, 0, &result); + if (err == 0) { + result &= ~CORB_PWC_OUTPUT; + result |= CORB_PWC_INPUT; + codec->comresp(codec, this->nid, + CORB_SET_PIN_WIDGET_CONTROL, result, NULL); + } + } + /* output pin, or bidirectional pin */ + if (this->d.pin.cap & COP_PINCAP_OUTPUT) { + err = codec->comresp(codec, this->nid, + CORB_GET_PIN_WIDGET_CONTROL, 0, &result); + if (err == 0) { + result &= ~CORB_PWC_INPUT; + result |= CORB_PWC_OUTPUT; + codec->comresp(codec, this->nid, + CORB_SET_PIN_WIDGET_CONTROL, result, NULL); + } + } return 0; } |