Skip to contentSkip to conversation

platform/x86: toshiba: re-enable acpi hotkeys after suspend to disk

PATCH Applied Benjamin Tissoires 3 participants 3 messages Sep 2, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: toshiba: re-enable acpi hotkeys after suspend to disk

On the Toshiba Tecra Z40, after a suspend-to-disk, some FN hotkeys driven by toshiba_acpi are not functional.

Calling the ACPI object ENAB on resume makes them back alive.

---

Hi guys,

we noticed this problem on a Toshiba Z40. I kind of brute-forced the thing, and I ended up that calling "ENAB" was making the keys working again (rmmod/insmod the driver was sufficient, and the only command which was different from the resume was this ACPI call).

I am really surprised some toshiba laptops do not need this, so I'd prefer that an ACPI expert (Matthew???) gives its wisdom regarding that.

Cheers,
Benjamin

 drivers/platform/x86/toshiba_acpi.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/x86/toshiba_acpi.c +8 -1
index b062d3d..ba75701 100644
@@ -1857,9 +1857,16 @@ static int toshiba_acpi_resume(struct device *device)
 {
 	struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
 	u32 result;
+	acpi_status status;
+
+	if (dev->hotkey_dev) {
+		status = acpi_evaluate_object(dev->acpi_dev->handle, "ENAB",
+				NULL, NULL);
+		if (ACPI_FAILURE(status))
+			pr_info("Unable to re-enable hotkeys\n");
 
-	if (dev->hotkey_dev)
 		hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE, &result);
+	}
 
 	return 0;
 }
Signature · 1 line
2.1.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Benjamin Tissoires

we noticed this problem on a Toshiba Z40. I kind of brute-forced the thing, and I ended up that calling "ENAB" was making the keys working again (rmmod/insmod the driver was sufficient, and the only command which was different from the resume was this ACPI call).

I am really surprised some toshiba laptops do not need this, so I'd prefer that an ACPI expert (Matthew???) gives its wisdom regarding that.

Looks good to me. I'd be surprised if this breaks anything.

Signature · 1 line
Matthew Garrett <[email protected]>
Applied
#2 lore raw
Quoted 7 lines · Matthew Garrett
Quoted 5 lines · Benjamin Tissoires

we noticed this problem on a Toshiba Z40. I kind of brute-forced the thing, and I ended up that calling "ENAB" was making the keys working again (rmmod/insmod the driver was sufficient, and the only command which was different from the resume was this ACPI call).

Quoted 6 lines
Quoted 2 lines

I am really surprised some toshiba laptops do not need this, so I'd prefer that an ACPI expert (Matthew???) gives its wisdom regarding that.

Looks good to me. I'd be surprised if this breaks anything.

Queued. Thanks.

--
Darren Hart
Intel Open Source Technology Center