No need to call pci_set_powerstate from our powerhook, the bus handles this

for us now.
This commit is contained in:
jmcneill 2006-09-25 23:11:07 +00:00
parent 8e37d48dc1
commit 1d83a2dea6
3 changed files with 6 additions and 36 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: auich.c,v 1.112 2006/09/24 03:53:09 jmcneill Exp $ */
/* $NetBSD: auich.c,v 1.113 2006/09/25 23:11:07 jmcneill Exp $ */
/*-
* Copyright (c) 2000, 2004, 2005 The NetBSD Foundation, Inc.
@ -118,7 +118,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.112 2006/09/24 03:53:09 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.113 2006/09/25 23:11:07 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1614,7 +1614,6 @@ static void
auich_powerhook(int why, void *addr)
{
struct auich_softc *sc;
int rv;
sc = (struct auich_softc *)addr;
switch (why) {
@ -1635,15 +1634,6 @@ auich_powerhook(int why, void *addr)
if (sc->sc_ih != NULL)
pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
rv = pci_get_powerstate(sc->sc_pc, sc->sc_pt, &sc->sc_powerstate);
if (rv)
aprint_error("%s: unable to get power state (err=%d)\n",
sc->sc_dev.dv_xname, rv);
rv = pci_set_powerstate(sc->sc_pc, sc->sc_pt, PCI_PMCSR_STATE_D3);
if (rv)
aprint_error("%s: unable to set power state (err=%d)\n",
sc->sc_dev.dv_xname, rv);
break;
case PWR_RESUME:
@ -1656,11 +1646,6 @@ auich_powerhook(int why, void *addr)
return;
}
rv = pci_set_powerstate(sc->sc_pc, sc->sc_pt, sc->sc_powerstate);
if (rv)
aprint_error("%s: unable to set power state (err=%d)\n",
sc->sc_dev.dv_xname, rv);
sc->sc_ih = pci_intr_establish(sc->sc_pc, sc->intrh, IPL_AUDIO,
auich_intr, sc);
if (sc->sc_ih == NULL) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: esa.c,v 1.37 2006/09/24 14:26:50 jmcneill Exp $ */
/* $NetBSD: esa.c,v 1.38 2006/09/25 23:19:39 jmcneill Exp $ */
/*
* Copyright (c) 2001, 2002, 2006 Jared D. McNeill <jmcneill@invisible.ca>
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.37 2006/09/24 14:26:50 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.38 2006/09/25 23:19:39 jmcneill Exp $");
#include <sys/types.h>
#include <sys/errno.h>
@ -1662,7 +1662,6 @@ esa_suspend(struct esa_softc *sc)
bus_space_tag_t iot;
bus_space_handle_t ioh;
int i, index;
int error;
iot = sc->sc_iot;
ioh = sc->sc_ioh;
@ -1683,10 +1682,6 @@ esa_suspend(struct esa_softc *sc)
sc->savemem[index++] = esa_read_assp(sc,
ESA_MEMTYPE_INTERNAL_DATA, i);
if ((error = pci_set_powerstate(sc->sc_pct, sc->sc_tag,
PCI_PMCSR_STATE_D3)))
return error;
return 0;
}
@ -1697,15 +1692,11 @@ esa_resume(struct esa_softc *sc)
bus_space_handle_t ioh;
int i, index;
uint8_t reset_state;
int error;
iot = sc->sc_iot;
ioh = sc->sc_ioh;
index = 0;
if ((error = pci_set_powerstate(sc->sc_pct, sc->sc_tag,
PCI_PMCSR_STATE_D0)))
return error;
delay(10000);
esa_config(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: esm.c,v 1.38 2006/09/24 13:24:32 jmcneill Exp $ */
/* $NetBSD: esm.c,v 1.39 2006/09/25 23:20:33 jmcneill Exp $ */
/*-
* Copyright (c) 2002, 2003 Matt Fredette
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.38 2006/09/24 13:24:32 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.39 2006/09/25 23:20:33 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1733,7 +1733,6 @@ int
esm_suspend(struct esm_softc *ess)
{
int x;
int error;
x = splaudio();
wp_stoptimer(ess);
@ -1748,8 +1747,6 @@ esm_suspend(struct esm_softc *ess)
delay(20);
bus_space_write_4(ess->st, ess->sh, PORT_RINGBUS_CTRL, 0);
delay(1);
if ((error = pci_set_powerstate(ess->pc, ess->tag, PCI_PMCSR_STATE_D3)))
return error;
return 0;
}
@ -1758,11 +1755,8 @@ int
esm_resume(struct esm_softc *ess)
{
int x;
int error;
uint16_t pcmbar;
if ((error = pci_set_powerstate(ess->pc, ess->tag, PCI_PMCSR_STATE_D0)))
return error;
delay(100000);
esm_init(ess);