diff options
| author | haya <haya@NetBSD.org> | 2001-04-25 09:20:32 +0000 |
|---|---|---|
| committer | haya <haya@NetBSD.org> | 2001-04-25 09:20:32 +0000 |
| commit | 3d8f9a4f4fba4f155f3a526476951df7fe6d6078 (patch) | |
| tree | b78b0e2031658c8bf24f098dccdf8799748a4dbd /sys/dev | |
| parent | 6dd766a2b6275076980c2c8604111681a18f8388 (diff) | |
Set function-in-use flag before calling power control function in
order to prevent turn on power twice. This change does not prevent
power-off/power-on conflicts.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/cardbus/cardbus.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 20679717dbd..01608da9f9b 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: cardbus.c,v 1.30 2001/03/28 01:55:55 enami Exp $ */ +/* $NetBSD: cardbus.c,v 1.31 2001/04/25 09:20:32 haya Exp $ */ /* * Copyright (c) 1997, 1998, 1999 and 2000 @@ -671,6 +671,12 @@ enable_function(struct cardbus_softc *sc, int cdstatus, int function) if (sc->sc_poweron_func == 0) { /* switch to 3V and/or wait for power to stabilize */ if (cdstatus & CARDBUS_3V_CARD) { + /* + * sc_poweron_func must be substituted before + * entering sleep, in order to avoid turn on + * power twice. + */ + sc->sc_poweron_func |= (1 << function); (*sc->sc_cf->cardbus_power)(sc->sc_cc, CARDBUS_VCC_3V); } else { /* No cards other than 3.3V cards. */ |
