Re: [PATCH 3/3] platform/x86: panasonic-laptop: Add support for programmable buttons

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 3 Sep 2024, Hans de Goede wrote:

> From: James Harmison <jharmison@xxxxxxxxxx>
> 
> Newer panasonic toughbook models have a number of programmable buttons,
> add support for these.
> 
> Tested-by: James Harmison <jharmison@xxxxxxxxxx>
> Signed-off-by: James Harmison <jharmison@xxxxxxxxxx>
> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> ---
>  drivers/platform/x86/panasonic-laptop.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
> index 4c9e20e1afe8..2070caa1ea1b 100644
> --- a/drivers/platform/x86/panasonic-laptop.c
> +++ b/drivers/platform/x86/panasonic-laptop.c
> @@ -224,6 +224,17 @@ static const struct key_entry panasonic_keymap[] = {
>  	{ KE_KEY, 8, { KEY_PROG1 } }, /* Change CPU boost */
>  	{ KE_KEY, 9, { KEY_BATTERY } },
>  	{ KE_KEY, 10, { KEY_SUSPEND } },
> +	{ KE_KEY, 21, { KEY_MACRO1 } },
> +	{ KE_KEY, 22, { KEY_MACRO2 } },
> +	{ KE_KEY, 24, { KEY_MACRO3 } },
> +	{ KE_KEY, 25, { KEY_MACRO4 } },
> +	{ KE_KEY, 34, { KEY_MACRO5 } },
> +	{ KE_KEY, 35, { KEY_MACRO6 } },
> +	{ KE_KEY, 36, { KEY_MACRO7 } },
> +	{ KE_KEY, 37, { KEY_MACRO8 } },
> +	{ KE_KEY, 41, { KEY_MACRO9 } },
> +	{ KE_KEY, 42, { KEY_MACRO10 } },
> +	{ KE_KEY, 43, { KEY_MACRO11 } },
>  	{ KE_END, 0 }
>  };
>  
> @@ -811,7 +822,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
>  		return;
>  	}
>  
> -	key = result & 0xf;
> +	key = result & 0x7f;

I'd mention this in the commit message. It's kind of different from adding 
just keys.

-- 
 i.





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux