Reset the mixer when resume from suspend.

This is required on some laptops with a buggy APM BIOS.
Code from Inoue Yoshinari <pf5y-inue@asahi-net.or.jp>.
This commit is contained in:
minoura 2001-02-22 15:23:31 +00:00
parent 79d20d7c7a
commit 8353ca15cc
1 changed files with 22 additions and 1 deletions

View File

@ -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