Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2993234imm; Sun, 1 Jul 2018 09:54:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpexLHfFbirscuEXocOVGSfJyoB/cQ+5qlDsBD8BQvAwu7ugbx6P7Al3gUhcYJMPRjfVQcZk X-Received: by 2002:a62:fcb:: with SMTP id 72-v6mr22156146pfp.231.1530464081288; Sun, 01 Jul 2018 09:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530464081; cv=none; d=google.com; s=arc-20160816; b=EThJ/XVVCeZXeBgml42U1h1NQm0FBV+yCyBskrxoObZL6Kfxtj+J1l24NLy/kGs+RH WZwqptNhLwzy15GW6CLku7lpZYcqBv1nwwSAxNOrgwcDYE7uM4wM7Jk8fiWpcsRS+V97 ax3hUBJK7Lgune7J9A+kry0m4BRQzFPLtkQO8nAcW4XOs7xIXvObOPWnFwtMqddZiixb M94sPUFhsZUn2nxrXL+8j3xnkunNB4iTZXTJ1JjYScYv9aHwhW/JBVX5K0UmX4k2R9FB bIIVFwv2qmDZPmqD9WmvNLEVOCknazQx1bzhB4L1Wr7LDt8tZorhlRn7QCUN9qV/R/6C yk5A== 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=Md6vOR2rct50MB8xq8erGsCapDP10uVES25RQRLlx7w=; b=vc0BZwcJnqymSj5BfEuCFtW/DdjIouULiekzt8UfHQ4fR1062QNl2sMxB3UtEa/Ps2 yiHDy3ME3+tdYI4eX9E+doPztpCBV5lEb5ytW8J/Jus4qqxmtlDdgm+0LgJMQ2/4+312 VoXZa9zM+lBk0KGFPURAJ0pVgUwD1+QrrLCQ6pCH7UTL7QlVtODmSYKLItvrEhYQsLgc /1fnTjXEqlyvVLoHbg07htjl147jqZpnOhp/db5AH1x4R0h/WDqw1EIyJShPT9izKkz1 WWRterbfbahkoZbqTRyHdj2a4KxvMEb7LJsD9tl/AFxF2zMniJowomXU3B+9ZZtRVcEF 2zWQ== 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 x7-v6si12223153pgb.297.2018.07.01.09.54.26; Sun, 01 Jul 2018 09:54:41 -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 S933317AbeGAQxI (ORCPT + 99 others); Sun, 1 Jul 2018 12:53:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38262 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031846AbeGAQpk (ORCPT ); Sun, 1 Jul 2018 12:45:40 -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 5E500AA6; Sun, 1 Jul 2018 16:45:39 +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.17 199/220] Input: elantech - enable middle button of touchpads on ThinkPad P52 Date: Sun, 1 Jul 2018 18:23:43 +0200 Message-Id: <20180701160916.494222629@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@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.17-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 @@ -1169,6 +1169,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 */ @@ -1188,7 +1194,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);