diff mbox series

Input: i8042 - add quirk for Lenovo ThinkPad T14 Gen 1

Message ID 20230925163313.1.I55bfb5880d6755094a995d3ae44c13810ae98be4@changeid
State New
Headers show
Series Input: i8042 - add quirk for Lenovo ThinkPad T14 Gen 1 | expand

Commit Message

Jonathan Denose Sept. 25, 2023, 9:33 p.m. UTC
The ThinkPad T14 Gen 1 touchpad works fine except that clicking
and dragging by tapping the touchpad or depressing the touchpad
do not work. Disabling PNP for controller setting discovery enables
click and drag without negatively impacting other touchpad features.

Signed-off-by: Jonathan Denose <jdenose@google.com>
---

 drivers/input/serio/i8042-acpipnpio.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Jonathan Denose Nov. 21, 2023, 8:23 p.m. UTC | #1
Hello Hans,

On Tue, Sep 26, 2023 at 5:37 AM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 9/25/23 23:33, Jonathan Denose wrote:
> > The ThinkPad T14 Gen 1 touchpad works fine except that clicking
> > and dragging by tapping the touchpad or depressing the touchpad
> > do not work. Disabling PNP for controller setting discovery enables
> > click and drag without negatively impacting other touchpad features.
> >
> > Signed-off-by: Jonathan Denose <jdenose@google.com>
>
> Thanks, patch looks good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>
> Regards,
>
> Hans

I just wanted to double check that I haven't missed anything, has this
patch been applied yet?

Best,
Jonathan
Hans de Goede Nov. 22, 2023, 3:17 p.m. UTC | #2
Hi Jonathan,

On 11/21/23 21:23, Jonathan Denose wrote:
> Hello Hans,
> 
> On Tue, Sep 26, 2023 at 5:37 AM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> Hi,
>>
>> On 9/25/23 23:33, Jonathan Denose wrote:
>>> The ThinkPad T14 Gen 1 touchpad works fine except that clicking
>>> and dragging by tapping the touchpad or depressing the touchpad
>>> do not work. Disabling PNP for controller setting discovery enables
>>> click and drag without negatively impacting other touchpad features.
>>>
>>> Signed-off-by: Jonathan Denose <jdenose@google.com>
>>
>> Thanks, patch looks good to me:
>>
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>
>> Regards,
>>
>> Hans
> 
> I just wanted to double check that I haven't missed anything, has this
> patch been applied yet?

Dmitry unfortunately does not have a lot of time for
reviewing / merging input subsystem patches. So AFAICT this
has not been processed / merged yet.

I've just send Dmitry a friendly worded email ping for another
patch, I've also brought this patch to his attention in
that email.

Regards,

Hans
Jonathan Denose Nov. 27, 2023, 4:38 p.m. UTC | #3
Hi Dmitry

On Fri, Nov 24, 2023 at 10:45 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Hi Jonathan,
>
> On Mon, Sep 25, 2023 at 04:33:20PM -0500, Jonathan Denose wrote:
> > The ThinkPad T14 Gen 1 touchpad works fine except that clicking
> > and dragging by tapping the touchpad or depressing the touchpad
> > do not work. Disabling PNP for controller setting discovery enables
> > click and drag without negatively impacting other touchpad features.
>
> I would like to understand more on how enabling PnP discovery for i8042
> affects the touchpad. Do you see it using different interrupt or IO
> ports? What protocol does the touchpad use with/without PnP? If the
> protocol is the same, do you see difference in the ranges (pressure,
> etc) reported by the device?
>
> Thanks.
>
> --
> Dmitry

Without PnP discovery the touchpad is using the SynPS/2 protocol, with
PnP discovery, the touchpad is using the rmi4 protocol. Since the
protocols are different, so are the ranges but let me know if you
still want to see them.

Can you tell me how to check the interrupt/IO ports? I'm not sure how
to do that.

Thanks,
Jonathan
Jonathan Denose Jan. 8, 2024, 4:36 p.m. UTC | #4
Hi all,

On Mon, Nov 27, 2023 at 10:38 AM Jonathan Denose <jdenose@chromium.org> wrote:
>
> Hi Dmitry
>
> On Fri, Nov 24, 2023 at 10:45 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > Hi Jonathan,
> >
> > On Mon, Sep 25, 2023 at 04:33:20PM -0500, Jonathan Denose wrote:
> > > The ThinkPad T14 Gen 1 touchpad works fine except that clicking
> > > and dragging by tapping the touchpad or depressing the touchpad
> > > do not work. Disabling PNP for controller setting discovery enables
> > > click and drag without negatively impacting other touchpad features.
> >
> > I would like to understand more on how enabling PnP discovery for i8042
> > affects the touchpad. Do you see it using different interrupt or IO
> > ports? What protocol does the touchpad use with/without PnP? If the
> > protocol is the same, do you see difference in the ranges (pressure,
> > etc) reported by the device?
> >
> > Thanks.
> >
> > --
> > Dmitry
>
> Without PnP discovery the touchpad is using the SynPS/2 protocol, with
> PnP discovery, the touchpad is using the rmi4 protocol. Since the
> protocols are different, so are the ranges but let me know if you
> still want to see them.
>
> Can you tell me how to check the interrupt/IO ports? I'm not sure how
> to do that.
>
> Thanks,
> Jonathan

Do you require any more information from me?

Thanks,
Jonathan
Dmitry Torokhov Jan. 9, 2024, 7:28 p.m. UTC | #5
Hi Jonathan,

On Mon, Nov 27, 2023 at 10:38:57AM -0600, Jonathan Denose wrote:
> Hi Dmitry
> 
> On Fri, Nov 24, 2023 at 10:45 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > Hi Jonathan,
> >
> > On Mon, Sep 25, 2023 at 04:33:20PM -0500, Jonathan Denose wrote:
> > > The ThinkPad T14 Gen 1 touchpad works fine except that clicking
> > > and dragging by tapping the touchpad or depressing the touchpad
> > > do not work. Disabling PNP for controller setting discovery enables
> > > click and drag without negatively impacting other touchpad features.
> >
> > I would like to understand more on how enabling PnP discovery for i8042
> > affects the touchpad. Do you see it using different interrupt or IO
> > ports? What protocol does the touchpad use with/without PnP? If the
> > protocol is the same, do you see difference in the ranges (pressure,
> > etc) reported by the device?
> >
> > Thanks.
> >
> > --
> > Dmitry
> 
> Without PnP discovery the touchpad is using the SynPS/2 protocol, with
> PnP discovery, the touchpad is using the rmi4 protocol. Since the
> protocols are different, so are the ranges but let me know if you
> still want to see them.

Thank you for this information. So it is not PnP discovery that appears
harmful in your case, but rather that legacy PS/2 mode appears to be
working better than RMI4 for the device in question.

I will note that the original enablement of RMI4 for T14 was done by
Hans in [1]. Later T14 with AMD were added to the list of devices that
should use RMI4 [2], however this was reverted in [3].

Could you please tell me what exact device you are dealing with? What's
it ACPI ID?

[1] https://lore.kernel.org/all/20201005114919.371592-1-hdegoede@redhat.com/
[2] https://lore.kernel.org/r/20220318113949.32722-1-snafu109@gmail.com
[3] https://lore.kernel.org/r/20220920193936.8709-1-markpearson@lenovo.com

Thanks.
Jonathan Denose Jan. 10, 2024, 11:42 p.m. UTC | #6
Dmitry,

Sorry I forgot to reply all, so I'm resending my other email.

On Tue, Jan 9, 2024 at 1:28 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Hi Jonathan,
>
> On Mon, Nov 27, 2023 at 10:38:57AM -0600, Jonathan Denose wrote:
> > Hi Dmitry
> >
> > On Fri, Nov 24, 2023 at 10:45 PM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > Hi Jonathan,
> > >
> > > On Mon, Sep 25, 2023 at 04:33:20PM -0500, Jonathan Denose wrote:
> > > > The ThinkPad T14 Gen 1 touchpad works fine except that clicking
> > > > and dragging by tapping the touchpad or depressing the touchpad
> > > > do not work. Disabling PNP for controller setting discovery enables
> > > > click and drag without negatively impacting other touchpad features.
> > >
> > > I would like to understand more on how enabling PnP discovery for i8042
> > > affects the touchpad. Do you see it using different interrupt or IO
> > > ports? What protocol does the touchpad use with/without PnP? If the
> > > protocol is the same, do you see difference in the ranges (pressure,
> > > etc) reported by the device?
> > >
> > > Thanks.
> > >
> > > --
> > > Dmitry
> >
> > Without PnP discovery the touchpad is using the SynPS/2 protocol, with
> > PnP discovery, the touchpad is using the rmi4 protocol. Since the
> > protocols are different, so are the ranges but let me know if you
> > still want to see them.
>
> Thank you for this information. So it is not PnP discovery that appears
> harmful in your case, but rather that legacy PS/2 mode appears to be
> working better than RMI4 for the device in question.
>
> I will note that the original enablement of RMI4 for T14 was done by
> Hans in [1]. Later T14 with AMD were added to the list of devices that
> should use RMI4 [2], however this was reverted in [3].
>
> Could you please tell me what exact device you are dealing with? What's
> it ACPI ID?
>
> [1] https://lore.kernel.org/all/20201005114919.371592-1-hdegoede@redhat.com/
> [2] https://lore.kernel.org/r/20220318113949.32722-1-snafu109@gmail.com
> [3] https://lore.kernel.org/r/20220920193936.8709-1-markpearson@lenovo.com
>
> Thanks.
>
> --
> Dmitry

