[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0haRrHv=dsy=6ZOrQcPEeFc6Lz6QAXTVGyWhYZxpHpEdA@mail.gmail.com>
Date: Thu, 11 Feb 2021 20:10:11 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: linux-i2c <linux-i2c@...r.kernel.org>,
Wolfram Sang <wsa@...-dreams.de>,
"Rafael J. Wysocki" <rafael@...nel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Mani, Rajmohan" <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 Mailing List <linux-media@...r.kernel.org>
Subject: Re: [PATCH v11 1/7] ACPI: scan: Obtain device's desired enumeration
power state
On Thu, Feb 11, 2021 at 12:08 AM Sakari Ailus
<sakari.ailus@...ux.intel.com> wrote:
>
> Store a device's desired enumeration power state in struct
> acpi_device_power during acpi_device object's initialisation.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
> ---
> drivers/acpi/scan.c | 4 ++++
> include/acpi/acpi_bus.h | 1 +
> 2 files changed, 5 insertions(+)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index a184529d8fa40..6a9b4a92c4f66 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -987,6 +987,7 @@ 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 dse = ACPI_STATE_D0;
> u32 i;
>
> /* Presence of _PS0|_PR0 indicates 'power manageable' */
> @@ -1008,6 +1009,9 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
> if (acpi_has_method(device->handle, "_DSW"))
> device->power.flags.dsw_present = 1;
>
> + acpi_evaluate_integer(device->handle, "_DSE", NULL, &dse);
As a matter of notice, it is likely that this object will be called
_DSC (Deepest State for Configuration) which better reflects its
function.
The ACPI ECR introducing it will be sent next week if all goes well.
Thanks!
> + device->power.state_for_enumeration = dse;
> +
> /*
> * Enumerate supported power management states
> */
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index 02a716a0af5d4..becfc9f57002b 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -276,6 +276,7 @@ struct acpi_device_power {
> int state; /* Current state */
> struct acpi_device_power_flags flags;
> struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
> + u8 state_for_enumeration; /* Maximum power state for enumeration */
> };
>
> /* Performance Management */
> --
> 2.20.1
>
Powered by blists - more mailing lists