diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2018-06-24 23:54:23 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2018-06-24 23:54:23 +0000 |
commit | 8dbbb42377b68927a1cafaee7545be6e7f58d52a (patch) | |
tree | d37952ace870bbb194bada5f35a433640432841f /sys | |
parent | c08d7265b2658aae3f5cadd577ea1a34d59aa0ca (diff) |
Save all mixer elements in the suspend/resume array instead of only
enum, sets, and values. This is simpler and less error prone. This
fixes the record.enable elements replacing the last few hardware
mixer controls.
Help from Laurence Tratt, tested by landry@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/audio.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 7bd6247d9a4..840764a2e88 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.171 2018/05/26 10:16:13 ratchov Exp $ */ +/* $OpenBSD: audio.c,v 1.172 2018/06/24 23:54:22 ratchov Exp $ */ /* * Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org> * @@ -1088,20 +1088,13 @@ audio_attach(struct device *parent, struct device *self, void *aux) mi = malloc(sizeof(struct mixer_devinfo), M_TEMP, M_WAITOK); - sc->mix_nent = 0; mi->index = 0; while (1) { if (sc->ops->query_devinfo(sc->arg, mi) != 0) break; - switch (mi->type) { - case AUDIO_MIXER_SET: - case AUDIO_MIXER_ENUM: - case AUDIO_MIXER_VALUE: - sc->mix_nent++; - } mi->index++; } - + sc->mix_nent = mi->index; sc->mix_ents = mallocarray(sc->mix_nent, sizeof(struct mixer_ctrl), M_DEVBUF, M_WAITOK); @@ -1118,9 +1111,9 @@ audio_attach(struct device *parent, struct device *self, void *aux) case AUDIO_MIXER_ENUM: ent->dev = mi->index; ent->type = mi->type; - ent++; } mi->index++; + ent++; } free(mi, M_TEMP, sizeof(struct mixer_devinfo)); |