diff options
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/acpi.c | 14 | ||||
-rw-r--r-- | sys/dev/acpi/acpibtn.c | 12 |
2 files changed, 9 insertions, 17 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 0cb42a8fa16..5e52dfc3df9 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.39 2006/02/21 16:51:30 marco Exp $ */ +/* $OpenBSD: acpi.c,v 1.40 2006/02/22 19:30:45 jordan Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -1242,22 +1242,18 @@ acpi_isr_thread(void *arg) if (sc->sc_powerbtn) { sc->sc_powerbtn = 0; - if (sc->sc_pbtndev) - aml_notify(sc->sc_pbtndev, 0x80); + aml_notify_dev(ACPI_DEV_PBD, 0x80); + acpi_evindex++; dnprintf(1,"power button pressed\n"); KNOTE(sc->sc_note, ACPI_EVENT_COMPOSE(ACPI_EV_PWRBTN, acpi_evindex)); - - /* power down */ - acpi_s5 = 1; - psignal(initproc, SIGUSR1); } if (sc->sc_sleepbtn) { sc->sc_sleepbtn = 0; - if (sc->sc_sbtndev) - aml_notify(sc->sc_sbtndev, 0x80); + aml_notify_dev(ACPI_DEV_SBD, 0x80); + acpi_evindex++; dnprintf(1,"sleep button pressed\n"); KNOTE(sc->sc_note, ACPI_EVENT_COMPOSE(ACPI_EV_SLPBTN, diff --git a/sys/dev/acpi/acpibtn.c b/sys/dev/acpi/acpibtn.c index d3b30fb7828..de1e382eb25 100644 --- a/sys/dev/acpi/acpibtn.c +++ b/sys/dev/acpi/acpibtn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpibtn.c,v 1.7 2006/02/21 20:53:31 marco Exp $ */ +/* $OpenBSD: acpibtn.c,v 1.8 2006/02/22 19:30:45 jordan Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * @@ -87,20 +87,16 @@ acpibtn_attach(struct device *parent, struct device *self, void *aux) if (!strcmp(aa->aaa_dev, ACPI_DEV_LD)) sc->sc_btn_type = ACPIBTN_LID; - if (!strcmp(aa->aaa_dev, ACPI_DEV_PBD)) { + if (!strcmp(aa->aaa_dev, ACPI_DEV_PBD)) sc->sc_btn_type = ACPIBTN_POWER; - sc->sc_acpi->sc_pbtndev = sc->sc_devnode; - } - if (!strcmp(aa->aaa_dev, ACPI_DEV_SBD)) { + if (!strcmp(aa->aaa_dev, ACPI_DEV_SBD)) sc->sc_btn_type = ACPIBTN_SLEEP; - sc->sc_acpi->sc_sbtndev = sc->sc_devnode; - } acpibtn_getsta(sc); printf(": %s\n", sc->sc_devnode->parent->name); - aml_register_notify(sc->sc_devnode->parent, acpibtn_notify, sc); + aml_register_notify(sc->sc_devnode->parent, aa->aaa_dev, acpibtn_notify, sc); } int |