Skip to contentSkip to conversation

platform/x86: asus-laptop: Fix ACPI event handling

PATCH In review Armin Wolf 3 participants 4 messages Aug 30 – Aug 31

Subsystems (2)
lore
Share & tools
lore

Armin Wolf

author
#0 lore raw

PATCH 1/1 platform/x86: asus-laptop: Fix ACPI event handling

The event codes inside asus_keymap[] span a wide range from 0x02 till 0xC5, but using ACPI_DEVICE_NOTIFY prevents us from receiving event codes below 0x80.

Fix this by using ACPI_ALL_NOTIFY instead.

Fixes 378500dc1313 ("platform/x86: asus-laptop: Register ACPI notify handler directly")
---
 drivers/platform/x86/asus-laptop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/asus-laptop.c +2 -2
index 449addd1ac7a..79a575d0f5b4 100644
@@ -1882,7 +1882,7 @@ static int asus_acpi_probe(struct platform_device *pdev)
 	if (result && result != -ENODEV)
 		goto fail_pega_rfkill;
 
-	result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
+	result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
 						 asus_acpi_notify, asus);
 	if (result)
 		goto fail_pega_rfkill;
@@ -1912,7 +1912,7 @@ static void asus_acpi_remove(struct platform_device *pdev)
 {
 	struct asus_laptop *asus = platform_get_drvdata(pdev);
 
-	acpi_dev_remove_notify_handler(asus->device, ACPI_DEVICE_NOTIFY,
+	acpi_dev_remove_notify_handler(asus->device, ACPI_ALL_NOTIFY,
 				       asus_acpi_notify);
 	asus_backlight_exit(asus);
 	asus_rfkill_exit(asus);
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Armin Wolf

The event codes inside asus_keymap[] span a wide range from 0x02 till 0xC5, but using ACPI_DEVICE_NOTIFY prevents us from receiving event codes below 0x80.

Fix this by using ACPI_ALL_NOTIFY instead.

Fixes 378500dc1313 ("platform/x86: asus-laptop: Register ACPI notify handler directly")

Thanks for taking care of this!

Quoted 26 lines
---
  drivers/platform/x86/asus-laptop.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/asus-laptop.c +2 -2
index 449addd1ac7a..79a575d0f5b4 100644
@@ -1882,7 +1882,7 @@ static int asus_acpi_probe(struct platform_device *pdev)
  	if (result && result != -ENODEV)
  		goto fail_pega_rfkill;
 
-	result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
+	result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
  						 asus_acpi_notify, asus);
  	if (result)
  		goto fail_pega_rfkill;
@@ -1912,7 +1912,7 @@ static void asus_acpi_remove(struct platform_device *pdev)
  {
  	struct asus_laptop *asus = platform_get_drvdata(pdev);
 
-	acpi_dev_remove_notify_handler(asus->device, ACPI_DEVICE_NOTIFY,
+	acpi_dev_remove_notify_handler(asus->device, ACPI_ALL_NOTIFY,
  				       asus_acpi_notify);
  	asus_backlight_exit(asus);
  	asus_rfkill_exit(asus);
maintainer
#2 lore raw
In reply to Armin Wolf
Quoted 8 lines · Armin Wolf

The event codes inside asus_keymap[] span a wide range from 0x02 till 0xC5, but using ACPI_DEVICE_NOTIFY prevents us from receiving event codes below 0x80.

Fix this by using ACPI_ALL_NOTIFY instead.

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: asus-laptop: Fix ACPI event handling

      commit: 156c129509869a090f88e96fba4bdf2dad12969a

--
i.

author
#3 lore raw

Am 31.08.26 um 18:45 schrieb Ilpo Järvinen:

Quoted 9 lines · Armin Wolf
Quoted 8 lines

The event codes inside asus_keymap[] span a wide range from 0x02 till 0xC5, but using ACPI_DEVICE_NOTIFY prevents us from receiving event codes below 0x80.

Fix this by using ACPI_ALL_NOTIFY instead.

Quoted 6 lines
Quoted 1 line

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.

Thank you :)

Quoted 7 lines

The list of commits applied:
[1/1] platform/x86: asus-laptop: Fix ACPI event handling

       commit: 156c129509869a090f88e96fba4bdf2dad12969a

--
i.