Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp623372ybb; Wed, 25 Mar 2020 06:35:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsJ3DMhtLbp8XJNv9eqOpxYzwwVHdtksgXbweJfbOcxWWyv9IdSz0OFYGsuj1LDgglOXwe2 X-Received: by 2002:aca:484c:: with SMTP id v73mr2318438oia.138.1585143315957; Wed, 25 Mar 2020 06:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585143315; cv=none; d=google.com; s=arc-20160816; b=uIDR39+AJhapTmgF7v0z3gBFWym0c4fSXxSXHy0++OHAZAeejtoRX2rqtcNJjLujGR 6ZfkDfSF65BVbJmx4Ir8PvTEokOinchCECyqBCvDs5xeQ76JtbaAKHXMsHlxjtp0w6Ao 77cqEqTvjBtQFO2bwkzJA3FEEUO81sIS4FlX0tAPAtdNneBeO0tpNIXd9QU6P0tZ7U8c pJuVlzO0zm4znJFezW4OG84aXGsskojN1hrlD7zoSOzkpMUhfBSFCXBSaJv8898HDqHl OaTKZFjzGVOkGQ7Mtw5k3e+D3bNcddwFzYYplhYd2oJlbw4y7fcYKbvFlxMJio+OReyh HTGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=7YQG+YA5QRHJawX9Ppt9L1Z9Nw3kTAxF+neWw4FJf5g=; b=HJn5T/4eIy6/tbKksnfRQBo6pHRSnsn+ZMis6Rm4jb/9QSLqMiNLsDVoM05GX/JXho Dyl1Y+kLUpOgCdMZKMxNCmQ/MZ7wrrb2HohttDlyeNICvbNiYo5nHPvxVr7zPNJaAty7 RkwDpP6Sn98XL+rF/CWE60AOwAXdQg3dUaD7YHz9xllDngERpDcqgNPyzP0Kxwm3LloK vAIKXhmWLtBw/ZoGlAegn9XkD4AbTuNajGnOSZbpgCoHzRIymjZ/kyCdzSRZWKC9/cqc f3jIT/xSaccYhvKBaUHGK1sVaEk/AEwjD3BSZKFE86kI9pUqts5yT/8UCxACSsiUbTXL XP9w== 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 f25si2291599otc.161.2020.03.25.06.35.02; Wed, 25 Mar 2020 06:35:15 -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 S1727621AbgCYNeS (ORCPT + 99 others); Wed, 25 Mar 2020 09:34:18 -0400 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:53108 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbgCYNeR (ORCPT ); Wed, 25 Mar 2020 09:34:17 -0400 IronPort-SDR: 5wsWJMWtX9LDbiqPvV5unguRedTRXQmZtvwooBICE7F98IbOlT06Nw4QlFEj5sxBPFfXC5oYfO P4OCdoNbaevht8SeKMRJpwEbHbSPTYyeFtr49GF4nmXsftXyDoCKUPbi3XcTHAq40UAwIANazM WDYtUYFBHJAs0UsxrkgW2TaiYCTNdH05FRvBiMjyiAAQ2yJoK+XG2zoKgkXNIei/9gEAtsZwAk mRmktCjm2Qk4/YqMW8h6QpRuikS4KxocR6zSo+squzQttD/ylVQHf5aLo+zGCn/oku4VIf6yBj YTk= X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="47099660" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 25 Mar 2020 05:34:16 -0800 IronPort-SDR: 1H6DIVjY+PBMcml8Khqg7n/ep36rE4UenwmEgNZbjypr/4mKRmdiwBObNPLwfC+2wg/B55Q07d djTX8PnTMjJ+BHYJXvWQz0ioqFRbRDkfwj2IkmVc5qO858a/3Jxka3lULNlEEDArGZTUJ8CmwB 1lmBe9S6P73CBrIJR8y7hlKrq8L10QeQ5DxSPMRLdx56NPaXgfS5/aBnhHJOXDWYvoQzyR8iAn X0zrXgaHEM+P4jnpCQOv1fYxXSeZrZVfR8lmH0PGRYnsb8ew5YfUyCHEtu4I4uFmT5/2TpTt0M 0Qs= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v9 09/55] Input: atmel_mxt_ts - handle reports from T47 Stylus object Date: Wed, 25 Mar 2020 06:32:48 -0700 Message-ID: <20200325133334.19346-10-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200325133334.19346-1-jiada_wang@mentor.com> References: <20200325133334.19346-1-jiada_wang@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Dyer This patch handles reports from T47 Stylus object Signed-off-by: Nick Dyer Acked-by: Benson Leung Acked-by: Yufeng Shen (cherry picked from ndyer/linux/for-upstream commit 56405a5ea08eb34cfe83f3121867c9de0a5c48c1) Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index d05249b02781..ba58cdd5b76d 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -823,6 +823,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message) int area; int amplitude; u8 vector; + int tool; id = message[0] - data->T9_reportid_min; status = message[1]; @@ -836,6 +837,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message) y >>= 2; area = message[5]; + amplitude = message[6]; vector = message[7]; @@ -865,12 +867,20 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message) mxt_input_sync(data); } + /* A size of zero indicates touch is from a linked T47 Stylus */ + if (area == 0) { + area = MXT_TOUCH_MAJOR_DEFAULT; + tool = MT_TOOL_PEN; + } else { + tool = MT_TOOL_FINGER; + } + /* if active, pressure must be non-zero */ if (!amplitude) amplitude = MXT_PRESSURE_DEFAULT; /* Touch active */ - input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, 1); + input_mt_report_slot_state(input_dev, tool, 1); input_report_abs(input_dev, ABS_MT_POSITION_X, x); input_report_abs(input_dev, ABS_MT_POSITION_Y, y); input_report_abs(input_dev, ABS_MT_PRESSURE, amplitude); -- 2.17.1