Skip to content

Commit 82cb8a5

Browse files
committed
platform/x86: acer-wmi: Add ACER_CAP_SET_FUNCTION_MODE capability flag
Not all devices supporting WMID_GUID3 support the wmid3_set_function_mode() call, leading to errors like these: [ 60.138358] acer_wmi: Enabling RF Button failed: 0x1 - 0xff [ 60.140036] acer_wmi: Enabling Launch Manager failed: 0x1 - 0xff Add an ACER_CAP_SET_FUNCTION_MODE capability flag, so that these calls can be disabled through the new force_caps mechanism. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20201019185628.264473-5-hdegoede@redhat.com
1 parent 39aa009 commit 82cb8a5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/platform/x86/acer-wmi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ struct hotkey_function_type_aa {
210210
#define ACER_CAP_BLUETOOTH BIT(2)
211211
#define ACER_CAP_BRIGHTNESS BIT(3)
212212
#define ACER_CAP_THREEG BIT(4)
213+
#define ACER_CAP_SET_FUNCTION_MODE BIT(5)
213214

214215
/*
215216
* Interface type flags
@@ -2195,10 +2196,14 @@ static int __init acer_wmi_init(void)
21952196
if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
21962197
interface->capability &= ~ACER_CAP_BRIGHTNESS;
21972198

2199+
if (wmi_has_guid(WMID_GUID3))
2200+
interface->capability |= ACER_CAP_SET_FUNCTION_MODE;
2201+
21982202
if (force_caps != -1)
21992203
interface->capability = force_caps;
22002204

2201-
if (wmi_has_guid(WMID_GUID3)) {
2205+
if (wmi_has_guid(WMID_GUID3) &&
2206+
(interface->capability & ACER_CAP_SET_FUNCTION_MODE)) {
22022207
if (ACPI_FAILURE(acer_wmi_enable_rf_button()))
22032208
pr_warn("Cannot enable RF Button Driver\n");
22042209

0 commit comments

Comments
 (0)