Skip to contentSkip to conversation

platform/x86: Add ACPI quickstart button driver

PATCH In review Armin Wolf 5 participants 16 messages Jan 31, 2024 – Mar 27, 2024

Subsystems (3)
lore
Share & tools
lore

Armin Wolf

author maintainer
#0 lore raw

cover platform/x86: Add ACPI quickstart button driver

This patch series adds support for the ACPI PNP0C32 device as proposed in 2022 by Arvid Norlander. The first patch adds support for the device itself, while the second patch was taken from the original series.

Both patches are compile-tested only.

Armin Wolf (1):
platform/x86: Add ACPI quickstart button (PNP0C32) driver

Arvid Norlander (1):
platform/x86: toshiba_acpi: Add quirk for buttons on Z830

 MAINTAINERS                         |   6 +
 drivers/platform/x86/Kconfig        |  13 ++
 drivers/platform/x86/Makefile       |   3 +
 drivers/platform/x86/quickstart.c   | 225 ++++++++++++++++++++++++++++
 drivers/platform/x86/toshiba_acpi.c |  36 ++++-
 5 files changed, 280 insertions(+), 3 deletions(-)
 create mode 100644 drivers/platform/x86/quickstart.c

--
2.39.2

author maintainer
#1 lore raw

PATCH 1/2 platform/x86: Add ACPI quickstart button (PNP0C32) driver

This drivers supports the ACPI quickstart button device, which is used to send manufacturer-specific events to userspace. Since the meaning of those events is not standardized, userspace has to use for example hwdb to decode them.

The driver itself is based on an earlier proposal, but contains some improvements and uses the device wakeup API instead of a custom sysfs file.

Compile-tested only.

---
 MAINTAINERS                       |   6 +
 drivers/platform/x86/Kconfig      |  13 ++
 drivers/platform/x86/Makefile     |   3 +
 drivers/platform/x86/quickstart.c | 225 ++++++++++++++++++++++++++++++
 4 files changed, 247 insertions(+)
 create mode 100644 drivers/platform/x86/quickstart.c
MAINTAINERS +6 -0
index 8d1052fa6a69..b71692c55f7b 100644
@@ -354,6 +354,12 @@ B:	https://bugzilla.kernel.org
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
 F:	drivers/acpi/pmic/
 
+ACPI QUICKSTART DRIVER
+M:	Armin Wolf <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/platform/x86/quickstart.c
+
 ACPI SERIAL MULTI INSTANTIATE DRIVER
 M:	Hans de Goede <[email protected]>
 L:	[email protected]
drivers/platform/x86/Kconfig +13 -0
index 6dbd40e2aeda..9cba9a410e28 100644
@@ -641,6 +641,19 @@ config THINKPAD_LMI
 
 source "drivers/platform/x86/intel/Kconfig"
 
+config ACPI_QUICKSTART
+	tristate "ACPI Quickstart button driver"
+	depends on ACPI
+	depends on INPUT
+	select INPUT_SPARSE_KEYMAP
+	help
+	  This driver adds support for ACPI quickstart button (PNP0C32) devices.
+	  The button emits a manufacturer-specific key value when pressed, so
+	  userspace has to map this value to a standard key code.
+
+	  To compile this driver as a module, choose M here: the module will be
+	  called quickstart.
+
 config MSI_EC
 	tristate "MSI EC Extras"
 	depends on ACPI
drivers/platform/x86/Makefile +3 -0
index 1de432e8861e..0801ccc37e9b 100644
@@ -70,6 +70,9 @@ obj-$(CONFIG_YOGABOOK)		+= lenovo-yogabook.o
 # Intel
 obj-y				+= intel/
 
+# Microsoft
+obj-$(CONFIG_ACPI_QUICKSTART)  += quickstart.o
+
 # MSI
 obj-$(CONFIG_MSI_EC)		+= msi-ec.o
 obj-$(CONFIG_MSI_LAPTOP)	+= msi-laptop.o
drivers/platform/x86/quickstart.c new file +225 -0

225 lines not on this page · raw message

--
2.39.2

maintainer
#2 lore raw

Re: [PATCH 1/2] platform/x86: Add ACPI quickstart button (PNP0C32) driver

Quoted 19 lines · Armin Wolf

