Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3336323imu; Sun, 11 Nov 2018 12:39:25 -0800 (PST) X-Google-Smtp-Source: AJdET5fiqVOAFLNfuAwOlOw/N50MUYDSA7o+rlndOw0yWHU2LLVPlcqLuAct2SMhdxZ47ps0v72M X-Received: by 2002:a62:c299:: with SMTP id w25-v6mr18077572pfk.205.1541968765286; Sun, 11 Nov 2018 12:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968765; cv=none; d=google.com; s=arc-20160816; b=UTNYbNNSeOZDLaqJXJ1o8QtT69e5BMSM9a7j3Zqthy1EF5LsUA+DOPAR47rH90woFS 6ZF9Bw4WUpMmz5VARArS0pD6fOc4f5RGmYzULiVvUtOLPUGWzKgMZaBruag8JnaLkjoF NDELpXzTXQ0I9pKg/vJcqhsR1CxU9bJHA0bnPUNY9DUFuE/gGRPq90Juj1o8v2H/6HAP lLWL+qSWFIkqBTsKxIqYVKMli3claU/fMN7NR7y//bKSAhZ1iKK/1Wq6SUw1Kw7tV1YD eYT9HoMkkAZGs+PAFGtxPkrv6LMv53mDv8adJkAN5SDEfbT9s+wzOac1xN5WnpiOcORr lSGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=brpCMR7ZrID3GCDWRzYLUUNU+JzQVL9KdRlbQ6SD0rY=; b=qOm/19cgMscw6r5zSquiNJbBNRXgYRQYKHr0uw9j7UFZHIxKhFXP4jQcAfOsoJIftl zWolsTZm2FsLzKHIl+AgK70TnJM8/+vRDPtRtC0TdTl7Cq+w/37SDVd+7rkt9VCnR7LY 3PGAM5J91xiJhngx+HxJ8UX7FEVsyv28LmSzgk4DpVFKIZaWDb/U9Cj3GDEE/sNrGZ1I 42lX9MLWithJKgRe99FZe9CQUJkbTDpQhLwHRFOTFDthC4tvW6/8pBgg0yt4iFAHS/iS NvM/AUAyLArwq6hRdvV0ffAuQdHYxqCKSbqokmKfS6Kvuxrf3qJ3Kqu2AWQH0pmO82Je 7log== 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 x142si13455524pgx.202.2018.11.11.12.39.10; Sun, 11 Nov 2018 12:39:25 -0800 (PST) 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 S1730365AbeKLG1A (ORCPT + 99 others); Mon, 12 Nov 2018 01:27:00 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49714 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730070AbeKLFsK (ORCPT ); Mon, 12 Nov 2018 00:48:10 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsW-0000lJ-CZ; Sun, 11 Nov 2018 19:58:40 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsT-0001bm-EG; Sun, 11 Nov 2018 19:58:37 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Dmitry Torokhov" , "Stefan Valouch" , "Ulrik De Bie" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 176/366] Input: elantech - report the middle button of the touchpad In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Ulrik De Bie commit f386474e12a560e005ec7899e78f51f6bdc3cf41 upstream. In the past, no elantech was known with 3 touchpad mouse buttons. Fujitsu H730 is the first known elantech with a middle button. This commit enables this middle button. For backwards compatibility, the Fujitsu is detected via DMI, and only for this one 3 buttons will be announced. Reported-by: Stefan Valouch Signed-off-by: Ulrik De Bie Signed-off-by: Dmitry Torokhov Signed-off-by: Ben Hutchings --- drivers/input/mouse/elantech.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -500,6 +500,7 @@ static void elantech_input_sync_v4(struc } else { input_report_key(dev, BTN_LEFT, packet[0] & 0x01); input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); + input_report_key(dev, BTN_MIDDLE, packet[0] & 0x04); } input_mt_report_pointer_emulation(dev, true); @@ -1064,6 +1065,22 @@ static void elantech_set_buttonpad_prop( } /* + * Some hw_version 4 models do have a middle button + */ +static const struct dmi_system_id elantech_dmi_has_middle_button[] = { +#if defined(CONFIG_DMI) && defined(CONFIG_X86) + { + /* Fujitsu H730 has a middle button */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), + DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), + }, + }, +#endif + { } +}; + +/* * Set the appropriate event bits for the input subsystem */ static int elantech_set_input_params(struct psmouse *psmouse) @@ -1082,6 +1099,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)) + __set_bit(BTN_MIDDLE, dev->keybit); __set_bit(BTN_RIGHT, dev->keybit); __set_bit(BTN_TOUCH, dev->keybit);