From 6fd6d0214b92a494e4bc65d7f07bbce0b5c32e7a Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 12 Aug 2024 17:24:58 +0000 Subject: [PATCH] Revert the guts of rev 1.14. This ends up attempting to turn of power resources for devices that aren't present. And that makes us run AML that clearly hasn't been tested by the vendors. And on my test laptop this no longer seems to make a meaningful difference in the power consumption during suspend-to-idle. ok deraadt@ --- sys/dev/acpi/acpipwrres.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/sys/dev/acpi/acpipwrres.c b/sys/dev/acpi/acpipwrres.c index 0955c62ed8f..1a606306c6d 100644 --- a/sys/dev/acpi/acpipwrres.c +++ b/sys/dev/acpi/acpipwrres.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpipwrres.c,v 1.15 2024/08/02 09:28:35 kettenis Exp $ */ +/* $OpenBSD: acpipwrres.c,v 1.16 2024/08/12 17:24:58 kettenis Exp $ */ /* * Copyright (c) 2013 Martin Pieuchot @@ -33,7 +33,6 @@ int acpipwrres_match(struct device *, void *, void *); void acpipwrres_attach(struct device *, struct device *, void *); -int acpipwrres_activate(struct device *, int); #ifdef ACPIPWRRES_DEBUG #define DPRINTF(x) printf x @@ -67,8 +66,7 @@ struct acpipwrres_consumer { }; const struct cfattach acpipwrres_ca = { - sizeof(struct acpipwrres_softc), acpipwrres_match, acpipwrres_attach, - NULL, acpipwrres_activate + sizeof(struct acpipwrres_softc), acpipwrres_match, acpipwrres_attach }; struct cfdriver acpipwrres_cd = { @@ -142,23 +140,6 @@ acpipwrres_attach(struct device *parent, struct device *self, void *aux) printf("\n"); } -int -acpipwrres_activate(struct device *self, int act) -{ - struct acpipwrres_softc *sc = (struct acpipwrres_softc *)self; - - switch (act) { - case DVACT_POWERDOWN: - if (sc->sc_cons_ref == 0 && sc->sc_state != ACPIPWRRES_OFF) { - aml_evalname(sc->sc_acpi, sc->sc_devnode, "_OFF", 0, - NULL, NULL); - sc->sc_state = ACPIPWRRES_OFF; - } - break; - } - return 0; -} - int acpipwrres_ref_incr(struct acpipwrres_softc *sc, struct aml_node *node) { -- 2.20.1