[PATCH 1/2] ACPI: platform_profile: Stub platform_profile_cycle
From: Janne Grunau via B4 Relay
Date: Sun May 18 2025 - 06:19:02 EST
From: Janne Grunau <j@xxxxxxxxxx>
This is required to allow USB/Bluetooth HID devices to cycle through
platform profiles without depending on ACPI. Commit 52572cde8b4a4
("HID: lenovo: select CONFIG_ACPI_PLATFORM_PROFILE") added this
dependency for hid-lenovo which is used for external USB and Bluetooth
devices.
Fixes: 52572cde8b4a4 ("HID: lenovo: select CONFIG_ACPI_PLATFORM_PROFILE")
Signed-off-by: Janne Grunau <j@xxxxxxxxxx>
---
include/linux/platform_profile.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
index a299225ab92e78ce2e978b1774cdfc95cc688e8f..05a6749991601fd373683c3d498c6e9cc4f97882 100644
--- a/include/linux/platform_profile.h
+++ b/include/linux/platform_profile.h
@@ -54,7 +54,18 @@ void platform_profile_remove(struct device *dev);
struct device *devm_platform_profile_register(struct device *dev, const char *name,
void *drvdata,
const struct platform_profile_ops *ops);
+#ifdef CONFIG_ACPI_PLATFORM_PROFILE
int platform_profile_cycle(void);
+#else
+/*
+ * This stub is needed to allow USB/Bluetooth HID drivers to cycle through
+ * platform profiles.
+ */
+static inline int platform_profile_cycle(void)
+{
+ return 0;
+}
+#endif /* CONFIG_ACPI_PLATFORM_PROFILE */
void platform_profile_notify(struct device *dev);
#endif /*_PLATFORM_PROFILE_H_*/
--
2.49.0