From 5c5967082fddbde704f1ec0d3511dc53a1491150 Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Thu, 11 Sep 2003 03:17:33 +0000 Subject: [PATCH] Add a system notify handler in addition to the device notify handler. At least some Toshiba notebooks use a Notify of 0 or 1 for this. PR: Submitted by: Hiroyuki Aizu --- sys/dev/acpica/acpi_cmbat.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c index 1b4f85b50a1e..9ca5989038fe 100644 --- a/sys/dev/acpica/acpi_cmbat.c +++ b/sys/dev/acpica/acpi_cmbat.c @@ -296,9 +296,11 @@ acpi_cmbat_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) return; switch (notify) { + case ACPI_NOTIFY_DEVICE_CHECK: case ACPI_BATTERY_BST_CHANGE: timespecclear(&sc->bst_lastupdated); break; + case ACPI_NOTIFY_BUS_CHECK: case ACPI_BATTERY_BIF_CHANGE: timespecclear(&sc->bif_lastupdated); AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_cmbat_get_bif, dev); @@ -331,6 +333,13 @@ acpi_cmbat_attach(device_t dev) return (ENXIO); handle = acpi_get_handle(dev); + + /* + * Install a system notify handler in addition to the device notify. + * Toshiba notebook uses this alternate notify for its battery. + */ + AcpiInstallNotifyHandler(handle, ACPI_SYSTEM_NOTIFY, + acpi_cmbat_notify_handler, dev); AcpiInstallNotifyHandler(handle, ACPI_DEVICE_NOTIFY, acpi_cmbat_notify_handler, dev);