diff mbox series

[1/2] ACPI: platform_profile: Stub platform_profile_cycle

Message ID 20250518-hid_lenovo_acpi_dependency-v1-1-afdb93b5d1a6@jannau.net
State New
Headers show
Series [1/2] ACPI: platform_profile: Stub platform_profile_cycle | expand

Commit Message

Janne Grunau via B4 Relay May 18, 2025, 10:18 a.m. UTC
From: Janne Grunau <j@jannau.net>

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@jannau.net>
---
 include/linux/platform_profile.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

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_*/