Date: Wed, 24 Sep 2003 08:27:22 -0700 (PDT) From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 38516 for review Message-ID: <200309241527.h8OFRMik084511@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=38516 Change 38516 by jhb@jhb_laptop on 2003/09/24 08:26:54 Add methods to ACPI for getting/setting device power state. Affected files ... .. //depot/projects/power/sys/dev/acpica/acpi.c#2 edit Differences ... ==== //depot/projects/power/sys/dev/acpica/acpi.c#2 (text+ko) ==== @@ -1415,6 +1415,43 @@ } /* + * Get a specified device's power state. + */ +ACPI_STATUS +acpi_GetPowerState(ACPI_HANDLE handle, int *state) +{ + + return (acpi_EvaluateInteger(handle, "_PSC", state); +} + +/* + * Set a specified device's power state. + */ +ACPI_STATUS +acpi_SetPowerState(ACPI_HANDLE handle, int state) +{ + char *method; + + switch (state) { + case ACPI_STATE_D0: + method = "_PS0"; + break; + case ACPI_STATE_D1: + method = "_PS1"; + break; + case ACPI_STATE_D2: + method = "_PS2"; + break; + case ACPI_STATE_D3: + method = "_PS3"; + break; + default: + return (AE_BAD_PARAMETER); + } + return (AcpiEvaluateObject(handle, method, NULL, NULL); +} + +/* * Set the system sleep state * * Currently we support S1-S5 but S4 is only S4BIOS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309241527.h8OFRMik084511>