summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakemsr <jakemsr@openbsd.org>2009-04-24 16:27:38 +0000
committerjakemsr <jakemsr@openbsd.org>2009-04-24 16:27:38 +0000
commit3c3b6ea250070bb55a60d125ab3ff060bea0970a (patch)
tree92ec513c26f229ed698559cdd0165a1753dcc314
parentuse the direction/association/sequence ordered lists of i/o pins to (diff)
downloadwireguard-openbsd-3c3b6ea250070bb55a60d125ab3ff060bea0970a.tar.xz
wireguard-openbsd-3c3b6ea250070bb55a60d125ab3ff060bea0970a.zip
the internal/fixed speaker is special. the dac it connects to
by default might not be in a converter group. make sure such a dac is not disabled and gets a meaningful name.
-rw-r--r--sys/dev/pci/azalia.c7
-rw-r--r--sys/dev/pci/azalia_codec.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index beb619830d4..9c5bf0fab2f 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.121 2009/04/24 16:02:17 jakemsr Exp $ */
+/* $OpenBSD: azalia.c,v 1.122 2009/04/24 16:27:38 jakemsr Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -2361,6 +2361,11 @@ azalia_widget_label_widgets(codec_t *codec)
break;
}
}
+ if (j == codec->dacs.groups[0].nconv &&
+ w->nid == codec->spkr_dac) {
+ snprintf(w->name, sizeof(w->name), "%s%d",
+ wtypes[w->type], j + 1);
+ }
if (codec->dacs.ngroups < 2)
break;
for (j = 0; j < codec->dacs.groups[1].nconv; j++) {
diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c
index d58cfe61e30..4679a8e743f 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.116 2009/04/24 16:18:23 jakemsr Exp $ */
+/* $OpenBSD: azalia_codec.c,v 1.117 2009/04/24 16:27:38 jakemsr Exp $ */
/* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */
/*-
@@ -367,12 +367,18 @@ done:
group->ngroups++;
}
+ /* Disable converters that aren't in a convgroup and aren't the
+ * speaker dac.
+ */
for (i = 0; i < nall_convs; i++) {
+ conv = all_convs[i];
+ if (this->spkr_dac == conv)
+ continue;
for (j = 0; j < nconvs; j++)
- if (convs[j] == all_convs[i])
+ if (convs[j] == conv)
break;
if (j == nconvs)
- this->w[all_convs[i]].enable = 0;
+ this->w[conv].enable = 0;
}
return 0;