Skip unconnected pins when creating a selector connlist.

This commit is contained in:
jmcneill 2008-08-15 11:22:59 +00:00
parent 8c66a4c56f
commit 750f206837
1 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: azalia_codec.c,v 1.68 2008/08/14 23:43:27 jmcneill Exp $ */
/* $NetBSD: azalia_codec.c,v 1.69 2008/08/15 11:22:59 jmcneill Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.68 2008/08/14 23:43:27 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.69 2008/08/15 11:22:59 jmcneill Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -639,8 +639,15 @@ generic_mixer_init(codec_t *this)
d->mixer_class = AZ_CLASS_OUTPUT;
m->target = MI_TARGET_CONNLIST;
for (j = 0, k = 0; j < w->nconnections && k < 32; j++) {
uint8_t conn;
if (!VALID_WIDGET_NID(w->connections[j], this))
continue;
/* skip unconnected pins */
PIN_STATUS(&this->w[w->connections[j]],
conn);
if (conn == 1)
continue;
GMIDPRINTF(("%s: selector %d=%s\n", __func__, j,
this->w[w->connections[j]].name));
d->un.e.member[k].ord = j;