acpi_pwr_get_state is added 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 currently only 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.
This was split out from D48294.
Sponsored by: The FreeBSD Foundation