The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401
@ 2024-12-27 23:18 Vishnu Sankar
  2024-12-28  3:11 ` Mark Pearson
  2024-12-29 15:44 ` Ilpo Järvinen
  0 siblings, 2 replies; 4+ messages in thread
From: Vishnu Sankar @ 2024-12-27 23:18 UTC (permalink / raw)
  To: corbet, hmh, hdegoede, ilpo.jarvinen, linux-doc, linux-kernel,
	ibm-acpi-devel, platform-driver-x86
  Cc: mpearson-lenovo, Vishnu Sankar

F8 mode key on Lenovo 2025 platforms use a different key code.
Adding support for the new keycode 0x1401.

Tested on X1 Carbon Gen 13 and X1 2-in-1 Gen 10.

Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
---
 Documentation/admin-guide/laptops/thinkpad-acpi.rst | 10 +++++++---
 drivers/platform/x86/thinkpad_acpi.c                |  4 +++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/laptops/thinkpad-acpi.rst b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
index 7f674a6cfa8a..4ab0fef7d440 100644
--- a/Documentation/admin-guide/laptops/thinkpad-acpi.rst
+++ b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
@@ -445,8 +445,10 @@ event	code	Key		Notes
 0x1008	0x07	FN+F8		IBM: toggle screen expand
 				Lenovo: configure UltraNav,
 				or toggle screen expand.
-				On newer platforms (2024+)
-				replaced by 0x131f (see below)
+				On 2024 platforms replaced by
+				0x131f (see below) and on newer
+				platforms (2025 +) keycode is
+				replaced by 0x1401 (see below).
 
 0x1009	0x08	FN+F9		-
 
@@ -506,9 +508,11 @@ event	code	Key		Notes
 
 0x1019	0x18	unknown
 
-0x131f	...	FN+F8	        Platform Mode change.
+0x131f	...	FN+F8		Platform Mode change (2024 systems).
 				Implemented in driver.
 
+0x1401	...	FN+F8		Platform Mode change (2025 + systems).
+				Implemented in driver.
 ...	...	...
 
 0x1020	0x1F	unknown
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 6371a9f765c1..2cfb2ac3f465 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -184,7 +184,8 @@ enum tpacpi_hkey_event_t {
 						   */
 	TP_HKEY_EV_AMT_TOGGLE		= 0x131a, /* Toggle AMT on/off */
 	TP_HKEY_EV_DOUBLETAP_TOGGLE	= 0x131c, /* Toggle trackpoint doubletap on/off */
-	TP_HKEY_EV_PROFILE_TOGGLE	= 0x131f, /* Toggle platform profile */
+	TP_HKEY_EV_PROFILE_TOGGLE	= 0x131f, /* Toggle platform profile in 2024 systems */
+	TP_HKEY_EV_PROFILE_TOGGLE2	= 0x1401, /* Toggle platform profile in 2025 + systems */
 
 	/* Reasons for waking up from S3/S4 */
 	TP_HKEY_EV_WKUP_S3_UNDOCK	= 0x2304, /* undock requested, S3 */
@@ -11200,6 +11201,7 @@ static bool tpacpi_driver_event(const unsigned int hkey_event)
 		tp_features.trackpoint_doubletap = !tp_features.trackpoint_doubletap;
 		return true;
 	case TP_HKEY_EV_PROFILE_TOGGLE:
+	case TP_HKEY_EV_PROFILE_TOGGLE2:
 		platform_profile_cycle();
 		return true;
 	}
-- 
2.45.2


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

* Re: [PATCH] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401
  2024-12-27 23:18 [PATCH] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401 Vishnu Sankar
@ 2024-12-28  3:11 ` Mark Pearson
  2024-12-29 15:44 ` Ilpo Järvinen
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Pearson @ 2024-12-28  3:11 UTC (permalink / raw)
  To: Vishnu Sankar, Jonathan Corbet, Henrique de Moraes Holschuh,
	Hans de Goede, Ilpo Järvinen, linux-doc, linux-kernel,
	ibm-acpi-devel, platform-driver-x86@vger.kernel.org

Thanks Vishnu,

