Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3365212ybb; Tue, 31 Mar 2020 03:52:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu01IDrW/71DkekFXE7TRQ30+EPrG9gMc+DqIPhkYdDszmJDzcZjWWRXedqLJL7SX+XJc9p X-Received: by 2002:aca:5444:: with SMTP id i65mr1512518oib.101.1585651978471; Tue, 31 Mar 2020 03:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585651978; cv=none; d=google.com; s=arc-20160816; b=u9vZZdRtYsT6RguWQD8ZpRILanVYGXv1a6lAygNohw1A4JwhtIRQFFBo2hLdZVEZ4f IMpsYxYgjk02Ma4Tgjy+6XPGhXwFyh5HOlUvwETm0HGg518eHFK8gEDM3za0Nr06B/XP 2OdA+tRn2XyGrvjI6m3Pl756lhCbhaiRP0CAFfwnDzNEg+TVDiDFUdXqtGxD/u8LtWvN OqGwHi1YL9pQ0xAJFBcZeZIaJv6hppEz7vgOp1eUy75ssmlDuKtnLBcyJj5Boa4OSvXt syNBP5J7HfdLTq7Aftm2SD2eadYszkobyfadUpm7fiHfP5+DE4DMvMwaRshyHidU4ZVb V4Gw== 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=j+hzJIl7zagzixLSTZ0BjaPbZuvT3fxRcNUa4tr+atOlKX/6pdm3Y/ymTREK6QWico UIA3rOPApzuGO2r02L6bfMEydhbbF88cHBgmAMqCFfEDTaWx8wbT2aG5M+GNas0MApAU XLdW6sAr+u0JXlriI43BI4qOyQw7sEEgxztFN3Kj8ezIXivnnjmbfR5aY3Jekbj4azGd U+/9jGIzFwI7KgSh10eozhDzq+JXWu9O6ptW9rir5ggaLRHniOC63xtsSRHzoNU0KaAS 3aNPT2/BvPeYyIoKrfEGG+8LxnuNliBpoGZdau/3lAzyy1oGAxaI/4TfkecGTm2s14FZ Oljg== 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 f23si608295oti.69.2020.03.31.03.52.46; Tue, 31 Mar 2020 03:52:58 -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 S1730575AbgCaKv0 (ORCPT + 99 others); Tue, 31 Mar 2020 06:51:26 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:43515 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730538AbgCaKvY (ORCPT ); Tue, 31 Mar 2020 06:51:24 -0400 IronPort-SDR: QNiVx9JU5YsMiV3bUpEoKZWUcGHQRGctXNFCZ8RTr8FRNBJXGiaq9zS+5Ez3VBxTjKWiF9SPPX DlSl+9ZEP9Y4TeLkUyFNLMFdApVoj6GOiOpr6yhdhm1HnwnLMezn+vT2d3XYIeJJTF7PXLGM3w zVQheUZKkBeLrsT2g2DzYgHu2qJRuG3IhilcfkADErK6ezaiPcJt62EEl1SYvk6+TvJxATxbIj h1MEhk7Pq+qXDydq6K73JRKzsKQGjeAm1jV53tIDkqSRqRSB/4N7HHLj/3BtlHaj9JENzHtO6x CPQ= X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="47330728" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 31 Mar 2020 02:51:23 -0800 IronPort-SDR: 3/Jx/S79LVHLh90rYZc4Mnz6qx1/yuOF/iU/ncDS1LRueUqCNwHh+ihRewzVCjepSz2PUVZaej CsytHd8WosqjPxRZQ3i0KPq+k6e0jr+XFp3rnfAYqbB1G6JWUnCvXglnjSqkf7iDKKKEj2POZL gYgscAiXvu3BUCrSxkphPuqOkEmiJyw1kKMZMUOQFOw2n7rEWihgrR6Eky6oAxF2PTKGubKpaY syZxH6PuGV0IXKg8f5L8JqWiroRMzbr0rUVytV/YEAWjZ/QB70AoRSLQzCQuDd2BUo1afrbfM3 kOg= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v10 07/55] Input: atmel_mxt_ts - implement T9 vector/orientation support Date: Tue, 31 Mar 2020 03:50:03 -0700 Message-ID: <20200331105051.58896-8-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200331105051.58896-1-jiada_wang@mentor.com> References: <20200331105051.58896-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