Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp593833pja; Thu, 19 Mar 2020 08:02:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtaGBKUUZ6qWctaA2XdoKnjl/IRCxlejB+yPFX0jYKsFwVLx8HjpBCgpgm9DKxQziFKiNvs X-Received: by 2002:aca:130f:: with SMTP id e15mr2576674oii.160.1584630147171; Thu, 19 Mar 2020 08:02:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584630147; cv=none; d=google.com; s=arc-20160816; b=HKHoI7xEsrYji57ayrP7DIrexsJRdqRYmynN3yahXGsJXb60JYXnpfGsmykw+s6o/y W4IRIgpZtJG0eZND+gu1DiPRHoupBkSQaMcnGyPBEyBy0SygSgYnoWojqSLIVs3cVx2l 0nyXGInwV1T9PX5wUDaRCzZSYbNt1XuG3T7lYLZjkAZEx+8+LNq6WEFEzHSxYC/bfTq0 qPzXNM2EENW7S7oGGLRS22S1hqeuaJGGcsd1SE9D1OZ6MxayHDrqgn02Jgplg/idDy0Q ipivxaMa4oTTJsHFX0B0cF2v0hTYN7ODIv1OiCOmRrdrBbiSmO9Rneh5DxLrxTdBw/x9 AJQQ== 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=OZBWdCVNWTSpzO0zO4b768kKSvHsqohI33xw8DxBLo/6eRi2MsNjO0Hy9mOm+Cdno6 n1R9WItvxgiTBIjHeAAZdfzdpzsDcr+PLiZQPIOf1NWzp86k84wuxrV9Cotj0sJPjFTG W4jHCknqE3TbTPnpg8fpnSzzAgrfQIBtObI/E7P4dIK+O6s+Xi/mJlSmimM9hXdQeSZC CDLri6fHhg+CarB2RxbVib7TBl0bFwIQCRm+H2Zir/yc8DNOhClu5vm9NxAxoNWZBEop vBJ1EFAsvUvBGn6gi6Dm/O9QnA0QMPA7Hcrqm1fSviywwEWG0DNxpCN9atylF9Ss0fpE 0yPA== 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 d16si1394184otp.135.2020.03.19.08.02.00; Thu, 19 Mar 2020 08:02:27 -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 S1727902AbgCSPBB (ORCPT + 99 others); Thu, 19 Mar 2020 11:01:01 -0400 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:5218 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbgCSPA7 (ORCPT ); Thu, 19 Mar 2020 11:00:59 -0400 IronPort-SDR: Y7bPV8FtReL4o62/wc/UuUYIWX2h61ho6EQEwutN2qJTaXDIG36WXcImzUxYVobQ2BDlQqz6l+ YyveSE4hrd1Mr6Awd7hKuoc9l2xRhTFjauAct++cbG5dWSppHDgazKb88/2XAb194Uu54rTwG6 d56rElj2xysTG9DmaJykNtEIjLhUYrkJ9VH+Bjkz2qAoSzd57WUOxapQmAxVM3EEMgc2q+eQvW 7ZBTS/pxKsUtGddPYj8tMXHwe2wgu+otYa+nw2UnRnTC7HDLUk6EbWIzj0pK+P7WVjT9s5L0fo wfk= X-IronPort-AV: E=Sophos;i="5.70,572,1574150400"; d="scan'208";a="46818602" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 19 Mar 2020 07:00:57 -0800 IronPort-SDR: x14uGwY+wFqudEV6VZB2dBYFjSEQ0lbm5p+WUdtYX59949hbtQnDke1pT1ZzUxw7B83IwK/mAs 6PWB499Ihy+5Qolvk8EtR6AOxSXpcekt1eJlb8HTzEeFuwKWqX8+x0EqXyRZnPVCWGj8BOgged ymnDg/WnJS97VUxk2Zr9NOY/0vapkWbQw7okTQGdpWBqpoGMebYBpVRSOQlobG9FZsoH2rDSV+ MULfFpKG+IiIZkyETbLps9SZIyEril8iV6VddHxrtd+WS+Ii9WdcW320d2Iw9DYqev/yn2hyXQ WDs= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v8 09/52] Input: atmel_mxt_ts - handle reports from T47 Stylus object Date: Thu, 19 Mar 2020 07:59:33 -0700 Message-ID: <20200319150016.61398-10-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200319150016.61398-1-jiada_wang@mentor.com> References: <20200319150016.61398-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