diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-12-25 00:20:37 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-12-25 00:20:37 +0000 |
commit | ac9c0595ca320fce402857173c2894849b75cecb (patch) | |
tree | 416b15c5935c6fdf35bd6922641b62f29592d79f /sys | |
parent | ed16a696736adfb8beae5642212231c573ffee35 (diff) |
- one "default" direction is enough
- be careful not to set a direction that the pin doesn't support
- remove a workaround in the generic code which is more or less for a
specific device, there are better ways to deal with such situations now
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/azalia.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index a90567a1e09..a962056c5bc 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.93 2008/12/23 09:33:49 jakemsr Exp $ */ +/* $OpenBSD: azalia.c,v 1.94 2008/12/25 00:20:36 jakemsr Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -1911,11 +1911,6 @@ azalia_widget_init_pin(widget_t *this, const codec_t *codec) return err; this->d.pin.cap = result; - if (!(this->d.pin.cap & COP_PINCAP_INPUT)) - pintype = PIN_DIR_OUT; - if (!(this->d.pin.cap & COP_PINCAP_OUTPUT)) - pintype = PIN_DIR_IN; - switch (this->d.pin.device) { case CORB_CD_LINEOUT: case CORB_CD_SPEAKER: @@ -1935,16 +1930,15 @@ azalia_widget_init_pin(widget_t *this, const codec_t *codec) break; } + if (pintype == PIN_DIR_IN && !(this->d.pin.cap & COP_PINCAP_INPUT)) + pintype = PIN_DIR_OUT; + if (pintype == PIN_DIR_OUT && !(this->d.pin.cap & COP_PINCAP_OUTPUT)) + pintype = PIN_DIR_IN; + /* Disable unconnected pins */ if (CORB_CD_PORT(this->d.pin.config) == CORB_CD_NONE) this->enable = 0; - /* Workaround broken machines which have their actual - output on ports marked conn=none (e.g. MacBookPro1,2). - Should not harm correct codec configurations. */ - if (!this->enable) - pintype = PIN_DIR_OUT; - switch (pintype) { case PIN_DIR_IN: codec->comresp(codec, this->nid, CORB_SET_PIN_WIDGET_CONTROL, |