Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3053198imm; Sun, 1 Jul 2018 11:08:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLBJaqwbfiJyxy0N1j7dNtHtTj+Q/2q7ieb5GMhy9sqexv64i6VgA7pZb1Dmw95k+ESmHl8 X-Received: by 2002:a17:902:a9ca:: with SMTP id b10-v6mr22958357plr.275.1530468522952; Sun, 01 Jul 2018 11:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530468522; cv=none; d=google.com; s=arc-20160816; b=mVQpxZzt03NilTUp0q/QWeEUp2p7sAt4eRfWnrvsjtYbTqaowL/bs5cK2kFHwMRdeK VF41jAi3rS1uMrbNlWcXXyb6qAG9IGHdrE4uVqvnlNV51cFNyfJCpzDYemfHp/FvVrQg ZxSWW9n6/a4C0Z95tI1P0pidzAE7kahvXiEA1ZyhlsiZuGwh8t8Vm34A5nYVlEd1Gb1v IR2XujO/ZAzJDq0Y+HghtIUkTNGQi/1O/hP5gS41D9rzadaCUU8IONfTsi37Y4A9Y1P8 5f7lUmKP2jH7gKP1lp6b1fz2Z1AifzZiirTsU5Q9EBZm+zQS6T0UnYJWWQgFJY1isBL6 IH1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wb5hxoE9Z7xJHlBPk6/90jzupcIvc04QQstUZTu7Smw=; b=05BomZP4MnzFsNVnkoNJvM1PCTIoB10rdCS9CzhI8ZTQLv3eU1sJAO7RfvHv6PLzvp Qpb/UM212YtiX+qsgWAY50GGcyS1mDQfZgOs0cuFMoc8+UsfhstbtKWeAQrfmKXyE0us 3h8xIMQ6S1UM3jEOi455iZSLAPpjtjOiRsat7394+TOEP09j31lbvYvF/c29ZH+FZvAA i6RmULVk/lmqAqr+sR89Wd7yryQCtca6lZ+D8e0+zK7QiSi076pUy45eDzL0xqQM22Vh eHWtcCCXC/Dw4aUFvFp44wLpwB4IihKH6Fm4ehdwUJWVAyie90vR4CPScOPFri9YRjrb pRHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10-v6si14212206pfb.69.2018.07.01.11.08.28; Sun, 01 Jul 2018 11:08:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965721AbeGAQ2m (ORCPT + 99 others); Sun, 1 Jul 2018 12:28:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34342 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965671AbeGAQ2d (ORCPT ); Sun, 1 Jul 2018 12:28:33 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B30A6AE0; Sun, 1 Jul 2018 16:28:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Ma , Benjamin Tissoires , Dmitry Torokhov Subject: [PATCH 4.9 095/101] Input: elantech - enable middle button of touchpads on ThinkPad P52 Date: Sun, 1 Jul 2018 18:22:21 +0200 Message-Id: <20180701160800.955761553@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aaron Ma commit 24bb555e6e46d96e2a954aa0295029a81cc9bbaa upstream. 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 Signed-off-by: Aaron Ma Reviewed-by: Benjamin Tissoires Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/elantech.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -1173,6 +1173,12 @@ static const struct dmi_system_id elante { } }; +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 */ @@ -1192,7 +1198,8 @@ static int elantech_set_input_params(str __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);