public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Antheas Kapenekakis <lkml@antheas.dev>
To: dmitry.osipenko@collabora.com
Cc: bob.beckett@collabora.com, bookeldor@gmail.com,
	hadess@hadess.net, jaap@haitsma.org, kernel@collabora.com,
	lennart@poettering.net, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, lkml@antheas.dev, mccann@jhu.edu,
	rafael@kernel.org, richard@hughsie.com,
	sebastian.reichel@collabora.com, superm1@kernel.org,
	systemd-devel@lists.freedesktop.org, xaver.hugl@gmail.com
Subject: [RFC v2 01/10] acpi/x86: s2idle: Rename LPS0 constants so they mirror their function
Date: Sat, 25 Apr 2026 23:57:25 +0200	[thread overview]
Message-ID: <20260425215734.14116-2-lkml@antheas.dev> (raw)
In-Reply-To: <20260425215734.14116-1-lkml@antheas.dev>

The LPS0 3/4 constants are part of a firmware notification called
"Display on/off", in which the device enters a "Screen Off" state.
The LPS0 7/8 constants are part of a firmware notification in which
a Windows modern standby computer enters a "sleep" state where the
CPU may still be active and maintain the radios.

However, currently, the values are named as "Screen on/off" and "MS
entry/exit", where Modern Standby is abbreviated as "MS". Therefore,
perform a minor rename so that the values match their function. Then,
fix the debug message to say that it executes notifications instead of
entering states as it is otherwise confusing.

Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
---
 drivers/acpi/x86/s2idle.c | 84 +++++++++++++++++++++------------------
 1 file changed, 45 insertions(+), 39 deletions(-)

diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index b6b1dd76a06b..61a044b59776 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -43,20 +43,20 @@ static const struct acpi_device_id lps0_device_ids[] = {
 #define ACPI_LPS0_DSM_UUID	"c4eb40a0-6cd2-11e2-bcfd-0800200c9a66"
 
 #define ACPI_LPS0_GET_DEVICE_CONSTRAINTS	1
-#define ACPI_LPS0_SCREEN_OFF	3
-#define ACPI_LPS0_SCREEN_ON	4
+#define ACPI_LPS0_DISPLAY_OFF	3
+#define ACPI_LPS0_DISPLAY_ON	4
 #define ACPI_LPS0_ENTRY		5
 #define ACPI_LPS0_EXIT		6
-#define ACPI_LPS0_MS_ENTRY      7
-#define ACPI_LPS0_MS_EXIT       8
-#define ACPI_MS_TURN_ON_DISPLAY 9
+#define ACPI_LPS0_SLEEP_ENTRY		7
+#define ACPI_LPS0_SLEEP_EXIT		8
+#define ACPI_LPS0_TURN_ON_DISPLAY	9
 
 /* AMD */
 #define ACPI_LPS0_DSM_UUID_AMD      "e3f32452-febc-43ce-9039-932122d37721"
 #define ACPI_LPS0_ENTRY_AMD         2
 #define ACPI_LPS0_EXIT_AMD          3
-#define ACPI_LPS0_SCREEN_OFF_AMD    4
-#define ACPI_LPS0_SCREEN_ON_AMD     5
+#define ACPI_LPS0_DISPLAY_OFF_AMD   4
+#define ACPI_LPS0_DISPLAY_ON_AMD    5
 
 static acpi_handle lps0_device_handle;
 static guid_t lps0_dsm_guid;
@@ -343,27 +343,27 @@ static const char *acpi_sleep_dsm_state_to_str(unsigned int state)
 {
 	if (lps0_dsm_func_mask_microsoft || !acpi_s2idle_vendor_amd()) {
 		switch (state) {
-		case ACPI_LPS0_SCREEN_OFF:
-			return "screen off";
-		case ACPI_LPS0_SCREEN_ON:
-			return "screen on";
+		case ACPI_LPS0_DISPLAY_OFF:
+			return "display off";
+		case ACPI_LPS0_DISPLAY_ON:
+			return "display on";
 		case ACPI_LPS0_ENTRY:
 			return "lps0 entry";
 		case ACPI_LPS0_EXIT:
 			return "lps0 exit";
-		case ACPI_LPS0_MS_ENTRY:
-			return "lps0 ms entry";
-		case ACPI_LPS0_MS_EXIT:
-			return "lps0 ms exit";
-		case ACPI_MS_TURN_ON_DISPLAY:
-			return "lps0 ms turn on display";
+		case ACPI_LPS0_SLEEP_ENTRY:
+			return "sleep entry";
+		case ACPI_LPS0_SLEEP_EXIT:
+			return "sleep exit";
+		case ACPI_LPS0_TURN_ON_DISPLAY:
+			return "turn on display";
 		}
 	} else {
 		switch (state) {
-		case ACPI_LPS0_SCREEN_ON_AMD:
-			return "screen on";
-		case ACPI_LPS0_SCREEN_OFF_AMD:
-			return "screen off";
+		case ACPI_LPS0_DISPLAY_ON_AMD:
+			return "display on";
+		case ACPI_LPS0_DISPLAY_OFF_AMD:
+			return "display off";
 		case ACPI_LPS0_ENTRY_AMD:
 			return "lps0 entry";
 		case ACPI_LPS0_EXIT_AMD:
@@ -388,7 +388,7 @@ static void acpi_sleep_run_lps0_dsm(unsigned int func, unsigned int func_mask, g
 	lps0_dsm_state = func;
 	if (pm_debug_messages_on) {
 		acpi_handle_info(lps0_device_handle,
-				"%s transitioned to state %s\n",
+				"%s executed notification %s\n",
 				 out_obj ? "Successfully" : "Failed to",
 				 acpi_sleep_dsm_state_to_str(lps0_dsm_state));
 	}
@@ -545,16 +545,17 @@ static int acpi_s2idle_prepare_late_lps0(void)
 	if (check_lps0_constraints)
 		lpi_check_constraints();
 
-	/* Screen off */
+	/* Display off */
 	if (lps0_dsm_func_mask > 0)
 		acpi_sleep_run_lps0_dsm(acpi_s2idle_vendor_amd() ?
-					ACPI_LPS0_SCREEN_OFF_AMD :
-					ACPI_LPS0_SCREEN_OFF,
+					ACPI_LPS0_DISPLAY_OFF_AMD :
+					ACPI_LPS0_DISPLAY_OFF,
 					lps0_dsm_func_mask, lps0_dsm_guid);
 
 	if (lps0_dsm_func_mask_microsoft > 0)
-		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF,
-				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
+		acpi_sleep_run_lps0_dsm(ACPI_LPS0_DISPLAY_OFF,
+					lps0_dsm_func_mask_microsoft,
+					lps0_dsm_guid_microsoft);
 
 	/* LPS0 entry */
 	if (lps0_dsm_func_mask > 0 && acpi_s2idle_vendor_amd())
@@ -563,10 +564,12 @@ static int acpi_s2idle_prepare_late_lps0(void)
 
 	if (lps0_dsm_func_mask_microsoft > 0) {
 		/* Modern Standby entry */
-		acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_ENTRY,
-				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
+		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SLEEP_ENTRY,
+					lps0_dsm_func_mask_microsoft,
+					lps0_dsm_guid_microsoft);
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY,
-				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
+					lps0_dsm_func_mask_microsoft,
+					lps0_dsm_guid_microsoft);
 	}
 
 	if (lps0_dsm_func_mask > 0 && !acpi_s2idle_vendor_amd())
@@ -616,21 +619,24 @@ static void acpi_s2idle_restore_early_lps0(void)
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT,
 				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
 		/* Intent to turn on display */
-		acpi_sleep_run_lps0_dsm(ACPI_MS_TURN_ON_DISPLAY,
-				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
+		acpi_sleep_run_lps0_dsm(ACPI_LPS0_TURN_ON_DISPLAY,
+					lps0_dsm_func_mask_microsoft,
+					lps0_dsm_guid_microsoft);
 		/* Modern Standby exit */
-		acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_EXIT,
-				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
+		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SLEEP_EXIT,
+					lps0_dsm_func_mask_microsoft,
+					lps0_dsm_guid_microsoft);
 	}
 
-	/* Screen on */
+	/* Display on */
 	if (lps0_dsm_func_mask_microsoft > 0)
-		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON,
-				lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
+		acpi_sleep_run_lps0_dsm(ACPI_LPS0_DISPLAY_ON,
+					lps0_dsm_func_mask_microsoft,
+					lps0_dsm_guid_microsoft);
 	if (lps0_dsm_func_mask > 0)
 		acpi_sleep_run_lps0_dsm(acpi_s2idle_vendor_amd() ?
-					ACPI_LPS0_SCREEN_ON_AMD :
-					ACPI_LPS0_SCREEN_ON,
+					ACPI_LPS0_DISPLAY_ON_AMD :
+					ACPI_LPS0_DISPLAY_ON,
 					lps0_dsm_func_mask, lps0_dsm_guid);
 }
 
-- 
2.53.0



  reply	other threads:[~2026-04-25 21:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25 21:57 [RFC v2 00/10] acpi/x86: s2idle: Introduce and implement hint class ABI and idle hint for s2idle Antheas Kapenekakis
2026-04-25 21:57 ` Antheas Kapenekakis [this message]
2026-04-26 14:14   ` [RFC v2 01/10] acpi/x86: s2idle: Rename LPS0 constants so they mirror their function Rafael J. Wysocki
2026-04-26 16:54     ` Antheas Kapenekakis
2026-04-27 15:07       ` Rafael J. Wysocki
2026-04-25 21:57 ` [RFC v2 02/10] acpi/x86: s2idle: Move Modern Standby calls to s2idle begin/end Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 03/10] acpi/x86: s2idle: Add support for adding a delay after begin MS calls Antheas Kapenekakis
2026-04-28  1:57   ` Mario Limonciello
2026-04-28  7:47     ` Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 04/10] platform/x86: asus-wmi: add s2idle begin delay for Ally devices Antheas Kapenekakis
2026-04-28  1:56   ` Mario Limonciello
2026-04-28  6:34   ` [systemd-devel] " Paul Menzel
2026-04-28  8:18     ` Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 05/10] HID: asus: remove quirk handling " Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 06/10] platform/x86: asus-wmi: Remove Ally s2idle resume fixes Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 07/10] Documentation: Add documentation for the new sysfs hints class Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 08/10] hint: Add hint class ABI for devices to receive updates on host activity Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 09/10] acpi/x86: s2idle: Listen to idle hints to perform MS transitions Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 10/10] acpi/x86: s2idle: Subtract delay from last DSM fire in begin delay Antheas Kapenekakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260425215734.14116-2-lkml@antheas.dev \
    --to=lkml@antheas.dev \
    --cc=bob.beckett@collabora.com \
    --cc=bookeldor@gmail.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=hadess@hadess.net \
    --cc=jaap@haitsma.org \
    --cc=kernel@collabora.com \
    --cc=lennart@poettering.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mccann@jhu.edu \
    --cc=rafael@kernel.org \
    --cc=richard@hughsie.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=superm1@kernel.org \
    --cc=systemd-devel@lists.freedesktop.org \
    --cc=xaver.hugl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox