Re: [PATCH] ideapad: DMI quirk for touchpad control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8 June 2016 at 18:15, Darren Hart <dvhart@xxxxxxxxxxxxx> wrote:
> On Mon, Jun 06, 2016 at 12:25:24PM -0400, João Paulo Rechi Vita wrote:
>> Don't try to control the touchpad on laptops that do not support it, as
>> it leads to sending wrong KEY_TOUCHPAD_ON / KEY_TOUCHPAD_OFF events to
>> userspace.
>>
>> Signed-off-by: João Paulo Rechi Vita <jprvita@xxxxxxxxxxxx>
>> ---
>>  drivers/platform/x86/ideapad-laptop.c | 26 ++++++++++++++++++++++++++
>>  1 file changed, 26 insertions(+)
>>
>> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
>> index 06a837a..6270948 100644
>> --- a/drivers/platform/x86/ideapad-laptop.c
>> +++ b/drivers/platform/x86/ideapad-laptop.c
>> @@ -93,6 +93,7 @@ struct ideapad_private {
>>       struct dentry *debug;
>>       unsigned long cfg;
>>       bool has_hw_rfkill_switch;
>> +     bool has_tp_ctrl;
>>  };
>>
>>  static bool no_bt_rfkill;
>> @@ -773,6 +774,9 @@ static void ideapad_sync_touchpad_state(struct ideapad_private *priv)
>>  {
>>       unsigned long value;
>>
>> +     if (!priv->has_tp_ctrl)
>> +             return;
>> +
>>       /* Without reading from EC touchpad LED doesn't switch state */
>>       if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) {
>>               /* Some IdeaPads don't really turn off touchpad - they only
>> @@ -930,6 +934,27 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
>>       {}
>>  };
>>
>> +/*
>> + * Avoid sending wrong KEY_TOUCHPAD_ON / KEY_TOUCHPAD_OFF events to userspace.
>> + */
>> +static const struct dmi_system_id no_tp_ctrl_list[] = {
>> +     {
>> +             .ident = "Lenovo 80HE", /* Yoga 3 Pro 2 */
>> +             .matches = {
>> +                     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
>> +                     DMI_MATCH(DMI_PRODUCT_NAME, "80HE"),
>> +             },
>> +     },
>> +     {
>> +             .ident = "Lenovo 80MK", /* Yoga 900 */
>> +             .matches = {
>> +                     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
>> +                     DMI_MATCH(DMI_PRODUCT_NAME, "80MK"),
>> +             },
>
> Upon closer inspection, is there a reason you chose to match on PRODUCT_NAME
> instead of PRODUCT_VERSION like the no_hw_rfkill_list? The PRODUCT_VERSION tends
> to have the user recognizable name which you placed in a comment instead of in
> the .ident. For both consistency and legibility, it seems like it would be better to
> match on DMI_PRODUCT_VERSION and use that in the .ident.
>

The reason I chose PRODUCT_NAME is because on these laptops this seems
to more specifically identify the machine. 80MK is the model name I
see on the machine's box and at the website at the time. Now the
website shows 80UE. So maybe this is a way to avoid the kind of
clashing that led to reverting the previous quirk by Hans? If that
does not make much sense I can change it to match against
PRODUCT_VERSION, which on my Yoga 900 shows "Lenovo YOGA 900-13ISK".

Also, let me know if you have a explicit suggestion to make the commit
message clearer, or feel free to fix it when you pick the patch.

--
João Paulo Rechi Vita
http://about.me/jprvita
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux