From patchwork Sat Dec 27 11:31:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriele Mazzotta X-Patchwork-Id: 5544561 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 91EA5BEEA8 for ; Sat, 27 Dec 2014 11:32:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B247E20173 for ; Sat, 27 Dec 2014 11:32:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D89AA2016C for ; Sat, 27 Dec 2014 11:32:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751380AbaL0LcB (ORCPT ); Sat, 27 Dec 2014 06:32:01 -0500 Received: from mail-wg0-f46.google.com ([74.125.82.46]:62693 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751458AbaL0Lb5 (ORCPT ); Sat, 27 Dec 2014 06:31:57 -0500 Received: by mail-wg0-f46.google.com with SMTP id x13so15738935wgg.5; Sat, 27 Dec 2014 03:31:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+SV0xQYVvKn8Jz1pP8UNFTIZ3UrA+5JF3Mm6yxjgBX4=; b=jAchDm/mjn8LuBzadxfbGnZbDXxYxYzueEpEQg35anbeqcu3i1VAYy/aT1jJAemHUN K07KUG7KHILNeImiSJCsbVdmrB5/i3Ucxvd1giCEDPRgzetyaMi9Y8f9AKxe2RCESxOY 3zc1uJlnfNYQPz34yW1cpnPx7avKqdDHVzp8Ek2zmbzaEAwqGWshyx4Ifjttv5mFBg4B d94nWPNLzFfIpFHUP0MMi7u/+Qk44iIChtS+v0bEHmOYJr93uJKk3P6iHjRVRrhk8poK WBzo6lSk7PUpEob417tDXZF4sk+UWGRwZjgKQK9l0VrfB/ScYFrs/+MSIOuTh9A06eJU uTbA== X-Received: by 10.180.91.36 with SMTP id cb4mr75592509wib.30.1419679915190; Sat, 27 Dec 2014 03:31:55 -0800 (PST) Received: from xps13.homenet (2-235-140-64.ip228.fastwebnet.it. [2.235.140.64]) by mx.google.com with ESMTPSA id s9sm31495839wiz.12.2014.12.27.03.31.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 27 Dec 2014 03:31:54 -0800 (PST) From: Gabriele Mazzotta To: dmitry.torokhov@gmail.com, rydberg@euromail.se Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, silverhammermba@gmail.com, Gabriele Mazzotta Subject: [PATCH 1/2] input: synaptics - make image sensors report ABS_MT_TOUCH_MAJOR Date: Sat, 27 Dec 2014 12:31:28 +0100 Message-Id: <1419679889-6582-2-git-send-email-gabriele.mzt@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1419679889-6582-1-git-send-email-gabriele.mzt@gmail.com> References: <1419679889-6582-1-git-send-email-gabriele.mzt@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Despite claiming to be able to report ABS_TOOL_WIDTH, image sensors were not doing it. Make them report widths and use ABS_MT_TOUCH_MAJOR instead ABS_TOOL_WIDTH. Since the 'w' slot is used to report the finger count when two or more fingers are on the touchpad, make sure that only meaningful values are emitted, i.e. values greater than or equal to 4, and assign the correct range to ABS_MT_TOUCH_MAJOR. Link: https://bugzilla.kernel.org/show_bug.cgi?id=77161 Signed-off-by: Gabriele Mazzotta --- drivers/input/mouse/synaptics.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index f947292..ea0563e 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -814,6 +814,8 @@ static void synaptics_report_slot(struct input_dev *dev, int slot, input_report_abs(dev, ABS_MT_POSITION_X, hw->x); input_report_abs(dev, ABS_MT_POSITION_Y, synaptics_invert_y(hw->y)); input_report_abs(dev, ABS_MT_PRESSURE, hw->z); + if (hw->w >= 4) + input_report_abs(dev, ABS_MT_TOUCH_MAJOR, hw->w); } static void synaptics_report_mt_data(struct psmouse *psmouse, @@ -1462,8 +1464,13 @@ static void set_input_params(struct psmouse *psmouse, INPUT_MT_TRACK : INPUT_MT_SEMI_MT)); } - if (SYN_CAP_PALMDETECT(priv->capabilities)) - input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0); + if (SYN_CAP_PALMDETECT(priv->capabilities)) { + if (SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)) + input_set_abs_params(dev, + ABS_MT_TOUCH_MAJOR, 4, 15, 0, 0); + else + input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0); + } __set_bit(BTN_TOUCH, dev->keybit); __set_bit(BTN_TOOL_FINGER, dev->keybit);