pelrun / hp-omen-linux-module

Control the HP Omen keyboard lighting and performance settings in Linux
GNU General Public License v2.0
171 stars 28 forks source link

Fix reading setting of keyboard backlight #7

Closed wl2776 closed 3 years ago

wl2776 commented 3 years ago
  1. Add reading settings of keyboard backlight so that cat from rgb zones return correct values at first load

  2. Add draft of experiments with Omen key.

markozajc commented 3 years ago

Pressing the Omen key seems to still throw a bad event status 0x5 for me.

wl2776 commented 3 years ago

Pressing the Omen key seems to still throw a bad event status 0x5 for me.

It works on my HP Omen 15, manufactured in 2020.

In my case I was receiving message "Unknown event_id - 1d". I've found respective message in sources and have figured out how to process it.

In your case something was not found. bad event status 0x5 is printed at line 552 in processing of result returned by wmi_get_event_data

You can see this function here: https://elixir.bootlin.com/linux/latest/source/drivers/platform/x86/wmi.c#L607

Its bottom line is return AE_NOT_FOUND. Value of this macro is 5.

pelrun commented 3 years ago

I'd recommend not hard-coding the Omen key to an existing function. It's possible to emit a custom keycode which can then be configured using setkeycode in userspace (I already use setkeycodes e057 240 e058 240 to fix the incorrect lid open/close behaviour.)

wl2776 commented 3 years ago

I'd recommend not hard-coding the Omen key to an existing function. It's possible to emit a custom keycode which can then be configured using setkeycode in userspace

I am new to kernel development. Is there any table listing keycodes in the world?

wl2776 commented 3 years ago

I'll be back :)

pelrun commented 3 years ago

I did a bit of idle digging yesterday and discovered I can decompile the ACPI bytecode that implements the WMI commands/events that the kernel module is interfacing with. It's answered a few questions I had about the led control, but opened up another can of worms for the hotkey stuff.

@wl2776, any chance you could dump the acpi firmware of your laptop for comparison purposes, since yours is behaving differently to mine/markozajc? The command would be sudo acpidump > acpidump.hex (obviously you'll need to install acpidump first.)

wl2776 commented 3 years ago

@wl2776, any chance you could dump the acpi firmware of your laptop for comparison purposes

Done, have sent to the email address in your profile.