From 84bbfc32a3f47bd2e32741247afe516cbeff7789 Mon Sep 17 00:00:00 2001 From: Aymeric Wibo Date: Sat, 14 Jun 2025 17:29:25 +0200 Subject: acpi_powerres: D3cold support Cherry-pick commit 0b76c0a from ACPICA (actypes: Distinguish between D3hot/cold, and default `ACPI_STATE_D3` to D3cold). The same distinction is made between `PCI_POWERSTATE_D3_HOT` and `PCI_POWERSTATE_D3_COLD`, as they're defined by ACPI (and are asserted to be the same). D3cold is essentially the same as D3hot except the power resources are turned off. Add support for D3cold to `acpi_pwr_switch_consumer`. `acpi_d_state_to_str` replaces the `printf("D%d", d_state)` pattern, allowing for "D3hot" and "D3cold" strings to be printed instead of just "D3". Reviewed by: markj, ziaee, mckusick (mentor) Approved by: markj, mckusick (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48384 --- sys/compat/linuxkpi/common/include/linux/pci.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/compat/linuxkpi/common/include/linux') diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index ba1c0d2ac99e..3fd4191b9917 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -223,11 +223,11 @@ enum pcie_link_width { typedef int pci_power_t; -#define PCI_D0 PCI_POWERSTATE_D0 -#define PCI_D1 PCI_POWERSTATE_D1 -#define PCI_D2 PCI_POWERSTATE_D2 -#define PCI_D3hot PCI_POWERSTATE_D3 -#define PCI_D3cold 4 +#define PCI_D0 PCI_POWERSTATE_D0 +#define PCI_D1 PCI_POWERSTATE_D1 +#define PCI_D2 PCI_POWERSTATE_D2 +#define PCI_D3hot PCI_POWERSTATE_D3_HOT +#define PCI_D3cold PCI_POWERSTATE_D3_COLD #define PCI_POWER_ERROR PCI_POWERSTATE_UNKNOWN -- cgit v1.3