* [PATCH v2 0/1] platform/x86: asus-wmi: fix build without CONFIG_SUSPEND
@ 2025-05-24 10:04 Luke Jones
2025-05-24 10:04 ` [PATCH v2 1/1] " Luke Jones
0 siblings, 1 reply; 2+ messages in thread
From: Luke Jones @ 2025-05-24 10:04 UTC (permalink / raw)
To: linux-kernel
Cc: hdegoede, ilpo.jarvinen, platform-driver-x86, mario.limonciello,
andriy.shevchenko, Luke Jones
Fixes "platform/x86: asus-wmi: Refactor Ally suspend/resume".
Verified using the following details provided by test robot:
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git review-ilpo-next
head: 83579675331059689e2869bf752ca9e17fadbd82
commit: feea7bd6b02d43a794e3f065650d89cf8d8e8e59 [74/89] platform/x86: asus-wmi: Refactor Ally suspend/resume
config: x86_64-buildonly-randconfig-004-20250509 (https://download.01.org/0day-ci/archive/20250509/202505090418.DaeaXe4i-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250509/202505090418.DaeaXe4i-lkp@intel.com/reproduce)
I've not done anything fancy here and left asus_hotk_prepare() as is, as it is *incredibly* unlikely anyone would ever run a ROG Ally without suspend enabled.
Changelog:
- V1:
- Move functions and struct together to be under one ifdef block
- Use wrapper functions for s2idle registration
Luke Jones (1):
platform/x86: asus-wmi: fix build without CONFIG_SUSPEND
drivers/platform/x86/asus-wmi.c | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
--
2.49.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2 1/1] platform/x86: asus-wmi: fix build without CONFIG_SUSPEND
2025-05-24 10:04 [PATCH v2 0/1] platform/x86: asus-wmi: fix build without CONFIG_SUSPEND Luke Jones
@ 2025-05-24 10:04 ` Luke Jones
0 siblings, 0 replies; 2+ messages in thread
From: Luke Jones @ 2025-05-24 10:04 UTC (permalink / raw)
To: linux-kernel
Cc: hdegoede, ilpo.jarvinen, platform-driver-x86, mario.limonciello,
andriy.shevchenko, Luke Jones, kernel test robot
The patch "Refactor Ally suspend/resume" introduced an
acpi_s2idle_dev_ops for use with ROG Ally which caused a build error
if CONFIG_SUSPEND was not defined.
Signed-off-by: Luke Jones <luke@ljones.dev>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505090418.DaeaXe4i-lkp@intel.com/
Fixes: feea7bd6b02d ("platform/x86: asus-wmi: Refactor Ally suspend/resume")
---
drivers/platform/x86/asus-wmi.c | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 27f11643a00d..c77198761dc7 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -5005,23 +5005,24 @@ static int asus_hotk_restore(struct device *device)
return 0;
}
-static void asus_ally_s2idle_restore(void)
+static int asus_hotk_prepare(struct device *device)
{
if (use_ally_mcu_hack == ASUS_WMI_ALLY_MCU_HACK_ENABLED) {
acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE,
- ASUS_USB0_PWR_EC0_CSEE_ON);
+ ASUS_USB0_PWR_EC0_CSEE_OFF);
msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
}
+ return 0;
}
-static int asus_hotk_prepare(struct device *device)
+#if defined(CONFIG_SUSPEND)
+static void asus_ally_s2idle_restore(void)
{
if (use_ally_mcu_hack == ASUS_WMI_ALLY_MCU_HACK_ENABLED) {
acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE,
- ASUS_USB0_PWR_EC0_CSEE_OFF);
+ ASUS_USB0_PWR_EC0_CSEE_ON);
msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
}
- return 0;
}
/* Use only for Ally devices due to the wake_on_ac */
@@ -5029,6 +5030,20 @@ static struct acpi_s2idle_dev_ops asus_ally_s2idle_dev_ops = {
.restore = asus_ally_s2idle_restore,
};
+static void asus_s2idle_check_register(void)
+{
+ acpi_register_lps0_dev(&asus_ally_s2idle_dev_ops);
+}
+
+static void asus_s2idle_check_unregister(void)
+{
+ acpi_unregister_lps0_dev(&asus_ally_s2idle_dev_ops);
+}
+#else
+static void asus_s2idle_check_register(void) {}
+static void asus_s2idle_check_unregister(void) {}
+#endif /* CONFIG_SUSPEND */
+
static const struct dev_pm_ops asus_pm_ops = {
.thaw = asus_hotk_thaw,
.restore = asus_hotk_restore,
@@ -5060,7 +5075,7 @@ static int asus_wmi_probe(struct platform_device *pdev)
return ret;
}
- ret = acpi_register_lps0_dev(&asus_ally_s2idle_dev_ops);
+ ret = asus_s2idle_check_register(&asus_ally_s2idle_dev_ops);
if (ret)
pr_warn("failed to register LPS0 sleep handler in asus-wmi\n");
@@ -5096,7 +5111,8 @@ EXPORT_SYMBOL_GPL(asus_wmi_register_driver);
void asus_wmi_unregister_driver(struct asus_wmi_driver *driver)
{
- acpi_unregister_lps0_dev(&asus_ally_s2idle_dev_ops);
+ asus_s2idle_check_unregister(&asus_ally_s2idle_dev_ops);
+
platform_device_unregister(driver->platform_device);
platform_driver_unregister(&driver->platform_driver);
used = false;
--
2.49.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-24 10:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-24 10:04 [PATCH v2 0/1] platform/x86: asus-wmi: fix build without CONFIG_SUSPEND Luke Jones
2025-05-24 10:04 ` [PATCH v2 1/1] " Luke Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®