This drivers supports the ACPI quickstart button device, which is used to send manufacturer-specific events to userspace. Since the meaning of those events is not standardized, userspace has to use for example hwdb to decode them.

The driver itself is based on an earlier proposal, but contains some improvements and uses the device wakeup API instead of a custom sysfs file.

Compile-tested only.

drivers/platform/x86/quickstart.c new file +0 -0
new file mode 100644
index 000000000000..ba3a7a25dda7

drivers/platform/x86/quickstart.c line 3

Quoted 3 lines
drivers/platform/x86/quickstart.c new file +3 -0
@@ -0,0 +1,225 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * quickstart.c - ACPI Direct App Launch driver

ACPI Quickstart ?

Quoted 9 lines
drivers/platform/x86/quickstart.c new file +8 -0
+ * Copyright (C) 2024 Armin Wolf <[email protected]>
+ * Copyright (C) 2022 Arvid Norlander <[email protected]>
+ * Copyright (C) 2007-2010 Angelo Arrifano <[email protected]>
+ *
+ * Information gathered from disassembled dsdt and from here:
+ * <https://archive.org/details/microsoft-acpi-dirapplaunch>
+ */
 
+static void quickstart_notify(acpi_handle handle, u32 event, void *context)

drivers/platform/x86/quickstart.c line 80

