Power Management Hook

esm_powerhook();
This commit is contained in:
ichiro 2001-02-12 23:56:40 +00:00
parent a898cb6cb0
commit 357d9efda4
2 changed files with 31 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: esm.c,v 1.6 2001/01/26 10:04:43 rh Exp $ */
/* $NetBSD: esm.c,v 1.7 2001/02/12 23:56:40 ichiro Exp $ */
/*-
* Copyright (c) 2000, 2001 Rene Hexel <rh@netbsd.org>
@ -38,7 +38,6 @@
* - recording
* - MIDI support
* - joystick support
* - power management hooks
*
*
* Credits:
@ -137,6 +136,9 @@ static void set_timer(struct esm_softc *);
static void esmch_set_format(struct esm_chinfo *,
struct audio_params *p);
/* Power Management */
void esm_powerhook(int, void *);
struct cfattach esm_ca = {
sizeof(struct esm_softc), esm_match, esm_attach
};
@ -1402,6 +1404,28 @@ esm_attach(struct device *parent, struct device *self, void *aux)
return;
audio_attach_mi(&esm_hw_if, self, &ess->sc_dev);
ess->esm_suspend = PWR_RESUME;
ess->esm_powerhook = powerhook_establish(esm_powerhook, ess);
}
/* Power Hook */
void
esm_powerhook(why, v)
int why;
void *v;
{
struct esm_softc *ess = (struct esm_softc *)v;
DPRINTF(ESM_DEBUG_PARAM,
("%s: ESS maestro 2E why=%d\n", ess->sc_dev.dv_xname, why));
switch (why) {
case PWR_RESUME:
/* esm_resume() */
/* printf ("esm resumed\n"); */
ess->esm_suspend = why;
break;
}
}
#if 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: esmvar.h,v 1.3 2001/01/18 17:48:04 tv Exp $ */
/* $NetBSD: esmvar.h,v 1.4 2001/02/12 23:56:40 ichiro Exp $ */
/*-
* Copyright (c) 2000, 2001 Rene Hexel <rh@netbsd.org>
@ -112,6 +112,10 @@ struct esm_softc {
void (*sc_rintr)(void *);
void *sc_rarg;
/* Power Management */
char esm_suspend;
void *esm_powerhook;
};
struct esm_quirks {