mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Pit Henrich <pithenrich2d@googlemail.com>,
	hmh@hmh.eng.br, Dave Carey <carvsdriver@gmail.com>,
	Armin Wolf <W_Armin@gmx.de>
Cc: mpearson-lenovo@squebb.ca, derekjohn.clark@gmail.com,
	ilpo.jarvinen@linux.intel.com,
	ibm-acpi-devel@lists.sourceforge.net,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, pithenrich2d@gmail.com
Subject: Re: [PATCH v2] platform/x86: thinkpad-acpi: Add X1 Fold keyboard attachment detection
Date: Mon, 8 Jun 2026 18:00:40 +0200	[thread overview]
Message-ID: <1b5791c4-04f8-458b-ad9d-6bbb3ae1bf8f@kernel.org> (raw)
In-Reply-To: <84f822c5-ff42-453a-bbd6-3b2afba28621@kernel.org>

Hi,

On 8-Jun-26 11:09, Hans de Goede wrote:
> Hi,
> 
> On 19-Apr-26 12:27 PM, Pit Henrich wrote:
>> ThinkPad X1 Fold 16 Gen 1 firmware reports whether the keyboard is magnetically
>> attached (on the screen), but thinkpad-acpi does not expose this to userspace.
>> The state can be obtained via ACPI methods: GDST (get device state).
>>
>> Add a read-only keyboard_attached_on_screen sysfs attribute, gated by
>> a DMI match. The state is read directly from the EC.
>>
>> Cache the state and emit a sysfs notification on
>> TP_HKEY_EV_TABLET_CHANGED (0x60c0) when it changes. Initialize the cache during
>> hotkey setup and refresh it before the resume notification to keep the state
>> consistent across suspend and resume.
>>
>> Signed-off-by: Pit Henrich <pithenrich2d@gmail.com>
>> ---
>> This replaced the v1 patch in:
>> https://lore.kernel.org/all/20260314142236.74514-1-pithenrich2d@gmail.com/
>>
>> Changes v1 -> v2:
>>  * Use ACPI method instead of using the EC directly (thanks Mark).
> 
> Thank you for your patch. It seems that this information is also exposed
> via WMI and a WMI driver exposing the same information is also being
> worked on:
> 
> https://patchwork.kernel.org/project/platform-driver-x86/patch/20260527122701.242907-1-carvsdriver@gmail.com/
> 
> +Cc Dave Carey (author of that driver) and Armin (WMI maintainer)

Ok, I should have looked closer, this patch is for a "ThinkPad X1 Fold 16
Gen 1" and the driver I linked above is for a "Yoga Book 9" so I was mistaken
that these drivers are duplicate, we will need both. Sorry, my bad.

Note not a full review, but before we can move forward with this driver,
you are going to need to document the new sysfs attribute under:

Documentation/admin-guide/laptops/thinkpad-acpi.rst

Please add a new "X1 Fold keyboard attachmen" section directly after
the  "Hardware damage detection capability" section (or iow just above
the "Multiple Commands, Module Parameters" section).

Regards,

Hans




  reply	other threads:[~2026-06-08 16:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-19 10:27 Pit Henrich
2026-06-08  9:09 ` Hans de Goede
2026-06-08 16:00   ` Hans de Goede [this message]
2026-06-09  1:19 ` Mark Pearson
2026-06-09  8:49   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b5791c4-04f8-458b-ad9d-6bbb3ae1bf8f@kernel.org \
    --to=hansg@kernel.org \
    --cc=W_Armin@gmx.de \
    --cc=carvsdriver@gmail.com \
    --cc=derekjohn.clark@gmail.com \
    --cc=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=pithenrich2d@gmail.com \
    --cc=pithenrich2d@googlemail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome