diff mbox series

HID: multitouch: Apply MT_QUIRK_CONFIDENCE quirk for multi-input devices

Message ID 20210118134523.178605-1-kai.heng.feng@canonical.com (mailing list archive)
State Mainlined
Commit 794c613383433ffc4fceec8eaa081b9f1962e287
Delegated to: Jiri Kosina
Headers show
Series HID: multitouch: Apply MT_QUIRK_CONFIDENCE quirk for multi-input devices | expand

Commit Message

Kai-Heng Feng Jan. 18, 2021, 1:45 p.m. UTC
Palm ejection stops working on some Elan and Synaptics touchpad after
commit 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for
some devices").

The commit changes the mt_class from MT_CLS_WIN_8 to
MT_CLS_WIN_8_FORCE_MULTI_INPUT, so MT_QUIRK_CONFIDENCE isn't applied
anymore.

So also apply the quirk since MT_CLS_WIN_8_FORCE_MULTI_INPUT is
essentially MT_CLS_WIN_8.

Fixes: 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for some devices")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/hid/hid-multitouch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Benjamin Tissoires Jan. 18, 2021, 2:41 p.m. UTC | #1
Hi,

On Mon, Jan 18, 2021 at 2:45 PM Kai-Heng Feng
<kai.heng.feng@canonical.com> wrote:
>
> Palm ejection stops working on some Elan and Synaptics touchpad after
> commit 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for
> some devices").
>
> The commit changes the mt_class from MT_CLS_WIN_8 to
> MT_CLS_WIN_8_FORCE_MULTI_INPUT, so MT_QUIRK_CONFIDENCE isn't applied
> anymore.
>
> So also apply the quirk since MT_CLS_WIN_8_FORCE_MULTI_INPUT is
> essentially MT_CLS_WIN_8.
>
> Fixes: 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for some devices")
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Thanks for the patch.

IIt seems I was too lazy to write a regression test for it, and this
strikes back.
Can you also work on a regression test for this at
https://gitlab.freedesktop.org/libevdev/hid-tools ?

Cheers,
Benjamin




