convert to pmf(9)

ok jmcneill
This commit is contained in:
cegger 2008-04-11 13:00:47 +00:00
parent 86e129f0e6
commit 8a19ab6bca
1 changed files with 10 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbdsp.c,v 1.129 2008/04/01 20:44:29 xtraeme Exp $ */
/* $NetBSD: sbdsp.c,v 1.130 2008/04/11 13:00:47 cegger Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.129 2008/04/01 20:44:29 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.130 2008/04/11 13:00:47 cegger Exp $");
#include "midi.h"
#include "mpu.h"
@ -231,7 +231,7 @@ static int sbdsp_adjust(int, int);
int sbdsp_midi_intr(void *);
static void sbdsp_powerhook(int, void*);
static bool sbdsp_resume(device_t PMF_FN_PROTO);
#ifdef AUDIO_DEBUG
void sb_printsc(struct sbdsp_softc *);
@ -441,23 +441,19 @@ sbdsp_attach(struct sbdsp_softc *sc)
}
}
powerhook_establish(device_xname(sc->sc_dev), sbdsp_powerhook, sc);
if (!pmf_device_register(sc->sc_dev, NULL, sbdsp_resume))
aprint_error_dev(sc->sc_dev, "couldn't establish power handler\n");
}
static void
sbdsp_powerhook(int why, void *arg)
static bool
sbdsp_resume(device_t dv PMF_FN_ARGS)
{
struct sbdsp_softc *sc;
int i;
sc = arg;
if (!sc || why != PWR_RESUME)
return;
struct sbdsp_softc *sc = device_private(dv);
/* 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);
return true;
}
void