Quoted 10 lines
drivers/platform/x86/quickstart.c new file +10 -0
+{
+	struct quickstart_data *data = context;
+
+	switch (event) {
+	case QUICKSTART_EVENT_RUNTIME:
+		sparse_keymap_report_event(data->input_device, 0x1, 1, true);
+		acpi_bus_generate_netlink_event(DRIVER_NAME, dev_name(data->dev), event, 0);
+		break;
+	default:
+		dev_err(data->dev, FW_INFO "Unexpected ACPI notify event (%u)\n", event);

Could this end up spamming the logs so perhaps use _ratelimited variant?

Quoted 31 lines
drivers/platform/x86/quickstart.c new file +31 -0
+static int quickstart_probe(struct platform_device *pdev)
+{
+	struct quickstart_data *data;
+	acpi_handle handle;
+	acpi_status status;
+	int ret;
+
+	handle = ACPI_HANDLE(&pdev->dev);
+	if (!handle)
+		return -ENODEV;
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	data->dev = &pdev->dev;
+	dev_set_drvdata(&pdev->dev, data);
+
+	/* We have to initialize the device wakeup before evaluating GHID because
+	 * doing so will notify the device if the button was used to wake the machine
+	 * from S5.
+	 */
+	device_init_wakeup(&pdev->dev, true);
+
+	ret = quickstart_get_ghid(data);
+	if (ret < 0)
+		return ret;
+
+	data->input_device = devm_input_allocate_device(&pdev->dev);
+	if (!data->input_device)
+		return -ENOMEM;

drivers/platform/x86/quickstart.c line 190

Quoted 10 lines
drivers/platform/x86/quickstart.c new file +10 -0
+
+	ret = sparse_keymap_setup(data->input_device, quickstart_keymap, NULL);
+	if (ret < 0)
+		return ret;
+
+	snprintf(data->input_name, sizeof(data->input_name), "Quickstart Button %u", data->id);
+	snprintf(data->phys, sizeof(data->phys), DRIVER_NAME "/input%u", data->id);
+
+	data->input_device->name = data->input_name;
+	data->input_device->phys = data->phys;

Why not devm_kasprintf() these directly into data->input_device->xx + NULL check instead of storing into struct quickstart_data ?

Quoted 5 lines
drivers/platform/x86/quickstart.c new file +5 -0
+static struct platform_driver quickstart_platform_driver = {
+	.driver	= {
+		.name = DRIVER_NAME,
+		.dev_groups = quickstart_groups,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,

drivers/platform/x86/quickstart.c line 224

Quoted 10 lines
drivers/platform/x86/quickstart.c new file +10 -0
+		.acpi_match_table = quickstart_device_ids,
+	},
+	.probe = quickstart_probe,
+};
+module_platform_driver(quickstart_platform_driver);
+
+MODULE_AUTHOR("Armin Wolf <[email protected]>");
+MODULE_AUTHOR("Arvid Norlander <[email protected]>");
+MODULE_AUTHOR("Angelo Arrifano");
+MODULE_DESCRIPTION("ACPI Direct App Launch driver");

ACPI Quickstart Button ?

Quoted 4 lines

+MODULE_LICENSE("GPL");
--
2.39.2

Signature · 1 line
 i.
author maintainer
#3 lore raw

PATCH 2/2 platform/x86: toshiba_acpi: Add quirk for buttons on Z830

In reply to Armin Wolf

From: Arvid Norlander <[email protected]>

The Z830 has some buttons that will only work properly as "quickstart" buttons. To enable them in that mode, a value between 1 and 7 must be used for HCI_HOTKEY_EVENT. Windows uses 0x5 on this laptop so use that for maximum predictability and compatibility.

As there is not yet a known way of auto detection, this patch uses a DMI quirk table. A module parameter is exposed to allow setting this on other models for testing.

---
 drivers/platform/x86/toshiba_acpi.c | 36 ++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)
drivers/platform/x86/toshiba_acpi.c +33 -3
index 291f14ef6702..2a5a651235fe 100644
@@ -57,6 +57,11 @@ module_param(turn_on_panel_on_resume, int, 0644);
 MODULE_PARM_DESC(turn_on_panel_on_resume,
 	"Call HCI_PANEL_POWER_ON on resume (-1 = auto, 0 = no, 1 = yes");
 
+static int hci_hotkey_quickstart = -1;
+module_param(hci_hotkey_quickstart, int, 0644);
+MODULE_PARM_DESC(hci_hotkey_quickstart,
+		 "Call HCI_HOTKEY_EVENT with value 0x5 for quickstart button support (-1 = auto, 0 = no, 1 = yes");
+
 #define TOSHIBA_WMI_EVENT_GUID "59142400-C6A3-40FA-BADB-8A2652834100"
 
 /* Scan code for Fn key on TOS1900 models */
@@ -136,6 +141,7 @@ MODULE_PARM_DESC(turn_on_panel_on_resume,
 #define HCI_ACCEL_MASK			0x7fff
 #define HCI_ACCEL_DIRECTION_MASK	0x8000
 #define HCI_HOTKEY_DISABLE		0x0b
+#define HCI_HOTKEY_ENABLE_QUICKSTART	0x05
 #define HCI_HOTKEY_ENABLE		0x09
 #define HCI_HOTKEY_SPECIAL_FUNCTIONS	0x10
 #define HCI_LCD_BRIGHTNESS_BITS		3
@@ -2730,10 +2736,15 @@ static int toshiba_acpi_enable_hotkeys(struct toshiba_acpi_dev *dev)
 		return -ENODEV;
 
 	/*
+	 * Enable quickstart buttons if supported.
+	 *
 	 * Enable the "Special Functions" mode only if they are
 	 * supported and if they are activated.
 	 */
-	if (dev->kbd_function_keys_supported && dev->special_functions)
+	if (hci_hotkey_quickstart)
+		result = hci_write(dev, HCI_HOTKEY_EVENT,
+				   HCI_HOTKEY_ENABLE_QUICKSTART);
+	else if (dev->kbd_function_keys_supported && dev->special_functions)
 		result = hci_write(dev, HCI_HOTKEY_EVENT,
 				   HCI_HOTKEY_SPECIAL_FUNCTIONS);
 	else
@@ -3257,7 +3268,14 @@ static const char *find_hci_method(acpi_handle handle)
  * works. toshiba_acpi_resume() uses HCI_PANEL_POWER_ON to avoid changing
  * the configured brightness level.
  */
-static const struct dmi_system_id turn_on_panel_on_resume_dmi_ids[] = {
+#define QUIRK_TURN_ON_PANEL_ON_RESUME		BIT(0)
+/*
+ * Some Toshibas use "quickstart" keys. On these, HCI_HOTKEY_EVENT must use
+ * the value HCI_HOTKEY_ENABLE_QUICKSTART.
+ */
+#define QUIRK_HCI_HOTKEY_QUICKSTART		BIT(1)
+
+static const struct dmi_system_id toshiba_dmi_quirks[] = {
 	{
 	 /* Toshiba Portégé R700 */
 	 /* https://bugzilla.kernel.org/show_bug.cgi?id=21012 */
@@ -3265,6 +3283,7 @@ static const struct dmi_system_id turn_on_panel_on_resume_dmi_ids[] = {
 		DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 		DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE R700"),
 		},
+	 .driver_data = (void *)QUIRK_TURN_ON_PANEL_ON_RESUME,
 	},
 	{
 	 /* Toshiba Satellite/Portégé R830 */
@@ -3274,6 +3293,7 @@ static const struct dmi_system_id turn_on_panel_on_resume_dmi_ids[] = {
 		DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 		DMI_MATCH(DMI_PRODUCT_NAME, "R830"),
 		},
+	 .driver_data = (void *)QUIRK_TURN_ON_PANEL_ON_RESUME,
 	},
 	{
 	 /* Toshiba Satellite/Portégé Z830 */
@@ -3281,6 +3301,7 @@ static const struct dmi_system_id turn_on_panel_on_resume_dmi_ids[] = {
 		DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 		DMI_MATCH(DMI_PRODUCT_NAME, "Z830"),
 		},
+	 .driver_data = (void *)(QUIRK_TURN_ON_PANEL_ON_RESUME | QUIRK_HCI_HOTKEY_QUICKSTART),
 	},
 };
 
@@ -3289,6 +3310,8 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev)
 	struct toshiba_acpi_dev *dev;
 	const char *hci_method;
 	u32 dummy;
+	const struct dmi_system_id *dmi_id;
+	long quirks = 0;
 	int ret = 0;
 
 	if (toshiba_acpi)
@@ -3441,8 +3464,15 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev)
 	}
 #endif
 
+	dmi_id = dmi_first_match(toshiba_dmi_quirks);
+	if (dmi_id)
+		quirks = (long)dmi_id->driver_data;
+
 	if (turn_on_panel_on_resume == -1)
-		turn_on_panel_on_resume = dmi_check_system(turn_on_panel_on_resume_dmi_ids);
+		turn_on_panel_on_resume = !!(quirks & QUIRK_TURN_ON_PANEL_ON_RESUME);
+
+	if (hci_hotkey_quickstart == -1)
+		hci_hotkey_quickstart = !!(quirks & QUIRK_HCI_HOTKEY_QUICKSTART);
 
 	toshiba_wwan_available(dev);
 	if (dev->wwan_supported)

--
2.39.2

#4 lore raw
In reply to Armin Wolf
Quoted 13 lines · Armin Wolf

This patch series adds support for the ACPI PNP0C32 device as proposed in 2022 by Arvid Norlander. The first patch adds support for the device itself, while the second patch was taken from the original series.

Both patches are compile-tested only.

Armin Wolf (1):
platform/x86: Add ACPI quickstart button (PNP0C32) driver

Arvid Norlander (1):
platform/x86: toshiba_acpi: Add quirk for buttons on Z830

Quoted 6 lines
 MAINTAINERS                         |   6 +
 drivers/platform/x86/Kconfig        |  13 ++
 drivers/platform/x86/Makefile       |   3 +
 drivers/platform/x86/quickstart.c   | 225 ++++++++++++++++++++++++++++
 drivers/platform/x86/toshiba_acpi.c |  36 ++++-
 5 files changed, 280 insertions(+), 3 deletions(-)

No change here in HP Compaq land, except for the existence of this new Quickstart Button1, no activity is reported via my HP WMI hotkeys or the Quickstart Button, but rather through AT Translated Set 2 keyboard, as usual - the same behaviour as not having hp-wmi or quickstart (eg. if I unload the modules).

[    2.517431] input: HP WMI hotkeys as /devices/virtual/input/input14
[    4.397304] ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Index (0x000000032) is beyond end of object (length 0x32) (20230628/exoparg2-393)
[    4.399581] ACPI Error: Aborting method \_SB.C27D.WQBE due to previous error (AE_AML_BUFFER_LIMIT) (20230628/psparse-529)
[    4.425162] ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Index (0x000000032) is beyond end of object (length 0x32) (20230628/exoparg2-393)
[    4.426760] ACPI Error: Aborting method \_SB.C27D.WQBE due to previous error (AE_AML_BUFFER_LIMIT) (20230628/psparse-529)
[    4.593291] hp_bioscfg: Returned error 0x3, "Invalid command value/Feature not supported"
[    4.606696] input: Quickstart Button 1 as /devices/platform/PNP0C32:00/input/input16

/dev/input/event4 (AT Translated Set 2 keyboard) opened successfully /dev/input/event6 (HP WMI hotkeys) opened successfully /dev/input/event8 (Quickstart Button 1) opened successfully

Maybe this HP documentation might help, there are ACPI tables and stuff mentioned around page 8 ... http://dennisn.mooo.com/stuff/direct-launch.pdf

author maintainer
#5 lore raw

Am 31.01.24 um 16:42 schrieb Dennis Nezic:

Quoted 36 lines · Armin Wolf
Quoted 13 lines

This patch series adds support for the ACPI PNP0C32 device as proposed in 2022 by Arvid Norlander. The first patch adds support for the device itself, while the second patch was taken from the original series.

Both patches are compile-tested only.

Armin Wolf (1):
platform/x86: Add ACPI quickstart button (PNP0C32) driver

Arvid Norlander (1):
platform/x86: toshiba_acpi: Add quirk for buttons on Z830

Quoted 6 lines
  MAINTAINERS                         |   6 +
  drivers/platform/x86/Kconfig        |  13 ++
  drivers/platform/x86/Makefile       |   3 +
  drivers/platform/x86/quickstart.c   | 225 ++++++++++++++++++++++++++++
  drivers/platform/x86/toshiba_acpi.c |  36 ++++-
  5 files changed, 280 insertions(+), 3 deletions(-)

No change here in HP Compaq land, except for the existence of this new Quickstart Button1, no activity is reported via my HP WMI hotkeys or the Quickstart Button, but rather through AT Translated Set 2 keyboard, as usual - the same behaviour as not having hp-wmi or quickstart (eg. if I unload the modules).

[    2.517431] input: HP WMI hotkeys as /devices/virtual/input/input14
[    4.397304] ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Index (0x000000032) is beyond end of object (length 0x32) (20230628/exoparg2-393)
[    4.399581] ACPI Error: Aborting method \_SB.C27D.WQBE due to previous error (AE_AML_BUFFER_LIMIT) (20230628/psparse-529)
[    4.425162] ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Index (0x000000032) is beyond end of object (length 0x32) (20230628/exoparg2-393)
[    4.426760] ACPI Error: Aborting method \_SB.C27D.WQBE due to previous error (AE_AML_BUFFER_LIMIT) (20230628/psparse-529)
[    4.593291] hp_bioscfg: Returned error 0x3, "Invalid command value/Feature not supported"
[    4.606696] input: Quickstart Button 1 as /devices/platform/PNP0C32:00/input/input16
Quoted 7 lines

/dev/input/event4 (AT Translated Set 2 keyboard) opened successfully /dev/input/event6 (HP WMI hotkeys) opened successfully /dev/input/event8 (Quickstart Button 1) opened successfully

Maybe this HP documentation might help, there are ACPI tables and stuff mentioned around page 8 ... http://dennisn.mooo.com/stuff/direct-launch.pdf

The issue is that you machine does not support runtime button events on the quickstart button, only wake events.

Can you check if you can now use the unresponsive button to wake the system?

Armin Wolf

#6 lore raw
Quoted 4 lines · Armin Wolf

The issue is that you machine does not support runtime button events on the quickstart button, only wake events.

Can you check if you can now use the unresponsive button to wake the system?

Nope, only the main power button can wake it from a sleep state, those quickstart buttons do nothing.

author maintainer
#7 lore raw

Am 31.01.24 um 18:17 schrieb Dennis Nezic:

Quoted 7 lines · Armin Wolf
Quoted 4 lines

The issue is that you machine does not support runtime button events on the quickstart button, only wake events.

Can you check if you can now use the unresponsive button to wake the system?

Nope, only the main power button can wake it from a sleep state, those quickstart buttons do nothing.

Can you check if this is still the case when you configure the PNP0C32 ACPI device to be able to generate wakeup events (from S5, S4 and S3)?
Maybe you should unload the quickstart driver for this test.

If the button still does nothing, then it could be that the quickstart device is not handling this button. Then we need some new ideas.

Armin Wolf

#8 lore raw
Quoted 10 lines · Armin Wolf

Am 31.01.24 um 18:17 schrieb Dennis Nezic:

Quoted 7 lines · Armin Wolf
Quoted 4 lines

The issue is that you machine does not support runtime button events on the quickstart button, only wake events.

Can you check if you can now use the unresponsive button to wake the system?

Nope, only the main power button can wake it from a sleep state, those quickstart buttons do nothing.

Quoted 6 lines

Can you check if this is still the case when you configure the PNP0C32 ACPI device to be able to generate wakeup events (from S5, S4 and S3)?
Maybe you should unload the quickstart driver for this test.

If the button still does nothing, then it could be that the quickstart device is not handling this button. Then we need some new ideas.

Yea I don't think quickstart/hp-wmi is handling it. As I said, the behavior is exactly the same as if I didn't have it compiled at all.

I enabled it via /proc/acpi/wakeup (it was disabled initially) (the S-state in that file only mentions S5, but I guess that should include all the less sleepy states too). No effect. I tried with and without the quickstart device.

#9 lore raw

Hi Dennis,

Quoted 18 lines · Dennis Nezic
Quoted 10 lines · Armin Wolf

Am 31.01.24 um 18:17 schrieb Dennis Nezic:

Quoted 7 lines · Armin Wolf
Quoted 4 lines

The issue is that you machine does not support runtime button events on the quickstart button, only wake events.

Can you check if you can now use the unresponsive button to wake the system?

Nope, only the main power button can wake it from a sleep state, those quickstart buttons do nothing.

Quoted 6 lines

Can you check if this is still the case when you configure the PNP0C32 ACPI device to be able to generate wakeup events (from S5, S4 and S3)?
Maybe you should unload the quickstart driver for this test.

If the button still does nothing, then it could be that the quickstart device is not handling this button. Then we need some new ideas.

Quoted 7 lines

Yea I don't think quickstart/hp-wmi is handling it. As I said, the behavior is exactly the same as if I didn't have it compiled at all.

I enabled it via /proc/acpi/wakeup (it was disabled initially) (the S-state in that file only mentions S5, but I guess that should include all the less sleepy states too). No effect. I tried with and without the quickstart device.

Perhaps this is simply a hw defect, have you seen the button working under Windows? Maybe at some point some liquid got inside the keyboard around that button?

The main keyboard buttons are typically membrane style buttons.

But extra media keys might be more remote control style, where there are not rubber domes beneath hard plastic keys, but the keys themselves are rubber, with some carbon conductor on the bottom and they directly connect 2 copper pads on the PCB.

These remote style buttons are quite sensitive to dirt getting underneath (just like the buttons in a typical TV remote).

Assuming you can get things disassembled easily you may want to try and clean things.

Regards,

Hans

#10 lore raw
Quoted 24 lines · Hans de Goede

Hi Dennis,

Quoted 21 lines · Dennis Nezic
Quoted 10 lines · Armin Wolf

Am 31.01.24 um 18:17 schrieb Dennis Nezic:

Quoted 7 lines · Armin Wolf
Quoted 4 lines

The issue is that you machine does not support runtime button events on the quickstart button, only wake events.

Can you check if you can now use the unresponsive button to wake the system?

Nope, only the main power button can wake it from a sleep state, those quickstart buttons do nothing.

Quoted 6 lines

Can you check if this is still the case when you configure the PNP0C32 ACPI device to be able to generate wakeup events (from S5, S4 and S3)?
Maybe you should unload the quickstart driver for this test.

If the button still does nothing, then it could be that the quickstart device is not handling this button. Then we need some new ideas.

Yea I don't think quickstart/hp-wmi is handling it. As I said, the behavior is exactly the same as if I didn't have it compiled at all.

Quoted 8 lines
Quoted 4 lines

I enabled it via /proc/acpi/wakeup (it was disabled initially) (the S-state in that file only mentions S5, but I guess that should include all the less sleepy states too). No effect. I tried with and without the quickstart device.

Perhaps this is simply a hw defect, have you seen the button working under Windows? Maybe at some point some liquid got inside the keyboard around that button?

Unlikely. I have 2 of these laptops, same behavior. Never saw them with Windows.

Quoted 7 lines

The main keyboard buttons are typically membrane style buttons.

But extra media keys might be more remote control style, where there are not rubber domes beneath hard plastic keys, but the keys themselves are rubber, with some carbon conductor on the bottom and they directly connect 2 copper pads on the PCB.

Quoted 5 lines

These remote style buttons are quite sensitive to dirt getting underneath (just like the buttons in a typical TV remote).

Assuming you can get things disassembled easily you may want to try and clean things.

These ones are more like a phone touchscreen ... it's just a long solid plastic sheet, no distinct edges (annoying), with leds underneath. All the led's get illuminated when touched, even this mysterious "info" key.

#11 lore raw

Hi,

Quoted 47 lines · Dennis Nezic
Quoted 24 lines · Hans de Goede

Hi Dennis,

Quoted 21 lines · Dennis Nezic
Quoted 10 lines · Armin Wolf

Am 31.01.24 um 18:17 schrieb Dennis Nezic:

Quoted 7 lines · Armin Wolf
Quoted 4 lines

The issue is that you machine does not support runtime button events on the quickstart button, only wake events.

Can you check if you can now use the unresponsive button to wake the system?

Nope, only the main power button can wake it from a sleep state, those quickstart buttons do nothing.

Quoted 6 lines

Can you check if this is still the case when you configure the PNP0C32 ACPI device to be able to generate wakeup events (from S5, S4 and S3)?
Maybe you should unload the quickstart driver for this test.

If the button still does nothing, then it could be that the quickstart device is not handling this button. Then we need some new ideas.

Yea I don't think quickstart/hp-wmi is handling it. As I said, the behavior is exactly the same as if I didn't have it compiled at all.

Quoted 8 lines
Quoted 4 lines

I enabled it via /proc/acpi/wakeup (it was disabled initially) (the S-state in that file only mentions S5, but I guess that should include all the less sleepy states too). No effect. I tried with and without the quickstart device.

Perhaps this is simply a hw defect, have you seen the button working under Windows? Maybe at some point some liquid got inside the keyboard around that button?

Unlikely. I have 2 of these laptops, same behavior. Never saw them with Windows.

Quoted 10 lines

The main keyboard buttons are typically membrane style buttons.

But extra media keys might be more remote control style, where there are not rubber domes beneath hard plastic keys, but the keys themselves are rubber, with some carbon conductor on the bottom and they directly connect 2 copper pads on the PCB.

These remote style buttons are quite sensitive to dirt getting underneath (just like the buttons in a typical TV remote).

Quoted 6 lines
Quoted 2 lines

Assuming you can get things disassembled easily you may want to try and clean things.

These ones are more like a phone touchscreen ... it's just a long solid plastic sheet, no distinct edges (annoying), with leds underneath. All the led's get illuminated when touched, even this mysterious "info" key.

Interesting. If the LED underneath lights up when touching then I agree that it is unlikely that this is a hw defect.

Regards.

Hans

Tested-by Reviewed-by on the v1 series
#12 lore raw
In reply to Armin Wolf

Hi Armin and Arvid,

Quoted 6 lines · Armin Wolf

This patch series adds support for the ACPI PNP0C32 device as proposed in 2022 by Arvid Norlander. The first patch adds support for the device itself, while the second patch was taken from the original series.

Both patches are compile-tested only.

Armin, thank you for creating a new cleaned up driver for the quickstart button support.

I have managed to get my hands on a Toshiba Portege Z830 and I have successfully tested this series. That is this makes the 2 quickstart application and the toggle-touchpad button work when the system is running normally.

Neither the quickstart buttons, nor the touchpad-toggle button which also uses the PNP0C32 interface, work to wakeup the system from sleep though.

I've also review both patches and they look good to me:

So I plan to merge this series into pdx86/for-next once 6.9-rc1 is out.

Regards,

Hans

Quoted 18 lines

Armin Wolf (1):
platform/x86: Add ACPI quickstart button (PNP0C32) driver

Arvid Norlander (1):
platform/x86: toshiba_acpi: Add quirk for buttons on Z830

 MAINTAINERS                         |   6 +
 drivers/platform/x86/Kconfig        |  13 ++
 drivers/platform/x86/Makefile       |   3 +
 drivers/platform/x86/quickstart.c   | 225 ++++++++++++++++++++++++++++
 drivers/platform/x86/toshiba_acpi.c |  36 ++++-
 5 files changed, 280 insertions(+), 3 deletions(-)
 create mode 100644 drivers/platform/x86/quickstart.c

--
2.39.2

author maintainer
#13 lore raw

Am 24.03.24 um 15:55 schrieb Hans de Goede:

Quoted 26 lines

Hi Armin and Arvid,

Quoted 6 lines · Armin Wolf

This patch series adds support for the ACPI PNP0C32 device as proposed in 2022 by Arvid Norlander. The first patch adds support for the device itself, while the second patch was taken from the original series.

Both patches are compile-tested only.

Armin, thank you for creating a new cleaned up driver for the quickstart button support.

I have managed to get my hands on a Toshiba Portege Z830 and I have successfully tested this series. That is this makes the 2 quickstart application and the toggle-touchpad button work when the system is running normally.

Neither the quickstart buttons, nor the touchpad-toggle button which also uses the PNP0C32 interface, work to wakeup the system from sleep though.

I've also review both patches and they look good to me:

Quoted 7 lines

So I plan to merge this series into pdx86/for-next once 6.9-rc1 is out.

Regards,

Hans

Hi,

great to hear that the driver works. Can you send me the output of "acpidump" on this machine? Maybe the quickstart buttons have no wake capabilities?

Thanks,
Armin Wolf

Quoted 19 lines
Quoted 18 lines

Armin Wolf (1):
platform/x86: Add ACPI quickstart button (PNP0C32) driver

Arvid Norlander (1):
platform/x86: toshiba_acpi: Add quirk for buttons on Z830

  MAINTAINERS                         |   6 +
  drivers/platform/x86/Kconfig        |  13 ++
  drivers/platform/x86/Makefile       |   3 +
  drivers/platform/x86/quickstart.c   | 225 ++++++++++++++++++++++++++++
  drivers/platform/x86/toshiba_acpi.c |  36 ++++-
  5 files changed, 280 insertions(+), 3 deletions(-)

create mode 100644 drivers/platform/x86/quickstart.c

--
2.39.2

#14 lore raw
In reply to Hans de Goede
Quoted 10 lines · Hans de Goede

Hi Armin and Arvid,

Quoted 6 lines · Armin Wolf

This patch series adds support for the ACPI PNP0C32 device as proposed in 2022 by Arvid Norlander. The first patch adds support for the device itself, while the second patch was taken from the original series.

Both patches are compile-tested only.

Quoted 7 lines

Armin, thank you for creating a new cleaned up driver for the quickstart button support.

I have managed to get my hands on a Toshiba Portege Z830 and I have successfully tested this series. That is this makes the 2 quickstart application and the toggle-touchpad button work when the system is running normally.

That is some dedication! Sorry for completely dropping the ball on this, real life happened and I had to prioritise. My beginning "carreer" as a kernel developer was one of the things that ended up getting cut.

I'm going to do a quick bug report while I'm writing an email here. I noticed on my Z830 that the readouts of the charge control thresholds didn't seem to work when I last tested it. Setting worked just fine, but reading it always returns 100%. Didn't get around to debugging this, but I assume it a simple error.

Also my Z830 have developed a whole horizontal line of stuck red pixels across the middle of the screen, so it seems quite unlikely I'll use it much more or even keep it long term.

Quoted 3 lines

Neither the quickstart buttons, nor the touchpad-toggle button which also uses the PNP0C32 interface, work to wakeup the system from sleep though.

This is probably a limitation of the hardware. Though there are IIRC some BIOS options for what should wake the laptop from power-off, including any keyboard press whatsoever. (Fun fact: The Toshiba ACPI interface allows changing these BIOS settings from the OS, though you would have to do it by hand from user space currently as it is not exposed in the driver.)

Best regards,
Arvid Norlander

#15 lore raw
In reply to Armin Wolf

Hi,

Quoted 6 lines · Armin Wolf

This patch series adds support for the ACPI PNP0C32 device as proposed in 2022 by Arvid Norlander. The first patch adds support for the device itself, while the second patch was taken from the original series.

Both patches are compile-tested only.

Not anymore :)

Thank you for your patch-series, I've applied the series to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

Regards,

Hans

Quoted 18 lines

Armin Wolf (1):
platform/x86: Add ACPI quickstart button (PNP0C32) driver

Arvid Norlander (1):
platform/x86: toshiba_acpi: Add quirk for buttons on Z830

 MAINTAINERS                         |   6 +
 drivers/platform/x86/Kconfig        |  13 ++
 drivers/platform/x86/Makefile       |   3 +
 drivers/platform/x86/quickstart.c   | 225 ++++++++++++++++++++++++++++
 drivers/platform/x86/toshiba_acpi.c |  36 ++++-
 5 files changed, 280 insertions(+), 3 deletions(-)
 create mode 100644 drivers/platform/x86/quickstart.c

--
2.39.2