Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp592853pja; Thu, 19 Mar 2020 08:01:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvwnl7GzLyiKuDbJ/Ut7y3oIJ/EwCJMCrgkppa34GDUOZ07V8MEJXFNfSLFyH9x4ulRlFMm X-Received: by 2002:a05:6830:193:: with SMTP id q19mr2604961ota.164.1584630102566; Thu, 19 Mar 2020 08:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584630102; cv=none; d=google.com; s=arc-20160816; b=I/o6oj8YabeS9rgJcXT13aiI26JQA8jAx0j03eJyxQ/uq5BrNgUAkpIj1B51P9xsnf 2G3I65WtbY+0VI0p28B+z/os/TNONZ8ZLpy98QE6g+Qk/TGz5Jj2xfi6cMSK79KcORV4 GSHiuIY816wOIeEDdZE2bk3CMDYYfdsQqRU7BABvhcKThFz0cTt1W9sNouGLu4kBRD0x yUH9y9vdBX4zFBAUE0W5akPBKM1wuDd0v/+HjnnhKlTMrSVpZUzNB4RJO63wZmF+EB9c T+56tc1R2/E+7OwTW//SqCSOfgwqjA/BVoq3uVGRILRUtv2k0zN7Nilb+QanAdFNehnN Ei2Q== 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=t1bL2Ju2aQduDMQeOlL8ZiLXdsAhJuQi1+jRnsQvj7A=; b=hnzD3MUEmyqfeNI0AyQ18ZTxbisVjVu+CFl6ive3eXhZFA++jG93YvdHgJ0NUQ/1/s Ei8Im0q+MF6Bai1PaTQ9GChvxWtRxYkTPpY+Q57H9nEyeB5H69YtIt3rGnJ6s1nrxt5j WB9cklCIQ2vypvgVF8ak2lxFUwMTgPdqXa07pKf8436uKouTJbL7FRaIXOqJy/6Z7vYL I9M5/eRUmBzHAX/EE8PPE2NJL7I2I0/ubxtCWtv6qshEHIspHGPW3luHXTbZpjRoWDE+ rJan3MAZZxpG36reEQf/a7B7W13K6pzSTIhMnfdnZ/zwM+q0hJsoRYBlIW0IrndIW/5K T3tA== 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 u9si1184395oia.62.2020.03.19.08.01.22; Thu, 19 Mar 2020 08:01:42 -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 S1727873AbgCSPAv (ORCPT + 99 others); Thu, 19 Mar 2020 11:00:51 -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 S1726871AbgCSPAu (ORCPT ); Thu, 19 Mar 2020 11:00:50 -0400 IronPort-SDR: 0YxweX9C+skqOgnvbFsvF9uFhwjLlxuHSnZH/hBhuOcvOme5mkAJq0OEm1S+h1TzWeqa+zeFaS vuQa1U+fhgubjC7rCv/O06MegjoTBsZ1NPTw2B1xsqF7QTI5VxEjeIJiuWawEuzHqnWR8mmnBo EkSAYZICyayInxSqNx3aQ1ksCay4M+lO4VqCZ7Xc7rIVVB+DwDoVtAAejS/AeJkyoFuXuKIuH2 iZ+iF/MES1iqQvyCI6jcEhXNIUNfavq7z9+HjDzBcgOVN0a7onejq1bvqPxtIVgj6aIwupf/M6 fJY= X-IronPort-AV: E=Sophos;i="5.70,572,1574150400"; d="scan'208";a="46818575" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 19 Mar 2020 07:00:49 -0800 IronPort-SDR: 3abvqoVS/qA4BXc4EkwupiCewjZPmWyo/BZ4bJe8hvLI0u1zqNPmxouPCnCRFFQ5T++hTuLvKH UAk7nkXexwCHjWdi9eMwxVmL5rJ5snm6maDdu9M8URCnxORb3U3kDircAMhpyRMbawJ4gJ+KaB xCAflkgolJDmgVMtCbvPhG6D8CrufvTXsRlzRVy8lLWk7goEiznW8zsffqsHtxN4jfMn12J7vF 99D34NUgYE4KGfA3XhE1P1H9JqZQBpbPHWKTidrpeleqR8BHmvTQ9IybWuetcA0iSrSHs+CM4c tg0= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v8 07/52] Input: atmel_mxt_ts - implement T9 vector/orientation support Date: Thu, 19 Mar 2020 07:59:31 -0700 Message-ID: <20200319150016.61398-8-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 The atmel touch messages contain orientation information as a byte in a packed format which can be passed straight on to Android if the input device configuration is correct. This requires vector reports to be enabled in maXTouch config (zero DISVECT bit 3 in T9 CTRL field) Android converts the format in InputReader.cpp, search for ORIENTATION_CALIBRATION_VECTOR. Signed-off-by: Nick Dyer Acked-by: Benson Leung Acked-by: Yufeng Shen (cherry picked from ndyer/linux/for-upstream commit a6f0ee919d2631678169b23fb18f55b6dbabcd4c) Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index f6465edaa57e..df2e0ba76e63 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -817,6 +817,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message) int y; int area; int amplitude; + u8 vector; id = message[0] - data->T9_reportid_min; status = message[1]; @@ -831,9 +832,10 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message) area = message[5]; amplitude = message[6]; + vector = message[7]; dev_dbg(dev, - "[%u] %c%c%c%c%c%c%c%c x: %5u y: %5u area: %3u amp: %3u\n", + "[%u] %c%c%c%c%c%c%c%c x: %5u y: %5u area: %3u amp: %3u vector: %02X\n", id, (status & MXT_T9_DETECT) ? 'D' : '.', (status & MXT_T9_PRESS) ? 'P' : '.', @@ -843,7 +845,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message) (status & MXT_T9_AMP) ? 'A' : '.', (status & MXT_T9_SUPPRESS) ? 'S' : '.', (status & MXT_T9_UNGRIP) ? 'U' : '.', - x, y, area, amplitude); + x, y, area, amplitude, vector); input_mt_slot(input_dev, id); @@ -868,6 +870,7 @@ static void mxt_proc_t9_message(struct mxt_data *data, u8 *message) input_report_abs(input_dev, ABS_MT_POSITION_Y, y); input_report_abs(input_dev, ABS_MT_PRESSURE, amplitude); input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, area); + input_report_abs(input_dev, ABS_MT_ORIENTATION, vector); } else { /* Touch no longer active, close out slot */ input_mt_report_slot_inactive(input_dev); @@ -2180,8 +2183,9 @@ static int mxt_initialize_input_device(struct mxt_data *data) 0, 255, 0, 0); } - if (data->multitouch == MXT_TOUCH_MULTITOUCHSCREEN_T100 && - data->t100_aux_vect) { + if (data->multitouch == MXT_TOUCH_MULTI_T9 || + (data->multitouch == MXT_TOUCH_MULTITOUCHSCREEN_T100 && + data->t100_aux_vect)) { input_set_abs_params(input_dev, ABS_MT_ORIENTATION, 0, 255, 0, 0); } -- 2.17.1