Skip to contentSkip to conversation

toshiba_acpi: Propagate the hotkey value via genetlink

PATCH In review Azael Avalos 2 participants 6 messages Nov 16, 2015 – Nov 21, 2015

Subsystems (3)
lore
Share & tools
lore

Azael Avalos

author maintainer
#0 lore raw

PATCH 1/1 toshiba_acpi: Propagate the hotkey value via genetlink

The driver uses genetlink to inform userspace of events generated by the system, but the data passed is always zero as there is no data to pass, except for the hotkey event.

This patch propagates the hotkey value via genetlink so userspace can make use of it.

---
 drivers/platform/x86/toshiba_acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/toshiba_acpi.c +2 -1
index 7f71f8f..63c231a 100644
@@ -2966,7 +2966,8 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
 
 	acpi_bus_generate_netlink_event(acpi_dev->pnp.device_class,
 					dev_name(&acpi_dev->dev),
-					event, 0);
+					event, (event == 0x80) ?
+					dev->last_key_event : 0);
 }
 
 #ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.6.2
author maintainer
#1 lore raw

PATCH 1/1 toshiba_bluetooth: Add missing newline in toshiba_bluetooth_present function

This patch simply adds a missing newline in the error string printed by the toshiba_bluetooth_present function.

This is just a cosmetic change, no functionality was changed.

---
 drivers/platform/x86/toshiba_bluetooth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/toshiba_bluetooth.c +1 -1
index c5e4508..5db495d 100644
@@ -78,7 +78,7 @@ static int toshiba_bluetooth_present(acpi_handle handle)
 	 */
 	result = acpi_evaluate_integer(handle, "_STA", NULL, &bt_present);
 	if (ACPI_FAILURE(result)) {
-		pr_err("ACPI call to query Bluetooth presence failed");
+		pr_err("ACPI call to query Bluetooth presence failed\n");
 		return -ENXIO;
 	} else if (!bt_present) {
 		pr_info("Bluetooth device not present\n");
Signature · 1 line
2.6.2
Applied
#2 lore raw

Re: [PATCH] toshiba_bluetooth: Add missing newline in toshiba_bluetooth_present function

Quoted 6 lines · Azael Avalos

This patch simply adds a missing newline in the error string printed by the toshiba_bluetooth_present function.

This is just a cosmetic change, no functionality was changed.

Thanks, applied.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#3 lore raw
In reply to Azael Avalos
Quoted 6 lines · Azael Avalos

The driver uses genetlink to inform userspace of events generated by the system, but the data passed is always zero as there is no data to pass, except for the hotkey event.

This patch propagates the hotkey value via genetlink so userspace can make use of it.

Which keys were not working previously?

My concern is that we introduce new events that then get "double handled".

Some more context about the problem experienced and how this resolves it would be helpful.

Thanks,

Quoted 24 lines
---
 drivers/platform/x86/toshiba_acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/toshiba_acpi.c +2 -1
index 7f71f8f..63c231a 100644
@@ -2966,7 +2966,8 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
 
 	acpi_bus_generate_netlink_event(acpi_dev->pnp.device_class,
 					dev_name(&acpi_dev->dev),
-					event, 0);
+					event, (event == 0x80) ?
+					dev->last_key_event : 0);
 }
 
 #ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.6.2
Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
author maintainer
#4 lore raw

Hi Darren,

2015-11-20 16:19 GMT-07:00 Darren Hart <[email protected]>:

Quoted 9 lines · Azael Avalos
Quoted 6 lines

The driver uses genetlink to inform userspace of events generated by the system, but the data passed is always zero as there is no data to pass, except for the hotkey event.

This patch propagates the hotkey value via genetlink so userspace can make use of it.

Which keys were not working previously?

It's not about the keys, but the "extra events" generated, I still do not know why Toshiba sent system events inside the hotkey event (maybe they ran out of numbers...).

Quoted 3 lines

My concern is that we introduce new events that then get "double handled".

Well, the events are already being generated, but they are Toshiba specific events, the only thing here that changed is that now we pass the hotkey value to userspace, and as said, some of the system events that were not passed before and are not handled at all.

A good example here are the 0x1ABE and 0x1ABF events, which fire (on certain laptops) when the HDD protection level changes and is disabled respectively.

There a re a lot of unknown events that are being sent as hotkeys, but I still have to ideintify them :-(

Quoted 5 lines

Some more context about the problem experienced and how this resolves it would be helpful.

Thanks,

Cheers
Azael

Signature · 1 line
-- El mundo apesta y vosotros apestais tambien --
#5 lore raw
Quoted 26 lines · Azael Avalos

Hi Darren,

2015-11-20 16:19 GMT-07:00 Darren Hart <[email protected]>:

Quoted 9 lines · Azael Avalos
Quoted 6 lines

The driver uses genetlink to inform userspace of events generated by the system, but the data passed is always zero as there is no data to pass, except for the hotkey event.

This patch propagates the hotkey value via genetlink so userspace can make use of it.

Which keys were not working previously?

It's not about the keys, but the "extra events" generated, I still do not know why Toshiba sent system events inside the hotkey event (maybe they ran out of numbers...).

Quoted 3 lines

My concern is that we introduce new events that then get "double handled".

Well, the events are already being generated, but they are Toshiba specific events, the only thing here that changed is that now we pass the hotkey value to userspace, and as said, some of the system events that were not passed before and are not handled at all.

Quoted 6 lines

A good example here are the 0x1ABE and 0x1ABF events, which fire (on certain laptops) when the HDD protection level changes and is disabled respectively.

There a re a lot of unknown events that are being sent as hotkeys, but I still have to ideintify them :-(

Thanks for the context, queued to testing.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center