Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi After consulting jmcneill@, set the state to D0...



details:   https://anonhg.NetBSD.org/src/rev/c4388808929d
branches:  trunk
changeset: 760625:c4388808929d
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sun Jan 09 15:43:20 2011 +0000

description:
After consulting jmcneill@, set the state to D0 ("on") upon shutdown and
detach. A safety measure so that we do not accidentally fry anything.

diffstat:

 sys/dev/acpi/acpi_fan.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r f403b2936ca0 -r c4388808929d sys/dev/acpi/acpi_fan.c
--- a/sys/dev/acpi/acpi_fan.c   Sun Jan 09 15:12:33 2011 +0000
+++ b/sys/dev/acpi/acpi_fan.c   Sun Jan 09 15:43:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_fan.c,v 1.1 2011/01/09 15:12:34 jruoho Exp $ */
+/*     $NetBSD: acpi_fan.c,v 1.2 2011/01/09 15:43:20 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_fan.c,v 1.1 2011/01/09 15:12:34 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_fan.c,v 1.2 2011/01/09 15:43:20 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/module.h>
@@ -112,6 +112,9 @@
 {
        struct acpifan_softc *sc = device_private(self);
 
+       if (sc->sc_state != ACPI_STATE_ERROR)
+               (void)acpi_power_set(sc->sc_node->ad_handle, ACPI_STATE_D0);
+
        pmf_device_deregister(self);
        acpi_power_deregister(sc->sc_node->ad_handle);
 
@@ -152,7 +155,7 @@
        struct acpifan_softc *sc = device_private(self);
 
        if (sc->sc_state != ACPI_STATE_ERROR)
-               (void)acpi_power_set(sc->sc_node->ad_handle, ACPI_STATE_D3);
+               (void)acpi_power_set(sc->sc_node->ad_handle, ACPI_STATE_D0);
 
        return true;
 }



Home | Main Index | Thread Index | Old Index