Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1368094ybj; Thu, 7 May 2020 23:01:23 -0700 (PDT) X-Google-Smtp-Source: APiQypLVQx1BJtK88nu3cTzNPcBQpzbu5iS0d50FfuPE1IRsH+qfKoxoZww6/g6UQj1jN/RGdNNZ X-Received: by 2002:aa7:c499:: with SMTP id m25mr779182edq.122.1588917682835; Thu, 07 May 2020 23:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588917682; cv=none; d=google.com; s=arc-20160816; b=jmd6butHkj5M0UOiN7QHYawcRYtb/YswDm2Eo1vFqHoglqKV/LES8/vYGfL6ZBdeHI dhtjZMHlBX3Be6Ra1vgdx7SRPvfpEVISSh7B2K2dMJz0AYmqBIeUnLdUOPS5M1n0Qans 1+P1uz8iHqB1sHPlHck0GV5bkW3BR9tjc8Mgv3x2Q6W0C9SihV7lMf3YJKx4s/nYLpFZ RKeKHB57T7WeYQfVt5nvIaStIgEkEMfUoJpJfXDLfOkzaBE6wSmvEKRDdipqrfZ/gAgr CTxHJ1Ox7fuTppjO8n0dGIzDz9wcPN8Dw3YSxJPdiTNQZFNABw/ZpT12ghBD3Wx8M9Jk tX+Q== 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=w+Qq6jH1Kgf6jbhzWE+5FHbtSQjpvWrwiXsSRWqZYgZAHEUpriFVPtuYQMwT505LDA /ss0BFAsJ/jsDos/TBUJ4nBXDkN9rplyTDHAJPM+uf0wHPNgV2JMRtWW/kd2czhMZZJN 3DxeCfNyKGLq0wj2Zn64OTQEPiHINJXr271owfyKOwY3Z6loYt3Amt/oVstEfXwc85+u p3HPbFW2auMN52IVK0kQBX+CCVHSLpd+hUSJxhlhw4F7qf/HtKWyU59qo8LB/5BQdOM7 vsJ6dLU5UMQqoPne6x1gNv99hXuXCUD1Y31PcguDvS7OQ7Ny/sGiUqMnLzp4vfxuWKsz OcFQ== 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 q24si377301edr.166.2020.05.07.23.00.59; Thu, 07 May 2020 23:01:22 -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 S1727096AbgEHF5e (ORCPT + 99 others); Fri, 8 May 2020 01:57:34 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:45858 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726701AbgEHF5c (ORCPT ); Fri, 8 May 2020 01:57:32 -0400 IronPort-SDR: nOVsoYWfBGgfOnXTTd9YlLU1hkpZVQrg4ZQS0uRLajEcCPyLTkNOIGa0hSVMiwO8DSlpeh33pz Jm0oW6FSeE72yKmtZyE7pRQ3VBIdy8HHfBdHZ+8t2Vq118n7iSWCH7aMC9M2gzTRTYbw4oFfBZ ab/NJMXLxA2r28JlhCr18SoL1VoZM3r+ca91Lv44KPI/AL7sk4Wt9kN1yJ1dAcnp9vjpLqpDDA j17d2bIEE3Xq0vvDb2J7oOHMRkgYfbrI7e6vd1o5J2ulih+LbKcX3Ck8QlryuplY1JghYVs7Ei LPQ= X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="48710560" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 07 May 2020 21:57:29 -0800 IronPort-SDR: /1c6/32l0lRKDPvHVXozzktU2zipPl9jaIDsxFCqC5cXqEneB526law/WPyFoVUBckwt5ubvgd GT9gDmeESXe/qERNrmA2R+yq3miF8llHvFJeDnQW1bXrP9Hef6yLWlb0g9B4VKWc6qdPNgllyO altkADSa03lv/RzVs+8JRhGdjiY05BN4cFhqhCny/iq2O9FJ/oA730lPeI3OElQHjFRXPgzNhE oTy0K6jBBl/HuQYqT+lP7oJyKeVe251RJCIaw85WOewVVUamVCUDmQ0FPQBPEq00rROSw0FGnv Q48= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v11 07/56] Input: atmel_mxt_ts - implement T9 vector/orientation support Date: Thu, 7 May 2020 22:56:07 -0700 Message-ID: <20200508055656.96389-8-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 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