opnsense-src/sys/dev/acpica
Aymeric Wibo 02a8fadd2c
acpi_powerres: acpi_pwr_get_state and getting initial D-state for device
Add `acpi_pwr_get_state` as a prerequisite to LPI (low-power idle)
states. Since these states define minimum D-state constraints on other
devices to be able to enter them, it will be necessary to use this
function to check them before attempting to do so.

Aside from that, this function is used to get the initial D-state of a
power consumer when registering it (previously the `ac_state` value
would be set to `ACPI_STATE_UNKNOWN`). It uses the `_PSC` method if
available (older devices), or infers the D-state through the `_PRx`
objects (cached in `ac_prx`) with `acpi_pwr_infer_state` if not.

`acpi_pwr_switch_consumer` now uses this to verify that the D-state of
a power consumer was switched correctly.

Reviewed by:	imp, markj, jrm (mentor)
Approved by:	markj, jrm (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D48386
2025-08-18 16:44:59 +02:00
..
Osd pci_cfgreg: Add a PCI domain argument to the low-level register API 2023-11-29 10:31:47 -08:00
acpi.c acpi_powerres: D3cold support 2025-08-08 11:42:44 +02:00
acpi_acad.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_apei.c apei: Mark ReadAckRegister resource as shareable 2024-01-09 16:07:34 -05:00
acpi_battery.c acpi_battery: avoid divide-by-zero when no devices have capacity info 2024-04-16 19:39:45 -04:00
acpi_bus_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_button.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_cmbat.c ACPI: Treat all 20-element _BIX entires as revision 0 2024-10-02 12:30:15 -06:00
acpi_container.c Replace calls to bus_generic_attach with bus_attach_children 2024-12-06 17:26:16 -05:00
acpi_cpu.c Replace calls to bus_generic_attach with bus_attach_children 2024-12-06 17:26:16 -05:00
acpi_dock.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_ec.c acpi: Use device_set_descf() 2024-06-02 19:38:41 -04:00
acpi_ged.c acpi: Mark the GED ithread as sleepable 2025-01-24 15:08:09 +00:00
acpi_hpet.c acpi_hpet: Make use of enum for vm_guest to improve readability 2024-03-24 23:31:22 +08:00
acpi_hpet.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_isab.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_lid.c acpi_lid: Remove duplicate events 2023-12-23 21:33:51 -05:00
acpi_package.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
acpi_pci.c acpi_powerres: D3cold support 2025-08-08 11:42:44 +02:00
acpi_pci_link.c acpi: Use device_set_descf() 2024-06-02 19:38:41 -04:00
acpi_pcib.c acpica: Extract _OSC parsing to a common file 2024-12-12 18:00:22 +00:00
acpi_pcib_acpi.c newbus: replace leftover device unit wildcards 2025-06-21 05:57:45 +03:00
acpi_pcib_pci.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pcibvar.h acpica: Extract _OSC parsing to a common file 2024-12-12 18:00:22 +00:00
acpi_pcivar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_perf.c newbus: replace leftover device unit wildcards 2025-06-21 05:57:45 +03:00
acpi_powerres.c acpi_powerres: acpi_pwr_get_state and getting initial D-state for device 2025-08-18 16:44:59 +02:00
acpi_pxm.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_quirk.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
acpi_quirks sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_resource.c pci: Ignore PCRx devices resources 2025-05-08 19:38:36 +01:00
acpi_smbat.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_smbus.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_thermal.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_throttle.c newbus: replace leftover device unit wildcards 2025-06-21 05:57:45 +03:00
acpi_timer.c acpi_timer: remove leftovers from Garbage-collect ACPI-safe timer and friends 2024-06-21 14:06:26 +02:00
acpi_video.c newbus: replace leftover device unit wildcards 2025-06-21 05:57:45 +03:00
acpiio.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpivar.h acpi_powerres: acpi_pwr_get_state and getting initial D-state for device 2025-08-18 16:44:59 +02:00