Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1366988ybj; Thu, 7 May 2020 22:59:43 -0700 (PDT) X-Google-Smtp-Source: APiQypJ1tfRM7SFAhVOj7K6abu2oFxJukdcqXxFZ4Z60rdav6R4WEGdTIpTipA5x4dAv8IhYc5dv X-Received: by 2002:a17:906:3004:: with SMTP id 4mr493751ejz.381.1588917583206; Thu, 07 May 2020 22:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588917583; cv=none; d=google.com; s=arc-20160816; b=Ucz5HV2BswiV64Fr7lDSOmhlcsSVbq+x9pCb9lKqNmOLLugGjepmsQnY0dSmON0qCE GBQM2Q6LQ1/qcYJAHX8j8wX/Sk9LjfUM/UbNhd+lLC9woC2d7gwiYd/Y0v54qnPcestD 85r3LDpgQjN7W55Ceq6e1MrTUonLmPdTbjkLeUEZucqiWdW0go7D335b8tLccpvJjIKA CMn4wsAtcmPL9z8cFqVZJ2+7slW2iuAOtzg94ETkHNT+bFH48VU+y8xeFD2vr1TcuNvR zxDtFOd0USFjVsNATvUHgG5oQnNiWS7DvJMNtCnjTDzL4m+kk1WEbUS5Laic6OGyruuy xnrA== 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=VIGekzdz/x5jMytdRaUSxz6lZWlb24hZgn6VlkC7AIAy8AFI4Un/AY0u5Au9akzKMg Vhyl3uHinHQuaUnWm5ASjPjubOw9rA83r+QmpUWZ/bAvnrFYhXqCy2kpjlDcSjJz/4L4 Pkh3CJOcZV/ybFnnCh11eauMjNl4suWHUbSyP35fR1ESG9FqICMIHfc83R1SA/t9FnGo 5pBxcOHvedr2nY6PwJuuemZFRjYT/R7CKP4xapDplsrPJnTkkeKQJO24xrgnzMSc6bEt gDgQg3pNdsgIeRCaexJ7f/ewHfSW5JpT6OdpjO8B5SAubRU3AjW/uW8GhKhkk4o9LQfU 5EKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg16si375856ejb.310.2020.05.07.22.59.20; Thu, 07 May 2020 22:59:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727121AbgEHF5k (ORCPT + 99 others); Fri, 8 May 2020 01:57:40 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:38668 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727106AbgEHF5h (ORCPT ); Fri, 8 May 2020 01:57:37 -0400 IronPort-SDR: iq+Xz+pkTfcg99ODonemdncCofNRYnrtv6cBmTTnoBNSNcgbXQnUBaMUWx3A5vz169+n1pSHQK yqdlboIhuX63FzBW5RPfEJY05+A4uTw65hPiooqj4Zn9AsWpLpi9mJ5PtyfigdNwA67x3ZdeXJ XId3Kn82osJvcl2j+LaIjr7FZ3BY448cYlvWEsAq4zPXmDDfF0p5MUScTxt9QN4RuZ1eW9qfQT B26y83fE92Bobwa+qHtzbhrZGT4NLfrJ56oVxcDYhFmjGQtshcdZguNwpJuBiWy3S+59SYpU4Z LY4= X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="50670052" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 07 May 2020 21:57:35 -0800 IronPort-SDR: Jht1gashke8s99GRPq4ALeztPIodd5iUctQdzP1M7u4hRj/ISCzP8cOu5+8l2cBk7WqSdKPPb1 yxsUkfZAX2efAhS59sSe/IqZH5/zK4P3sAewCvmX1ZnQ5gQL2Gnrbr9nXgD319DUn2TtXEV/FK jIuAnbXEndG32vS9Ggsq2RzfcnOy+X2pyY23rh36DbrIvPcVVHgp6bLp1lclb/0ml2S0IzbEtR WCNYtTz0g/iC5FNdP0v+llCuFtIhCyKpKPuouzHIIQPxkibmfxzvcPQZ1blSco/Cuqh8ufS2Vw cgg= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v11 09/56] Input: atmel_mxt_ts - handle reports from T47 Stylus object Date: Thu, 7 May 2020 22:56:09 -0700 Message-ID: <20200508055656.96389-10-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508055656.96389-1-jiada_wang@mentor.com> References: <20200508055656.96389-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