From 8353ca15ccb16aaf7d8af0080126c4bc75187fd3 Mon Sep 17 00:00:00 2001 From: minoura Date: Thu, 22 Feb 2001 15:23:31 +0000 Subject: [PATCH] Reset the mixer when resume from suspend. This is required on some laptops with a buggy APM BIOS. Code from Inoue Yoshinari . --- sys/dev/isa/sbdsp.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c index a8de82808a46..2bef78344d96 100644 --- a/sys/dev/isa/sbdsp.c +++ b/sys/dev/isa/sbdsp.c @@ -1,4 +1,4 @@ -/* $NetBSD: sbdsp.c,v 1.106 2000/06/28 16:27:56 mrg Exp $ */ +/* $NetBSD: sbdsp.c,v 1.107 2001/02/22 15:23:31 minoura Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -228,6 +228,8 @@ static int sbdsp_adjust __P((int, int)); int sbdsp_midi_intr __P((void *)); +static void sbdsp_powerhook __P((int, void*)); + #ifdef AUDIO_DEBUG void sb_printsc __P((struct sbdsp_softc *)); @@ -425,6 +427,25 @@ sbdsp_attach(sc) if (sc->sc_drq16 != -1 && sc->sc_drq16 != sc->sc_drq8) sc->sc_drq16_maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_drq16); + + powerhook_establish (sbdsp_powerhook, sc); +} + +static void +sbdsp_powerhook (why, arg) + int why; + void *arg; +{ + struct sbdsp_softc *sc = arg; + int i; + + if (!sc || why != PWR_RESUME) + return; + + /* Reset the mixer. */ + sbdsp_mix_write(sc, SBP_MIX_RESET, SBP_MIX_RESET); + for (i = 0; i < SB_NDEVS; i++) + sbdsp_set_mixer_gain (sc, i); } void