* [PATCH] Input: elan: enable middle button of touchpads on ThinkPad P52
@ 2018-06-12 7:09 Aaron Ma
2018-06-19 12:21 ` Benjamin Tissoires
0 siblings, 1 reply; 4+ messages in thread
From: Aaron Ma @ 2018-06-12 7:09 UTC (permalink / raw)
To: linux-input, linux-kernel, aaron.ma, kt.liao, dmitry.torokhov
PNPID is better way to identify the type of touchpads.
Enable middle button support on 2 types of touchpads on Lenovo P52.
Cc: stable@vger.kernel.org
Cc: KT Liao <kt.liao@emc.com.tw>
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
drivers/input/mouse/elantech.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index fb4d902c4403..67b061dd4494 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
{ }
};
+static const char * const middle_button_pnp_ids[] = {
+ "LEN2131", /* ThinkPad P52 w/ NFC */
+ "LEN2132", /* ThinkPad P52 */
+ NULL
+};
+
/*
* Set the appropriate event bits for the input subsystem
*/
@@ -1194,7 +1200,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
__clear_bit(EV_REL, dev->evbit);
__set_bit(BTN_LEFT, dev->keybit);
- if (dmi_check_system(elantech_dmi_has_middle_button))
+ if (dmi_check_system(elantech_dmi_has_middle_button) ||
+ psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids))
__set_bit(BTN_MIDDLE, dev->keybit);
__set_bit(BTN_RIGHT, dev->keybit);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: elan: enable middle button of touchpads on ThinkPad P52
2018-06-12 7:09 [PATCH] Input: elan: enable middle button of touchpads on ThinkPad P52 Aaron Ma
@ 2018-06-19 12:21 ` Benjamin Tissoires
2018-06-19 13:13 ` Aaron Ma
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Tissoires @ 2018-06-19 12:21 UTC (permalink / raw)
To: aaron.ma; +Cc: linux-input, linux-kernel, KT Liao, Dmitry Torokhov
On Tue, Jun 12, 2018 at 9:10 AM Aaron Ma <aaron.ma@canonical.com> wrote:
>
> PNPID is better way to identify the type of touchpads.
> Enable middle button support on 2 types of touchpads on Lenovo P52.
>
> Cc: stable@vger.kernel.org
> Cc: KT Liao <kt.liao@emc.com.tw>
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> ---
> drivers/input/mouse/elantech.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
Looks good to me:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Aaron, our internal tests show that the P52 shows a lot of lost
synchronization in pre-v4.18 kernels. Do you have a fix for that too?
In v4.18 we need to fix the elan_i2c module as right now the touchpad
is muted when booted with such a kernel.
Cheers,
Benjamin
>
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index fb4d902c4403..67b061dd4494 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
> { }
> };
>
> +static const char * const middle_button_pnp_ids[] = {
> + "LEN2131", /* ThinkPad P52 w/ NFC */
> + "LEN2132", /* ThinkPad P52 */
> + NULL
> +};
> +
> /*
> * Set the appropriate event bits for the input subsystem
> */
> @@ -1194,7 +1200,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
> __clear_bit(EV_REL, dev->evbit);
>
> __set_bit(BTN_LEFT, dev->keybit);
> - if (dmi_check_system(elantech_dmi_has_middle_button))
> + if (dmi_check_system(elantech_dmi_has_middle_button) ||
> + psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids))
> __set_bit(BTN_MIDDLE, dev->keybit);
> __set_bit(BTN_RIGHT, dev->keybit);
>
> --
> 2.17.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: elan: enable middle button of touchpads on ThinkPad P52
2018-06-19 12:21 ` Benjamin Tissoires
@ 2018-06-19 13:13 ` Aaron Ma
2018-06-19 13:46 ` Benjamin Tissoires
0 siblings, 1 reply; 4+ messages in thread
From: Aaron Ma @ 2018-06-19 13:13 UTC (permalink / raw)
To: Benjamin Tissoires; +Cc: linux-input, linux-kernel, KT Liao, Dmitry Torokhov
On 06/19/2018 08:21 PM, Benjamin Tissoires wrote:
> On Tue, Jun 12, 2018 at 9:10 AM Aaron Ma <aaron.ma@canonical.com> wrote:
>> PNPID is better way to identify the type of touchpads.
>> Enable middle button support on 2 types of touchpads on Lenovo P52.
>>
>> Cc: stable@vger.kernel.org
>> Cc: KT Liao <kt.liao@emc.com.tw>
>> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
>> ---
>> drivers/input/mouse/elantech.c | 9 ++++++++-
>> 1 file changed, 8 insertions(+), 1 deletion(-)
> Looks good to me:
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>
> Aaron, our internal tests show that the P52 shows a lot of lost
> synchronization in pre-v4.18 kernels. Do you have a fix for that too?
>
https://lkml.org/lkml/2018/5/28/694
should fix the sync issue.
> In v4.18 we need to fix the elan_i2c module as right now the touchpad
> is muted when booted with such a kernel.
Does this touchpad support elan_i2c?
Regards,
Aaron
>
> Cheers,
> Benjamin
>
>> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
>> index fb4d902c4403..67b061dd4494 100644
>> --- a/drivers/input/mouse/elantech.c
>> +++ b/drivers/input/mouse/elantech.c
>> @@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
>> { }
>> };
>>
>> +static const char * const middle_button_pnp_ids[] = {
>> + "LEN2131", /* ThinkPad P52 w/ NFC */
>> + "LEN2132", /* ThinkPad P52 */
>> + NULL
>> +};
>> +
>> /*
>> * Set the appropriate event bits for the input subsystem
>> */
>> @@ -1194,7 +1200,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
>> __clear_bit(EV_REL, dev->evbit);
>>
>> __set_bit(BTN_LEFT, dev->keybit);
>> - if (dmi_check_system(elantech_dmi_has_middle_button))
>> + if (dmi_check_system(elantech_dmi_has_middle_button) ||
>> + psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids))
>> __set_bit(BTN_MIDDLE, dev->keybit);
>> __set_bit(BTN_RIGHT, dev->keybit);
>>
>> --
>> 2.17.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-input" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: elan: enable middle button of touchpads on ThinkPad P52
2018-06-19 13:13 ` Aaron Ma
@ 2018-06-19 13:46 ` Benjamin Tissoires
0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Tissoires @ 2018-06-19 13:46 UTC (permalink / raw)
To: aaron.ma; +Cc: linux-input, linux-kernel, KT Liao, Dmitry Torokhov
On Tue, Jun 19, 2018 at 3:13 PM Aaron Ma <aaron.ma@canonical.com> wrote:
>
> On 06/19/2018 08:21 PM, Benjamin Tissoires wrote:
> > On Tue, Jun 12, 2018 at 9:10 AM Aaron Ma <aaron.ma@canonical.com> wrote:
> >> PNPID is better way to identify the type of touchpads.
> >> Enable middle button support on 2 types of touchpads on Lenovo P52.
> >>
> >> Cc: stable@vger.kernel.org
> >> Cc: KT Liao <kt.liao@emc.com.tw>
> >> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> >> ---
> >> drivers/input/mouse/elantech.c | 9 ++++++++-
> >> 1 file changed, 8 insertions(+), 1 deletion(-)
> > Looks good to me:
> > Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> >
> > Aaron, our internal tests show that the P52 shows a lot of lost
> > synchronization in pre-v4.18 kernels. Do you have a fix for that too?
> >
>
> https://lkml.org/lkml/2018/5/28/694
> should fix the sync issue.
Thanks for the pointer :)
I have missed that one.
>
>
> > In v4.18 we need to fix the elan_i2c module as right now the touchpad
> > is muted when booted with such a kernel.
>
> Does this touchpad support elan_i2c?
Yes it does. And starting from v4.18 the touchpad will switch to
elan_i2c by default. However, I'll have to provide some fixes as some
elan_i2c commands are not working :(
Cheers,
Benjamin
>
> Regards,
> Aaron
>
> >
> > Cheers,
> > Benjamin
> >
> >> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> >> index fb4d902c4403..67b061dd4494 100644
> >> --- a/drivers/input/mouse/elantech.c
> >> +++ b/drivers/input/mouse/elantech.c
> >> @@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
> >> { }
> >> };
> >>
> >> +static const char * const middle_button_pnp_ids[] = {
> >> + "LEN2131", /* ThinkPad P52 w/ NFC */
> >> + "LEN2132", /* ThinkPad P52 */
> >> + NULL
> >> +};
> >> +
> >> /*
> >> * Set the appropriate event bits for the input subsystem
> >> */
> >> @@ -1194,7 +1200,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
> >> __clear_bit(EV_REL, dev->evbit);
> >>
> >> __set_bit(BTN_LEFT, dev->keybit);
> >> - if (dmi_check_system(elantech_dmi_has_middle_button))
> >> + if (dmi_check_system(elantech_dmi_has_middle_button) ||
> >> + psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids))
> >> __set_bit(BTN_MIDDLE, dev->keybit);
> >> __set_bit(BTN_RIGHT, dev->keybit);
> >>
> >> --
> >> 2.17.1
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> >> the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-06-19 13:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 7:09 [PATCH] Input: elan: enable middle button of touchpads on ThinkPad P52 Aaron Ma
2018-06-19 12:21 ` Benjamin Tissoires
2018-06-19 13:13 ` Aaron Ma
2018-06-19 13:46 ` Benjamin Tissoires
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).