Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1638824ybg; Wed, 29 Jul 2020 21:21:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5fB0KVbSpMM0yDA8csk4G8/LaUzkLEjQS5YPLOFzLeqsQ2NWIyHBFIJZgdjsAmgJlm3ok X-Received: by 2002:aa7:ca4f:: with SMTP id j15mr44843edt.334.1596082864887; Wed, 29 Jul 2020 21:21:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596082864; cv=none; d=google.com; s=arc-20160816; b=h70G4gbYqV1oEzbFjM8tXsAMinOzUW08PXEPcTpgJtPQDeQw9qxMz8Tb3pL8WcRwxq UbefNxH6oPHou2WfdZrAZOtdnTKY3rTYHC93gZ450+Cdn4poynkAPXbRXQr7fVewYEtZ 3B8HnMD2KwIbKLINGX+5jz7rNtlNPVegv9Ksgajppuwu8AdXNvKTyzrLprKYo04G2nor ZmSsCB/xh1HC5Tis7RkH1B7uPsIbtoffa1+iO3Ff2zahkR/LvZgJBXUB0xXRJjXPQpsB VWtn6cAuXfyWLjY1Q8JdZnQVDRgw2izMibbiYoX0ZUaaQhuGN8bDt3JVC0mqHPGR9h0Q JyhA== 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=Q4anF8oOLK4/R1JkZpAdRLX2fOO8H0yPpy1n10advYo=; b=fPS843lRTW5ssXCUZbIfqcpkt4H2EU+3M6F2IZmqIzvQ2PTEmv9h/ebLKbkiZpMvuG qfwqttw1oxbHLyplRCNejwXPdlOZzaMaN/mp1fBg5jVP6lTnRntlNzMpqlQju/zVfri2 EnCGYNV/ls38wNmysa8atpNV9hE3L+/EGnw1c23c67Sk3zi1QnnzNpYOwJay2QbSuZGc qdCDYo3tUmtx867cGVS7gnHEoE1GHBh9w55OZD16vR6zDi6jX7X0qCYBGUUV3v28OKZ9 RtyxyEPQoeJ/SAKiMJB4fX+ZZ1v5VQ/jhQOUq/MnIcYBgfXc548C/59rS53+9CdOIqSR QQMw== 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 oz19si2399865ejb.202.2020.07.29.21.20.42; Wed, 29 Jul 2020 21:21:04 -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 S1728517AbgG3ERz (ORCPT + 99 others); Thu, 30 Jul 2020 00:17:55 -0400 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:17855 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726519AbgG3ERy (ORCPT ); Thu, 30 Jul 2020 00:17:54 -0400 X-Greylist: delayed 427 seconds by postgrey-1.27 at vger.kernel.org; Thu, 30 Jul 2020 00:17:51 EDT IronPort-SDR: 9RkskvAB+kmOMTzUUrB64G94GReK7PVV/xTEmOO9zTNZlEqjwzEq0SxaOO1XPrtiy7NG3oxFp0 gh/nopnq5JsZA+8WhLQdrP2r23TOeEWRvnnOR0k8IfgxmXmYVbHJmTAuy3QwOib7iXUrkkHu7x z1gZjMM63+ppga4PGoac5V8swoCyWv9Rk+twgbE3II2eQtbpZiJGPAqNU+k84tGRlwcov0URqz dVnQulXmfYELIc/pqAmLD9UnrUd8f1BLO9LTfTw8xlXqARTL7aX1BC27IoJ0jg891AGsh/L3cw ieU= X-IronPort-AV: E=Sophos;i="5.75,413,1589270400"; d="scan'208";a="51442063" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 29 Jul 2020 20:10:47 -0800 IronPort-SDR: bn2vMB281lyjinmdybJm5jGUzYfE01QrphUEyh+X1wmn8Sdo/v2NHC3LYdOcCBoMjeJOhYYC8a 6HyWqFJbrbbgDMvWbO5Jds4vz5Rqi10etKx15xuoMMqOMrFbxm30qOtazB77iuHQFV9lKSbixP R6vV+hIj8zviIjeR9OCbZ/G54ruOJw5mG4Ch3ld8KSyp69Hgqb2dqOflGg27D5sGYqK58QkRiL 1mUQjNJ3F04BcOt7gq3DQbfe6RnE2X65qYt4NiIRDv4zoTS9qXmJxKjgdXY2N35KXRNvDySYeZ ROE= From: Jiada Wang To: , CC: , , , , , Subject: [PATCH 2/2] Input: atmel_mxt_ts - output status from T42 Touch Suppression Date: Thu, 30 Jul 2020 13:10:39 +0900 Message-ID: <20200730041039.7646-2-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730041039.7646-1-jiada_wang@mentor.com> References: <20200730041039.7646-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 outputs status from T42 touch suppression Signed-off-by: Nick Dyer Acked-by: Benson Leung Acked-by: Yufeng Shen (cherry picked from ndyer/linux/for-upstream commit ab95b5a309999d2c098daaa9f88d9fcfae7eb516) Signed-off-by: George G. Davis [jiada: Replace dev_info() with dev_dbg(), Move logical continuation to previous line to address checkpatch CHECK] Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 729c8dcb9cd1..b260f8c70c11 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -160,6 +160,9 @@ struct t37_debug { #define MXT_T48_MSG_NOISESUP_STATCHG BIT(4) #define MXT_T48_MSG_NOISESUP_NLVLCHG BIT(5) +/* Define for MXT_PROCI_TOUCHSUPPRESSION_T42 */ +#define MXT_T42_MSG_TCHSUP BIT(0) + /* T100 Multiple Touch Touchscreen */ #define MXT_T100_CTRL 0 #define MXT_T100_CFG1 1 @@ -326,6 +329,8 @@ struct mxt_data { u8 T9_reportid_min; u8 T9_reportid_max; u8 T19_reportid; + u8 T42_reportid_min; + u8 T42_reportid_max; u16 T44_address; u8 T48_reportid; u8 T100_reportid_min; @@ -960,6 +965,17 @@ static void mxt_proc_t100_message(struct mxt_data *data, u8 *message) data->update_input = true; } +static void mxt_proc_t42_messages(struct mxt_data *data, u8 *msg) +{ + struct device *dev = &data->client->dev; + u8 status = msg[1]; + + if (status & MXT_T42_MSG_TCHSUP) + dev_dbg(dev, "T42 suppress\n"); + else + dev_dbg(dev, "T42 normal\n"); +} + static int mxt_proc_t48_messages(struct mxt_data *data, u8 *msg) { struct device *dev = &data->client->dev; @@ -987,6 +1003,9 @@ static int mxt_proc_message(struct mxt_data *data, u8 *message) if (report_id == data->T6_reportid) { mxt_proc_t6_messages(data, message); + } else if (report_id >= data->T42_reportid_min && + report_id <= data->T42_reportid_max) { + mxt_proc_t42_messages(data, message); } else if (report_id == data->T48_reportid) { mxt_proc_t48_messages(data, message); } else if (!data->input_dev) { @@ -1633,6 +1652,8 @@ static void mxt_free_object_table(struct mxt_data *data) data->T9_reportid_min = 0; data->T9_reportid_max = 0; data->T19_reportid = 0; + data->T42_reportid_min = 0; + data->T42_reportid_max = 0; data->T44_address = 0; data->T48_reportid = 0; data->T100_reportid_min = 0; @@ -1707,6 +1728,10 @@ static int mxt_parse_object_table(struct mxt_data *data, object->num_report_ids - 1; data->num_touchids = object->num_report_ids; break; + case MXT_PROCI_TOUCHSUPPRESSION_T42: + data->T42_reportid_min = min_id; + data->T42_reportid_max = max_id; + break; case MXT_SPT_MESSAGECOUNT_T44: data->T44_address = object->start_address; break; -- 2.17.1