mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86: hp-wmi: Handle Omen Key event
@ 2023-01-17 22:38 Rishit Bansal
  2023-01-23 13:32 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Rishit Bansal @ 2023-01-17 22:38 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86, linux-kernel

Add support to map the "HP Omen Key" to KEY_PROG2. Laptops in the HP
Omen Series open the HP Omen Command Center application on windows. But,
on linux it fails with the following message from the hp-wmi driver:

[ 5143.415714] hp_wmi: Unknown event_id - 29 - 0x21a5

Signed-off-by: Rishit Bansal <rishitbansal0@gmail.com>
---
 drivers/platform/x86/hp/hp-wmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index 0a99058be813..d8ba3c483901 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -91,6 +91,7 @@ enum hp_wmi_event_ids {
 	HPWMI_BATTERY_CHARGE_PERIOD	= 0x10,
 	HPWMI_SANITIZATION_MODE		= 0x17,
 	HPWMI_SMART_EXPERIENCE_APP	= 0x21,
+	HPWMI_OMEN_KEY				= 0x1D,
 };
 
 /*
@@ -219,6 +220,7 @@ static const struct key_entry hp_wmi_keymap[] = {
 	{ KE_KEY, 0x21a9,  { KEY_TOUCHPAD_OFF } },
 	{ KE_KEY, 0x121a9, { KEY_TOUCHPAD_ON } },
 	{ KE_KEY, 0x231b,  { KEY_HELP } },
+	{ KE_KEY, 0x21a5,  { KEY_PROG2 }}, /* HP Omen Key */
 	{ KE_END, 0 }
 };
 
@@ -810,6 +812,7 @@ static void hp_wmi_notify(u32 value, void *context)
 	case HPWMI_SMART_ADAPTER:
 		break;
 	case HPWMI_BEZEL_BUTTON:
+	case HPWMI_OMEN_KEY:
 		key_code = hp_wmi_read_int(HPWMI_HOTKEY_QUERY);
 		if (key_code < 0)
 			break;
-- 
2.37.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Handle Omen Key event
  2023-01-17 22:38 [PATCH] platform/x86: hp-wmi: Handle Omen Key event Rishit Bansal
@ 2023-01-23 13:32 ` Hans de Goede
  2023-01-23 13:34   ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2023-01-23 13:32 UTC (permalink / raw)
  To: Rishit Bansal, Mark Gross, platform-driver-x86, linux-kernel

Hi,

On 1/17/23 23:38, Rishit Bansal wrote:
> Add support to map the "HP Omen Key" to KEY_PROG2. Laptops in the HP
> Omen Series open the HP Omen Command Center application on windows. But,
> on linux it fails with the following message from the hp-wmi driver:
> 
> [ 5143.415714] hp_wmi: Unknown event_id - 29 - 0x21a5
> 
> Signed-off-by: Rishit Bansal <rishitbansal0@gmail.com>

Thank you for your patch, I've applied this patch 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


> ---
>  drivers/platform/x86/hp/hp-wmi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
> index 0a99058be813..d8ba3c483901 100644
> --- a/drivers/platform/x86/hp/hp-wmi.c
> +++ b/drivers/platform/x86/hp/hp-wmi.c
> @@ -91,6 +91,7 @@ enum hp_wmi_event_ids {
>  	HPWMI_BATTERY_CHARGE_PERIOD	= 0x10,
>  	HPWMI_SANITIZATION_MODE		= 0x17,
>  	HPWMI_SMART_EXPERIENCE_APP	= 0x21,
> +	HPWMI_OMEN_KEY				= 0x1D,
>  };
>  
>  /*
> @@ -219,6 +220,7 @@ static const struct key_entry hp_wmi_keymap[] = {
>  	{ KE_KEY, 0x21a9,  { KEY_TOUCHPAD_OFF } },
>  	{ KE_KEY, 0x121a9, { KEY_TOUCHPAD_ON } },
>  	{ KE_KEY, 0x231b,  { KEY_HELP } },
> +	{ KE_KEY, 0x21a5,  { KEY_PROG2 }}, /* HP Omen Key */
>  	{ KE_END, 0 }
>  };
>  
> @@ -810,6 +812,7 @@ static void hp_wmi_notify(u32 value, void *context)
>  	case HPWMI_SMART_ADAPTER:
>  		break;
>  	case HPWMI_BEZEL_BUTTON:
> +	case HPWMI_OMEN_KEY:
>  		key_code = hp_wmi_read_int(HPWMI_HOTKEY_QUERY);
>  		if (key_code < 0)
>  			break;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: hp-wmi: Handle Omen Key event
  2023-01-23 13:32 ` Hans de Goede
@ 2023-01-23 13:34   ` Hans de Goede
  0 siblings, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2023-01-23 13:34 UTC (permalink / raw)
  To: Rishit Bansal, Mark Gross, platform-driver-x86, linux-kernel

Hi,

On 1/23/23 14:32, Hans de Goede wrote:
> Hi,
> 
> On 1/17/23 23:38, Rishit Bansal wrote:
>> Add support to map the "HP Omen Key" to KEY_PROG2. Laptops in the HP
>> Omen Series open the HP Omen Command Center application on windows. But,
>> on linux it fails with the following message from the hp-wmi driver:
>>
>> [ 5143.415714] hp_wmi: Unknown event_id - 29 - 0x21a5
>>
>> Signed-off-by: Rishit Bansal <rishitbansal0@gmail.com>
> 
> Thank you for your patch, I've applied this patch 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.

I just noticed you send out a v2. I'll replace the patch in my
branch with v2 instead.

Regards,

Hans


>> ---
>>  drivers/platform/x86/hp/hp-wmi.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
>> index 0a99058be813..d8ba3c483901 100644
>> --- a/drivers/platform/x86/hp/hp-wmi.c
>> +++ b/drivers/platform/x86/hp/hp-wmi.c
>> @@ -91,6 +91,7 @@ enum hp_wmi_event_ids {
>>  	HPWMI_BATTERY_CHARGE_PERIOD	= 0x10,
>>  	HPWMI_SANITIZATION_MODE		= 0x17,
>>  	HPWMI_SMART_EXPERIENCE_APP	= 0x21,
>> +	HPWMI_OMEN_KEY				= 0x1D,
>>  };
>>  
>>  /*
>> @@ -219,6 +220,7 @@ static const struct key_entry hp_wmi_keymap[] = {
>>  	{ KE_KEY, 0x21a9,  { KEY_TOUCHPAD_OFF } },
>>  	{ KE_KEY, 0x121a9, { KEY_TOUCHPAD_ON } },
>>  	{ KE_KEY, 0x231b,  { KEY_HELP } },
>> +	{ KE_KEY, 0x21a5,  { KEY_PROG2 }}, /* HP Omen Key */
>>  	{ KE_END, 0 }
>>  };
>>  
>> @@ -810,6 +812,7 @@ static void hp_wmi_notify(u32 value, void *context)
>>  	case HPWMI_SMART_ADAPTER:
>>  		break;
>>  	case HPWMI_BEZEL_BUTTON:
>> +	case HPWMI_OMEN_KEY:
>>  		key_code = hp_wmi_read_int(HPWMI_HOTKEY_QUERY);
>>  		if (key_code < 0)
>>  			break;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-23 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 22:38 [PATCH] platform/x86: hp-wmi: Handle Omen Key event Rishit Bansal
2023-01-23 13:32 ` Hans de Goede
2023-01-23 13:34   ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®