> ---
>  drivers/hid/hid-multitouch.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 0743ef51d3b2..8429ebe7097e 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -758,7 +758,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
>                         MT_STORE_FIELD(inrange_state);
>                         return 1;
>                 case HID_DG_CONFIDENCE:
> -                       if (cls->name == MT_CLS_WIN_8 &&
> +                       if ((cls->name == MT_CLS_WIN_8 ||
> +                            cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT) &&
>                                 (field->application == HID_DG_TOUCHPAD ||
>                                  field->application == HID_DG_TOUCHSCREEN))
>                                 app->quirks |= MT_QUIRK_CONFIDENCE;
> --
> 2.29.2
>
Kai-Heng Feng Jan. 18, 2021, 5:45 p.m. UTC | #2
Hi,

On Mon, Jan 18, 2021 at 10:41 PM Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
>
> Hi,
>
> On Mon, Jan 18, 2021 at 2:45 PM Kai-Heng Feng
> <kai.heng.feng@canonical.com> wrote:
> >
> > Palm ejection stops working on some Elan and Synaptics touchpad after
> > commit 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for
> > some devices").
> >
> > The commit changes the mt_class from MT_CLS_WIN_8 to
> > MT_CLS_WIN_8_FORCE_MULTI_INPUT, so MT_QUIRK_CONFIDENCE isn't applied
> > anymore.
> >
> > So also apply the quirk since MT_CLS_WIN_8_FORCE_MULTI_INPUT is
> > essentially MT_CLS_WIN_8.
> >
> > Fixes: 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for some devices")
> > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>
> Thanks for the patch.
>
> IIt seems I was too lazy to write a regression test for it, and this
> strikes back.
> Can you also work on a regression test for this at
> https://gitlab.freedesktop.org/libevdev/hid-tools ?

Of course. I'll do it later this week. Currently I have both affected
Elan and Synaptics touchpad in hand.
Will this be a blocker of getting the patch merged?

Kai-Heng

>
> Cheers,
> Benjamin
>
>
>
>
> > ---
> >  drivers/hid/hid-multitouch.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> > index 0743ef51d3b2..8429ebe7097e 100644
> > --- a/drivers/hid/hid-multitouch.c
> > +++ b/drivers/hid/hid-multitouch.c
> > @@ -758,7 +758,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
> >                         MT_STORE_FIELD(inrange_state);
> >                         return 1;
> >                 case HID_DG_CONFIDENCE:
> > -                       if (cls->name == MT_CLS_WIN_8 &&
> > +                       if ((cls->name == MT_CLS_WIN_8 ||
> > +                            cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT) &&
> >                                 (field->application == HID_DG_TOUCHPAD ||
> >                                  field->application == HID_DG_TOUCHSCREEN))
> >                                 app->quirks |= MT_QUIRK_CONFIDENCE;
> > --
> > 2.29.2
> >
>
Kai-Heng Feng Jan. 20, 2021, 10:03 a.m. UTC | #3
On Tue, Jan 19, 2021 at 1:45 AM Kai-Heng Feng
<kai.heng.feng@canonical.com> wrote:
>
> Hi,
>
> On Mon, Jan 18, 2021 at 10:41 PM Benjamin Tissoires
> <benjamin.tissoires@redhat.com> wrote:
> >
> > Hi,
> >
> > On Mon, Jan 18, 2021 at 2:45 PM Kai-Heng Feng
> > <kai.heng.feng@canonical.com> wrote:
> > >
> > > Palm ejection stops working on some Elan and Synaptics touchpad after
> > > commit 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for
> > > some devices").
> > >
> > > The commit changes the mt_class from MT_CLS_WIN_8 to
> > > MT_CLS_WIN_8_FORCE_MULTI_INPUT, so MT_QUIRK_CONFIDENCE isn't applied
> > > anymore.
> > >
> > > So also apply the quirk since MT_CLS_WIN_8_FORCE_MULTI_INPUT is
> > > essentially MT_CLS_WIN_8.
> > >
> > > Fixes: 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for some devices")
> > > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> >
> > Thanks for the patch.
> >
> > IIt seems I was too lazy to write a regression test for it, and this
> > strikes back.
> > Can you also work on a regression test for this at
> > https://gitlab.freedesktop.org/libevdev/hid-tools ?
>
> Of course. I'll do it later this week. Currently I have both affected
> Elan and Synaptics touchpad in hand.
> Will this be a blocker of getting the patch merged?

I made a pull request:
https://gitlab.freedesktop.org/libevdev/hid-tools/-/merge_requests/105

The tests don't pass for both Elan and Synaptics device, but let's fix it there.

Kai-Heng

>
> Kai-Heng
>
> >
> > Cheers,
> > Benjamin
> >
> >
> >
> >
> > > ---
> > >  drivers/hid/hid-multitouch.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> > > index 0743ef51d3b2..8429ebe7097e 100644
> > > --- a/drivers/hid/hid-multitouch.c
> > > +++ b/drivers/hid/hid-multitouch.c
> > > @@ -758,7 +758,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
> > >                         MT_STORE_FIELD(inrange_state);
> > >                         return 1;
> > >                 case HID_DG_CONFIDENCE:
> > > -                       if (cls->name == MT_CLS_WIN_8 &&
> > > +                       if ((cls->name == MT_CLS_WIN_8 ||
> > > +                            cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT) &&
> > >                                 (field->application == HID_DG_TOUCHPAD ||
> > >                                  field->application == HID_DG_TOUCHSCREEN))
> > >                                 app->quirks |= MT_QUIRK_CONFIDENCE;
> > > --
> > > 2.29.2
> > >
> >
Benjamin Tissoires Jan. 25, 2021, 9:05 a.m. UTC | #4
On Mon, Jan 18, 2021 at 2:45 PM Kai-Heng Feng
<kai.heng.feng@canonical.com> wrote:
>
> Palm ejection stops working on some Elan and Synaptics touchpad after
> commit 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for
> some devices").
>
> The commit changes the mt_class from MT_CLS_WIN_8 to
> MT_CLS_WIN_8_FORCE_MULTI_INPUT, so MT_QUIRK_CONFIDENCE isn't applied
> anymore.
>
> So also apply the quirk since MT_CLS_WIN_8_FORCE_MULTI_INPUT is
> essentially MT_CLS_WIN_8.
>
> Fixes: 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for some devices")
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---

Thanks for the patch, and for the hid-tools MR.

I have now added the "Cc: stable@vger.kernel.org" tag and pushed to
for-5.11/upstream-fixes.

Cheers,
Benjamin

>  drivers/hid/hid-multitouch.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 0743ef51d3b2..8429ebe7097e 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -758,7 +758,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
>                         MT_STORE_FIELD(inrange_state);
>                         return 1;
>                 case HID_DG_CONFIDENCE:
> -                       if (cls->name == MT_CLS_WIN_8 &&
> +                       if ((cls->name == MT_CLS_WIN_8 ||
> +                            cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT) &&
>                                 (field->application == HID_DG_TOUCHPAD ||
>                                  field->application == HID_DG_TOUCHSCREEN))
>                                 app->quirks |= MT_QUIRK_CONFIDENCE;
> --
> 2.29.2
>
diff mbox series

Patch

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 0743ef51d3b2..8429ebe7097e 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -758,7 +758,8 @@  static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 			MT_STORE_FIELD(inrange_state);
 			return 1;
 		case HID_DG_CONFIDENCE:
-			if (cls->name == MT_CLS_WIN_8 &&
+			if ((cls->name == MT_CLS_WIN_8 ||
+			     cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT) &&
 				(field->application == HID_DG_TOUCHPAD ||
 				 field->application == HID_DG_TOUCHSCREEN))
 				app->quirks |= MT_QUIRK_CONFIDENCE;