From patchwork Thu Mar 19 14:59:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 208076 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC5EEC4332D for ; Thu, 19 Mar 2020 15:00:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE85F2072D for ; Thu, 19 Mar 2020 15:00:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727842AbgCSPAs (ORCPT ); Thu, 19 Mar 2020 11:00:48 -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 S1727279AbgCSPAr (ORCPT ); Thu, 19 Mar 2020 11:00:47 -0400 IronPort-SDR: enNJyyVokVwnmQDg3IpZDe7jY0p7gSyg/fvmgRrK7OpwioHsorMSK6pDt4z9SPV9JHMYym7MSj TJevLncblTDf3MC4THTGaOgewG70HKHucTnk32fAVZPLhQ9ZmWbrQQQvFrKkNnFpourfeDOaxc y62jcdefPst/vchO3l5t1ZURD/FHtdOSm9eyNdJA54+y6i/ev9mB/eEW8bOIX1Kf0mCCNPWXSb k1K4CV90RlW9LsIlR7DpqDcb3392hlkSEoZaNRitqIlme7jGgU2t9xd5QEA8I8Xc1ZN9waWQy2 vd4= X-IronPort-AV: E=Sophos;i="5.70,572,1574150400"; d="scan'208";a="46818564" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 19 Mar 2020 07:00:45 -0800 IronPort-SDR: +31qAcOJ+d2j/zuoQeW+eja0Ow2nJN+Qu0wTNP5GgJQXSouupaK/Abq6oUIpEVjLK96O2dA7wW +dXW6+NZWDctReWK6OPPkaE+AfecfrwI4JcNJwUTWCRNAfOMnj4X6jANTwhsbOGCXvbGy8iJTO OsCdGv2eRjVitekeb0N7J5NpkRWzMfl8ZlyLk7tyB7+vK6EKev/ABAd41cgPe6xwCeKPnzA7bs U2vbqAjirNuc+FYfU00RPN0QA/jT9L2jkZOMMl/ZEi8avqkTtGHqTyD837LytOk8D8ibjkmjro Fg4= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v8 06/52] Input: atmel_mxt_ts - output status from T42 Touch Suppression Date: Thu, 19 Mar 2020 07:59:30 -0700 Message-ID: <20200319150016.61398-7-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 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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;