summaryrefslogtreecommitdiff
path: root/sys/dev/pci/azalia_codec.c
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2010-08-23 15:48:25 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2010-08-23 15:48:25 +0000
commit944ea1db1f2b0ee7394e86caf04bd553cdb34040 (patch)
tree2bc69952da4270efeb10313c2f11b26503eedd8e /sys/dev/pci/azalia_codec.c
parent1b77cf8f74813f3933db369fb02573e3c20754d4 (diff)
* if there's an error setting indirect more for a volume knob widget,
don't return the error back to the caller, but also don't turn on unsolicited responses for the volume knob. chances are, it isn't acutally used. lets sony viao tz play audio through suspend/resume cycle. * add some debug messages for other volume knob errors.
Diffstat (limited to 'sys/dev/pci/azalia_codec.c')
-rw-r--r--sys/dev/pci/azalia_codec.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c
index 387b0998dac..ee9b446714d 100644
--- a/sys/dev/pci/azalia_codec.c
+++ b/sys/dev/pci/azalia_codec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia_codec.c,v 1.149 2010/08/08 05:25:30 jakemsr Exp $ */
+/* $OpenBSD: azalia_codec.c,v 1.150 2010/08/23 15:48:24 jakemsr Exp $ */
/* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */
/*-
@@ -1421,8 +1421,10 @@ azalia_codec_enable_unsol(codec_t *this)
w = &this->w[this->playvols.master];
err = azalia_comresp(this, w->nid, CORB_GET_VOLUME_KNOB,
0, &result);
- if (err)
+ if (err) {
+ DPRINTF(("%s: get volume knob error\n", __func__));
return err;
+ }
/* current level */
this->playvols.hw_step = CORB_VKNOB_VOLUME(result);
@@ -1432,15 +1434,25 @@ azalia_codec_enable_unsol(codec_t *this)
result &= ~(CORB_VKNOB_DIRECT);
err = azalia_comresp(this, w->nid, CORB_SET_VOLUME_KNOB,
result, NULL);
- if (err)
- return err;
+ if (err) {
+ DPRINTF(("%s: set volume knob error\n", __func__));
+ /* XXX If there was an error setting indirect
+ * mode, do not return an error. However, do not
+ * enable unsolicited responses either. Most
+ * likely the volume knob doesn't work right.
+ * Perhaps it's simply not wired/enabled.
+ */
+ return 0;
+ }
/* enable unsolicited responses */
result = CORB_UNSOL_ENABLE | AZ_TAG_PLAYVOL;
err = azalia_comresp(this, w->nid,
CORB_SET_UNSOLICITED_RESPONSE, result, NULL);
- if (err)
+ if (err) {
+ DPRINTF(("%s: set vknob unsol resp error\n", __func__));
return err;
+ }
}
return 0;