From 85e207a4e7cf1f7393ce10562683b662d3c23af7 Mon Sep 17 00:00:00 2001 From: Jacob Meuser Date: Fri, 29 May 2009 02:38:02 +0000 Subject: - when a widget will be considered part of a different widget, record the node id of the "parent" widget - initialize widgets' mixer_class ealier --- sys/dev/pci/azalia.c | 7 +++++-- sys/dev/pci/azalia.h | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index ff7f296f1ad..048f456d4ed 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.131 2009/05/12 09:32:28 jakemsr Exp $ */ +/* $OpenBSD: azalia.c,v 1.132 2009/05/29 02:38:01 jakemsr Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -2421,6 +2421,9 @@ azalia_widget_init(widget_t *this, const codec_t *codec, nid_t nid) } this->enable = 1; + this->mixer_class = -1; + this->parent = codec->audiofunc; + switch (this->type) { case COP_AWTYPE_AUDIO_OUTPUT: /* FALLTHROUGH */ @@ -2536,7 +2539,6 @@ azalia_widget_label_widgets(codec_t *codec) FOR_EACH_WIDGET(codec, i) { w = &codec->w[i]; - w->mixer_class = -1; /* default for disabled/unused widgets */ snprintf(w->name, sizeof(w->name), "u-wid%2.2x", w->nid); if (w->enable == 0) @@ -2671,6 +2673,7 @@ azalia_widget_label_widgets(codec_t *codec) "%s", codec->w[j].name); if (codec->w[j].mixer_class == AZ_CLASS_RECORD) codec->w[i].mixer_class = AZ_CLASS_RECORD; + codec->w[i].parent = j; } } diff --git a/sys/dev/pci/azalia.h b/sys/dev/pci/azalia.h index 52d3fafab3b..867b38d3479 100644 --- a/sys/dev/pci/azalia.h +++ b/sys/dev/pci/azalia.h @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.h,v 1.45 2009/05/12 09:32:28 jakemsr Exp $ */ +/* $OpenBSD: azalia.h,v 1.46 2009/05/29 02:38:01 jakemsr Exp $ */ /* $NetBSD: azalia.h,v 1.6 2006/01/16 14:15:26 kent Exp $ */ /*- @@ -531,6 +531,7 @@ typedef struct { int enable; uint32_t widgetcap; int type; /* = bit20-24 of widgetcap */ + nid_t parent; int mixer_class; int nconnections; nid_t *connections; -- cgit v1.2.3