On Fri, Dec 27, 2024, at 6:18 PM, Vishnu Sankar wrote:
> F8 mode key on Lenovo 2025 platforms use a different key code.
> Adding support for the new keycode 0x1401.
>
> Tested on X1 Carbon Gen 13 and X1 2-in-1 Gen 10.
>
> Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
> ---
>  Documentation/admin-guide/laptops/thinkpad-acpi.rst | 10 +++++++---
>  drivers/platform/x86/thinkpad_acpi.c                |  4 +++-
>  2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/admin-guide/laptops/thinkpad-acpi.rst 
> b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
> index 7f674a6cfa8a..4ab0fef7d440 100644
> --- a/Documentation/admin-guide/laptops/thinkpad-acpi.rst
> +++ b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
> @@ -445,8 +445,10 @@ event	code	Key		Notes
>  0x1008	0x07	FN+F8		IBM: toggle screen expand
>  				Lenovo: configure UltraNav,
>  				or toggle screen expand.
> -				On newer platforms (2024+)
> -				replaced by 0x131f (see below)
> +				On 2024 platforms replaced by
> +				0x131f (see below) and on newer
> +				platforms (2025 +) keycode is
> +				replaced by 0x1401 (see below).
> 
>  0x1009	0x08	FN+F9		-
> 
> @@ -506,9 +508,11 @@ event	code	Key		Notes
> 
>  0x1019	0x18	unknown
> 
> -0x131f	...	FN+F8	        Platform Mode change.
> +0x131f	...	FN+F8		Platform Mode change (2024 systems).
>  				Implemented in driver.
> 
> +0x1401	...	FN+F8		Platform Mode change (2025 + systems).
> +				Implemented in driver.
>  ...	...	...
> 
>  0x1020	0x1F	unknown
> diff --git a/drivers/platform/x86/thinkpad_acpi.c 
> b/drivers/platform/x86/thinkpad_acpi.c
> index 6371a9f765c1..2cfb2ac3f465 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -184,7 +184,8 @@ enum tpacpi_hkey_event_t {
>  						   */
>  	TP_HKEY_EV_AMT_TOGGLE		= 0x131a, /* Toggle AMT on/off */
>  	TP_HKEY_EV_DOUBLETAP_TOGGLE	= 0x131c, /* Toggle trackpoint doubletap 
> on/off */
> -	TP_HKEY_EV_PROFILE_TOGGLE	= 0x131f, /* Toggle platform profile */
> +	TP_HKEY_EV_PROFILE_TOGGLE	= 0x131f, /* Toggle platform profile in 
> 2024 systems */
> +	TP_HKEY_EV_PROFILE_TOGGLE2	= 0x1401, /* Toggle platform profile in 
> 2025 + systems */
> 
>  	/* Reasons for waking up from S3/S4 */
>  	TP_HKEY_EV_WKUP_S3_UNDOCK	= 0x2304, /* undock requested, S3 */
> @@ -11200,6 +11201,7 @@ static bool tpacpi_driver_event(const unsigned 
> int hkey_event)
>  		tp_features.trackpoint_doubletap = !tp_features.trackpoint_doubletap;
>  		return true;
>  	case TP_HKEY_EV_PROFILE_TOGGLE:
> +	case TP_HKEY_EV_PROFILE_TOGGLE2:
>  		platform_profile_cycle();
>  		return true;
>  	}
> -- 
> 2.45.2

Looks good to me.
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>

Mark

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

* Re: [PATCH] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401
  2024-12-27 23:18 [PATCH] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401 Vishnu Sankar
  2024-12-28  3:11 ` Mark Pearson
@ 2024-12-29 15:44 ` Ilpo Järvinen
  2025-01-06  2:40   ` Vishnu Sankar
  1 sibling, 1 reply; 4+ messages in thread
From: Ilpo Järvinen @ 2024-12-29 15:44 UTC (permalink / raw)
  To: corbet, hmh, hdegoede, linux-doc, linux-kernel, ibm-acpi-devel,
	platform-driver-x86, Vishnu Sankar
  Cc: mpearson-lenovo

On Sat, 28 Dec 2024 08:18:40 +0900, Vishnu Sankar wrote:

> F8 mode key on Lenovo 2025 platforms use a different key code.
> Adding support for the new keycode 0x1401.
> 
> Tested on X1 Carbon Gen 13 and X1 2-in-1 Gen 10.
> 
> 


Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401
      commit: 7e16ae558a87ac9099b6a93a43f19b42d809fd78

--
 i.


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

* Re: [PATCH] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401
  2024-12-29 15:44 ` Ilpo Järvinen
@ 2025-01-06  2:40   ` Vishnu Sankar
  0 siblings, 0 replies; 4+ messages in thread
From: Vishnu Sankar @ 2025-01-06  2:40 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: corbet, hmh, hdegoede, linux-doc, linux-kernel, ibm-acpi-devel,
	platform-driver-x86, mpearson-lenovo

Thank you so much for accepting my patch.

On Mon, Dec 30, 2024 at 12:44 AM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
>
> On Sat, 28 Dec 2024 08:18:40 +0900, Vishnu Sankar wrote:
>
> > F8 mode key on Lenovo 2025 platforms use a different key code.
> > Adding support for the new keycode 0x1401.
> >
> > Tested on X1 Carbon Gen 13 and X1 2-in-1 Gen 10.
> >
> >
>
>
> Thank you for your contribution, it has been applied to my local
> review-ilpo-fixes branch. Note it will show up in the public
> platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
> local branch there, which might take a while.
>
> The list of commits applied:
> [1/1] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401
>       commit: 7e16ae558a87ac9099b6a93a43f19b42d809fd78
>
> --
>  i.
>


-- 

Regards,

      Vishnu Sankar
     +817015150407 (Japan)

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

end of thread, other threads:[~2025-01-06  2:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-27 23:18 [PATCH] platform/x86: thinkpad-acpi: Add support for hotkey 0x1401 Vishnu Sankar
2024-12-28  3:11 ` Mark Pearson
2024-12-29 15:44 ` Ilpo Järvinen
2025-01-06  2:40   ` Vishnu Sankar

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