Thanks for your reply!

I'm not 100% sure which of these is the ACPI ID, but from `udevadm
info -e` there's:
N: Name="Synaptics TM3471-020"
P: Phys=rmi4-00/input0
Hans de Goede Jan. 11, 2024, 10:48 a.m. UTC | #7
Hi Jonathan,

On 1/11/24 00:42, Jonathan Denose wrote:
> Dmitry,
> 
> Sorry I forgot to reply all, so I'm resending my other email.
> 
> On Tue, Jan 9, 2024 at 1:28 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>>
>> Hi Jonathan,
>>
>> On Mon, Nov 27, 2023 at 10:38:57AM -0600, Jonathan Denose wrote:
>>> Hi Dmitry
>>>
>>> On Fri, Nov 24, 2023 at 10:45 PM Dmitry Torokhov
>>> <dmitry.torokhov@gmail.com> wrote:
>>>>
>>>> Hi Jonathan,
>>>>
>>>> On Mon, Sep 25, 2023 at 04:33:20PM -0500, Jonathan Denose wrote:
>>>>> The ThinkPad T14 Gen 1 touchpad works fine except that clicking
>>>>> and dragging by tapping the touchpad or depressing the touchpad
>>>>> do not work. Disabling PNP for controller setting discovery enables
>>>>> click and drag without negatively impacting other touchpad features.
>>>>
>>>> I would like to understand more on how enabling PnP discovery for i8042
>>>> affects the touchpad. Do you see it using different interrupt or IO
>>>> ports? What protocol does the touchpad use with/without PnP? If the
>>>> protocol is the same, do you see difference in the ranges (pressure,
>>>> etc) reported by the device?
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> Dmitry
>>>
>>> Without PnP discovery the touchpad is using the SynPS/2 protocol, with
>>> PnP discovery, the touchpad is using the rmi4 protocol. Since the
>>> protocols are different, so are the ranges but let me know if you
>>> still want to see them.
>>
>> Thank you for this information. So it is not PnP discovery that appears
>> harmful in your case, but rather that legacy PS/2 mode appears to be
>> working better than RMI4 for the device in question.
>>
>> I will note that the original enablement of RMI4 for T14 was done by
>> Hans in [1]. Later T14 with AMD were added to the list of devices that
>> should use RMI4 [2], however this was reverted in [3].
>>
>> Could you please tell me what exact device you are dealing with? What's
>> it ACPI ID?
>>
>> [1] https://lore.kernel.org/all/20201005114919.371592-1-hdegoede@redhat.com/
>> [2] https://lore.kernel.org/r/20220318113949.32722-1-snafu109@gmail.com
>> [3] https://lore.kernel.org/r/20220920193936.8709-1-markpearson@lenovo.com
>>
>> Thanks.
>>
>> --
>> Dmitry
> 
> Thanks for your reply!
> 
> I'm not 100% sure which of these is the ACPI ID, but from `udevadm
> info -e` there's:
> N: Name="Synaptics TM3471-020"
> P: Phys=rmi4-00/input0

To get the ACPI ID you need to run e.g. :``

cat /sys/bus/serio/devices/serio1/firmware_id

After reading the original bug report again I take back my
Reviewed-by and I'm tending towards a nack for this.

Jonathan upon re-reading things I think that your problem
is more a case of user space mis-configuration then
a kernel problem.

You mention both tap-n-drag not working as well as click+drag
not working.

tap-n-drag is purely done in userspace and typically only
works if tap-to-click is enabled in the touchpad configuration
of your desktop environment.

Click + drag requires you to use the bottom of the touchpad
(the only part which actually clicks) as if there still were
2 physical buttons there and then click the touchpad down
with 1 finger till it clicks and then drags with another
finger (you can click+drag with one finger but the force
required to keep the touchpad clicked down while dragging
makes this uncomfortable to do).

This will likely also only work if the mouse click emulation
mode is set to "area" and not "fingers" with "fingers" being
the default now. In GNOME you can configure
the "click emulation mode" in the "tweaks" tools under
"mouse & touchpad" (and tap to click is in the normal
settings menu / control panel).

If you have the click emulations set to fingers and
then do the click with 1 finger + drag with another
finger thing, I think the drag will turn into a
right button drag instead of a left button drag which
is likely why this is not working.

You can check which mode you are in by seeing how
you right click. If you right-click by pressing down
in the right bottom corner of the touchpad then
your userspace (libinput) config is set to areas,
if you can right click anywhere by pressing down
with 2 fingers at once then your click emulation
is in fingers mode and this is likely why click-n-drag
is not working.

I have just dug up my T14 gen1 (Intel) and updated it
to kernel 6.6.11 to rule out kernel regressions.

And both click-n-drag and tap-n-drag (double-tap then
drag) both work fine there with a touchpad with
an ACPI id of LEN2068 as shown by
cat /sys/bus/serio/devices/serio1/firmware_id

(with the Desktop Environment configured for bottom
area click emulation and tap-to-click enabled)

As for why changing things back to synps2 works,
I don't know. One guess is that you already configured
the touchpad behavior of your desktop environment to
your liking in the past and your desktop environment
has remembered this only for the input device-name
which is used in SynPS/2 mode and the different
input device-name in RMI4 mode in new (new-ish)
kernels causes the desktop environment to use
default settings which are typically "fingers"
click emulation and tap-to-click disabled.

This can e.g. also happen if you have moved your
disk (contents) over from an older machine. IIRC
the SynPS/2 driver always used the same input
device-name where as with RMI4 the name is tied
to the actual laptop model.

Regards,

Hans
Jonathan Denose Jan. 12, 2024, 3:10 p.m. UTC | #8
Hans,

On Thu, Jan 11, 2024 at 4:48 AM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi Jonathan,
>
> On 1/11/24 00:42, Jonathan Denose wrote:
> > Dmitry,
> >
> > Sorry I forgot to reply all, so I'm resending my other email.
> >
> > On Tue, Jan 9, 2024 at 1:28 PM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> >>
> >> Hi Jonathan,
> >>
> >> On Mon, Nov 27, 2023 at 10:38:57AM -0600, Jonathan Denose wrote:
> >>> Hi Dmitry
> >>>
> >>> On Fri, Nov 24, 2023 at 10:45 PM Dmitry Torokhov
> >>> <dmitry.torokhov@gmail.com> wrote:
> >>>>
> >>>> Hi Jonathan,
> >>>>
> >>>> On Mon, Sep 25, 2023 at 04:33:20PM -0500, Jonathan Denose wrote:
> >>>>> The ThinkPad T14 Gen 1 touchpad works fine except that clicking
> >>>>> and dragging by tapping the touchpad or depressing the touchpad
> >>>>> do not work. Disabling PNP for controller setting discovery enables
> >>>>> click and drag without negatively impacting other touchpad features.
> >>>>
> >>>> I would like to understand more on how enabling PnP discovery for i8042
> >>>> affects the touchpad. Do you see it using different interrupt or IO
> >>>> ports? What protocol does the touchpad use with/without PnP? If the
> >>>> protocol is the same, do you see difference in the ranges (pressure,
> >>>> etc) reported by the device?
> >>>>
> >>>> Thanks.
> >>>>
> >>>> --
> >>>> Dmitry
> >>>
> >>> Without PnP discovery the touchpad is using the SynPS/2 protocol, with
> >>> PnP discovery, the touchpad is using the rmi4 protocol. Since the
> >>> protocols are different, so are the ranges but let me know if you
> >>> still want to see them.
> >>
> >> Thank you for this information. So it is not PnP discovery that appears
> >> harmful in your case, but rather that legacy PS/2 mode appears to be
> >> working better than RMI4 for the device in question.
> >>
> >> I will note that the original enablement of RMI4 for T14 was done by
> >> Hans in [1]. Later T14 with AMD were added to the list of devices that
> >> should use RMI4 [2], however this was reverted in [3].
> >>
> >> Could you please tell me what exact device you are dealing with? What's
> >> it ACPI ID?
> >>
> >> [1] https://lore.kernel.org/all/20201005114919.371592-1-hdegoede@redhat.com/
> >> [2] https://lore.kernel.org/r/20220318113949.32722-1-snafu109@gmail.com
> >> [3] https://lore.kernel.org/r/20220920193936.8709-1-markpearson@lenovo.com
> >>
> >> Thanks.
> >>
> >> --
> >> Dmitry
> >
> > Thanks for your reply!
> >
> > I'm not 100% sure which of these is the ACPI ID, but from `udevadm
> > info -e` there's:
> > N: Name="Synaptics TM3471-020"
> > P: Phys=rmi4-00/input0
>
> To get the ACPI ID you need to run e.g. :``
>
> cat /sys/bus/serio/devices/serio1/firmware_id
>
> After reading the original bug report again I take back my
> Reviewed-by and I'm tending towards a nack for this.
>
> Jonathan upon re-reading things I think that your problem
> is more a case of user space mis-configuration then
> a kernel problem.
>
> You mention both tap-n-drag not working as well as click+drag
> not working.
>
> tap-n-drag is purely done in userspace and typically only
> works if tap-to-click is enabled in the touchpad configuration
> of your desktop environment.
>
> Click + drag requires you to use the bottom of the touchpad
> (the only part which actually clicks) as if there still were
> 2 physical buttons there and then click the touchpad down
> with 1 finger till it clicks and then drags with another
> finger (you can click+drag with one finger but the force
> required to keep the touchpad clicked down while dragging
> makes this uncomfortable to do).
>
> This will likely also only work if the mouse click emulation
> mode is set to "area" and not "fingers" with "fingers" being
> the default now. In GNOME you can configure
> the "click emulation mode" in the "tweaks" tools under
> "mouse & touchpad" (and tap to click is in the normal
> settings menu / control panel).
>
> If you have the click emulations set to fingers and
> then do the click with 1 finger + drag with another
> finger thing, I think the drag will turn into a
> right button drag instead of a left button drag which
> is likely why this is not working.
>
> You can check which mode you are in by seeing how
> you right click. If you right-click by pressing down
> in the right bottom corner of the touchpad then
> your userspace (libinput) config is set to areas,
> if you can right click anywhere by pressing down
> with 2 fingers at once then your click emulation
> is in fingers mode and this is likely why click-n-drag
> is not working.
>
> I have just dug up my T14 gen1 (Intel) and updated it
> to kernel 6.6.11 to rule out kernel regressions.
>
> And both click-n-drag and tap-n-drag (double-tap then
> drag) both work fine there with a touchpad with
> an ACPI id of LEN2068 as shown by
> cat /sys/bus/serio/devices/serio1/firmware_id
>
> (with the Desktop Environment configured for bottom
> area click emulation and tap-to-click enabled)
>
> As for why changing things back to synps2 works,
> I don't know. One guess is that you already configured
> the touchpad behavior of your desktop environment to
> your liking in the past and your desktop environment
> has remembered this only for the input device-name
> which is used in SynPS/2 mode and the different
> input device-name in RMI4 mode in new (new-ish)
> kernels causes the desktop environment to use
> default settings which are typically "fingers"
> click emulation and tap-to-click disabled.
>
> This can e.g. also happen if you have moved your
> disk (contents) over from an older machine. IIRC
> the SynPS/2 driver always used the same input
> device-name where as with RMI4 the name is tied
> to the actual laptop model.
>
> Regards,
>
> Hans
>
>

Thank you for your thorough reply. Based on what you've written, I
agree this sounds more like a user-space issue than a kernel issue. At
least that narrows it down for me, so I'll take a look at what could
be misconfigured in user-space.

Thanks so much for your help!
Jonathan
diff mbox series

Patch

diff --git a/drivers/input/serio/i8042-acpipnpio.h b/drivers/input/serio/i8042-acpipnpio.h
index 1724d6cb8649d..c487047d878cd 100644
--- a/drivers/input/serio/i8042-acpipnpio.h
+++ b/drivers/input/serio/i8042-acpipnpio.h
@@ -830,6 +830,14 @@  static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
 		},
 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
 	},
+	{
+		/* Lenovo ThinkPad T14 Gen 1*/
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "20S0002UUS")
+		},
+		.driver_data = (void *)(SERIO_QUIRK_NOPNP)
+	},
 	{
 		/* Lenovo ThinkPad Twist S230u */
 		.matches = {