[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210128232729.16064-1-sakari.ailus@linux.intel.com>
Date: Fri, 29 Jan 2021 01:27:23 +0200
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: linux-i2c@...r.kernel.org
Cc: Wolfram Sang <wsa@...-dreams.de>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
rajmohan.mani@...el.com, Tomasz Figa <tfiga@...omium.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Bingbu Cao <bingbu.cao@...el.com>,
Chiranjeevi Rapolu <chiranjeevi.rapolu@...el.com>,
Hyungwoo Yang <hyungwoo.yang@...el.com>,
linux-media@...r.kernel.org
Subject: [PATCH v9 1/7] ACPI: scan: Obtain device's desired enumeration power state
Store a device's desired enumeration power state in struct
acpi_device_power_flags during acpi_device object's initialisation.
Signed-off-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
---
drivers/acpi/scan.c | 6 ++++++
include/acpi/acpi_bus.h | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 1d7a02ee45e05..b077c645c9845 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -987,6 +987,8 @@ static void acpi_bus_init_power_state(struct acpi_device *device, int state)
static void acpi_bus_get_power_flags(struct acpi_device *device)
{
+ unsigned long long pre;
+ acpi_status status;
u32 i;
/* Presence of _PS0|_PR0 indicates 'power manageable' */
@@ -1008,6 +1010,10 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
if (acpi_has_method(device->handle, "_DSW"))
device->power.flags.dsw_present = 1;
+ status = acpi_evaluate_integer(device->handle, "_PRE", NULL, &pre);
+ if (ACPI_SUCCESS(status) && !pre)
+ device->power.flags.allow_low_power_probe = 1;
+
/*
* Enumerate supported power management states
*/
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 02a716a0af5d4..020b850120883 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -258,7 +258,8 @@ struct acpi_device_power_flags {
u32 power_removed:1; /* Optimize Dx->D0 */
u32 ignore_parent:1; /* Power is independent of parent power state */
u32 dsw_present:1; /* _DSW present? */
- u32 reserved:26;
+ u32 allow_low_power_probe:1; /* Allow low power state in device probe */
+ u32 reserved:25;
};
struct acpi_device_power_state {
--
2.20.1
Powered by blists - more mailing lists