* [PATCH] HID: lenovo: select CONFIG_ACPI_PLATFORM_PROFILE
@ 2025-01-22 6:50 Arnd Bergmann
2025-02-03 9:54 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2025-01-22 6:50 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Vishnu Sankar
Cc: Arnd Bergmann, linux-input, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
A previous patch tried to fix this link failure:
x86_64-linux-ld: drivers/hid/hid-lenovo.o: in function `lenovo_raw_event':
hid-lenovo.c:(.text+0x22c): undefined reference to `platform_profile_cycle'
but got it wrong in three ways:
- the link failure still exists with CONFIG_ACPI_PLATFORM_PROFILE=m
when hid-lenovo is built-in
- There is no way to manually enable CONFIG_ACPI_PLATFORM_PROFILE, as
it is intended to be selected by its users.
Remove the broken #if check again and instead select the symbol like
the other users do. This requires adding a dependency on CONFIG_ACPI.
Fixes: 52e7d1f7c2fd ("HID: lenovo: Fix undefined platform_profile_cycle in ThinkPad X12 keyboard patch")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/hid/Kconfig | 2 ++
drivers/hid/hid-lenovo.c | 7 +------
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index b53eb569bd49..8adb745c5b28 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -570,6 +570,8 @@ config HID_LED
config HID_LENOVO
tristate "Lenovo / Thinkpad devices"
+ depends on ACPI
+ select ACPI_PLATFORM_PROFILE
select NEW_LEDS
select LEDS_CLASS
help
diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index 4d00bc4d656e..a7d9ca02779e 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -32,9 +32,7 @@
#include <linux/leds.h>
#include <linux/workqueue.h>
-#if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE)
#include <linux/platform_profile.h>
-#endif /* CONFIG_ACPI_PLATFORM_PROFILE */
#include "hid-ids.h"
@@ -730,13 +728,10 @@ static int lenovo_raw_event_TP_X12_tab(struct hid_device *hdev, u32 raw_data)
if (hdev->product == USB_DEVICE_ID_LENOVO_X12_TAB) {
report_key_event(input, KEY_RFKILL);
return 1;
- }
-#if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE)
- else {
+ } else {
platform_profile_cycle();
return 1;
}
-#endif /* CONFIG_ACPI_PLATFORM_PROFILE */
return 0;
case TP_X12_RAW_HOTKEY_FN_F10:
/* TAB1 has PICKUP Phone and TAB2 use Snipping tool*/
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: lenovo: select CONFIG_ACPI_PLATFORM_PROFILE
2025-01-22 6:50 [PATCH] HID: lenovo: select CONFIG_ACPI_PLATFORM_PROFILE Arnd Bergmann
@ 2025-02-03 9:54 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2025-02-03 9:54 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Benjamin Tissoires, Vishnu Sankar, Arnd Bergmann, linux-input,
linux-kernel
On Wed, 22 Jan 2025, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> A previous patch tried to fix this link failure:
>
> x86_64-linux-ld: drivers/hid/hid-lenovo.o: in function `lenovo_raw_event':
> hid-lenovo.c:(.text+0x22c): undefined reference to `platform_profile_cycle'
>
> but got it wrong in three ways:
>
> - the link failure still exists with CONFIG_ACPI_PLATFORM_PROFILE=m
> when hid-lenovo is built-in
>
> - There is no way to manually enable CONFIG_ACPI_PLATFORM_PROFILE, as
> it is intended to be selected by its users.
>
> Remove the broken #if check again and instead select the symbol like
> the other users do. This requires adding a dependency on CONFIG_ACPI.
>
> Fixes: 52e7d1f7c2fd ("HID: lenovo: Fix undefined platform_profile_cycle in ThinkPad X12 keyboard patch")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks a lot for the fix Arnd, applied to hid.git#for-6.14/upstream-fixes.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-03 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-22 6:50 [PATCH] HID: lenovo: select CONFIG_ACPI_PLATFORM_PROFILE Arnd Bergmann
2025-02-03 9:54 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).