Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1366828ybj; Thu, 7 May 2020 22:59:25 -0700 (PDT) X-Google-Smtp-Source: APiQypJQijA1eVpkS/oGaftPKNRaEzdrMBsy/nlHjFohSjjc2s+ccjHV8QwPIAQ96Bj+vIVHpm4P X-Received: by 2002:a17:906:1393:: with SMTP id f19mr499044ejc.26.1588917565012; Thu, 07 May 2020 22:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588917565; cv=none; d=google.com; s=arc-20160816; b=Hf4p5bb0VXQbfu6SZhmxju1/qj4wqHqvajdVzPMNjQ214wse3VFUuZeudQ4+PqFRME 6vvGo++HrOCJQEY8Swuh6QwD69td3UbQL4B8b6yPPAsUqTPnTGzSA45Wb+NCw11RJp9X 9BfqXJw0nHFT2Hpjs9wKX8DSAZCdF0MCnbvl/9X5sa8DYjTl6ErhubvwJF3PnLU1l6Jg VV1EssmV5DJthO90rTUnt8+5hFWJZ78BrGD6SNSg2IjMflDQgAl9f1kQo9zIvsUMF+bn iRhbkK9N7OlASEeqfXrkM5rzY6FmlcspGDWEuA3nG1Nr4CnB4jH7POmCWWCRxmRWrTmJ E9HA== 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=tgi0z0yycjNoPzAqpby4i4MIbqsZqokFaU8ZsORHjR8=; b=d1sX0JI4f04bB9HJr1u9B3MUsD8qAKboz3H7/1Q0jTrQZJdsniRiALNiwGTyVj8R2D DiBkMybohwZCobgMSUeVsauGAjMoGn4MAhoI7xi3jFFwu8bjz5zc+Nng9B/xe4wggO7K LHDCK/CPe27JQ0PobcUI6LTz8WdshTJekLkNnu1A4GXVqdfFK90j0aAk+ebRvLZl9ZWg yUIVthv7Xbdr2Q6r29KA+d7W5940AU1hfVjcsejJboj9yJZ69BtM8FN6Rdg332QtGl0w FOYT70wQvVJifHQqPjLnBYoJFVg0VoKBiiFho0VZQCC7hRA/Lbk6VwbfmgVDnC0Laz5x 3qmQ== 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 e7si340827ejq.15.2020.05.07.22.59.02; Thu, 07 May 2020 22:59:24 -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 S1727032AbgEHF50 (ORCPT + 99 others); Fri, 8 May 2020 01:57:26 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:38659 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbgEHF50 (ORCPT ); Fri, 8 May 2020 01:57:26 -0400 IronPort-SDR: 2da9ZufG6x6cSHPWxOkyQUMM4gqMot08r5lkfrV0eJEvQnQUXcaGUkX6MbOYHhSSk4YHoQ0nEx c3ZsC/wPygCfLvZLyEnXESsXdEx8LiaKihDkxtc3FKFzCbz4V4teTFgAJXw/Z32iZGTndPOOYj aIFP1b2lEdGKj+WiIFEXbnEJSDG1qsBFGOZ4ZYlR04M5tjPCmJmRjOLsmGj/YNTYZ13FYGKGBY SwNN3nzUeDUr6Vj/YJzu58Q0x79rBnp2J+JZb+uK+mPb8TUYXsrVZ9fU/nImLhvJBP0DdnVfNI Iv0= X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="50670046" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 07 May 2020 21:57:24 -0800 IronPort-SDR: jOqvN7yEMsw/9CRkF+DqvM1oXhbwYkxrjI7AJVGNOf3xrGIcTvRjhx5N6sg4cXRYo8ROvcyeTT +mE4c/8JzH+r3GPo95PSo08hqQg3FmOtpFBLHXqWBf65wc4tl4oEMTN9btgw6DZfjOuTQu2Eky D8e9fP9dLzauqc7HT75gsrlwPoaI9ip3ZZEYQIz0V8XGSPskmDcU1yM5CxaE02CrVcXGvWCWjv Gn5qTBZ++oMBzKO6g5b3tcekz+0Ect0MR8IHQs2G5fUzx3gztWlTyGLOhn4PY1dkgURDXbelxL fgA= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v11 06/56] Input: atmel_mxt_ts - output status from T42 Touch Suppression Date: Thu, 7 May 2020 22:56:06 -0700 Message-ID: <20200508055656.96389-7-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 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()] 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 a53985a7736f..f6465edaa57e 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -155,6 +155,9 @@ struct t37_debug { #define MXT_RESET_VALUE 0x01 #define MXT_BACKUP_VALUE 0x55 +/* 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 @@ -323,6 +326,8 @@ struct mxt_data { u8 T9_reportid_max; u16 T18_address; u8 T19_reportid; + u8 T42_reportid_min; + u8 T42_reportid_max; u16 T44_address; u8 T48_reportid; u8 T100_reportid_min; @@ -979,6 +984,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; @@ -1006,6 +1022,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) { @@ -1686,6 +1705,8 @@ static void mxt_free_object_table(struct mxt_data *data) data->T9_reportid_max = 0; data->T18_address = 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; @@ -1763,6 +1784,10 @@ static int mxt_parse_object_table(struct mxt_data *data, case MXT_SPT_COMMSCONFIG_T18: data->T18_address = object->start_address; 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