From patchwork Tue Aug 27 06:26:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11116123 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE65D13B1 for ; Tue, 27 Aug 2019 06:27:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B731420828 for ; Tue, 27 Aug 2019 06:27:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728433AbfH0G1Q (ORCPT ); Tue, 27 Aug 2019 02:27:16 -0400 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:48109 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbfH0G1P (ORCPT ); Tue, 27 Aug 2019 02:27:15 -0400 IronPort-SDR: g2YduF0gjitfvOyG2ay52WuErGRPkR3oz9HErhZDvw9K1FVovhPJPhZ7JP7WKx8Sxith6D+M5c 5vIgGFK0qfal17dYDUBcB2iTMVflYDLPSGWdEs6LesZ7pa5tx3cA4rOK8ta3E2Ta0od+0jNx7l QCLCAeLykwfrF/ldwW+ggUo8sgrpJZbfHubTljlqeSRaafRokVbsmPrmK4QNfobWZUEcbb9b13 GY+x3PLaLFmSGsjysgceJ1BeY6CRZi0HTFnxHoTQ3YOzCvoRansto1b2gEOx9ddRZMbeqnZg5O Wm4= X-IronPort-AV: E=Sophos;i="5.64,436,1559548800"; d="scan'208";a="40784456" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 26 Aug 2019 22:27:13 -0800 IronPort-SDR: n2mKXPcs6M0YVvFT/PI1FUZ96FSgN13cAxCZ7nBmy81CAwk3cR9gmDE84FQS3q0p02DQMwadhn RCqYLo/MBTvFOb2YjXbtZpkWeAy1xGtzQ5svOgG8Fucu+KykIwZSPh3QS2Bo7wz0X7ukJCyvv/ RGvwvYTXbJya0qsy4V/8PZff7LVVMm4uWdczFL/Vzwt7O07HyVVgZ0BcEwlkFRiix8eitvztGC 9m2oWrKOBCtH/Qij2nPYyd2RdZsz4Ai1Jof0Omh/TmWQxhbLt3aLbSoKAm2xO3N6C1jkttS4ex qrc= From: Jiada Wang To: , CC: , , , Subject: [PATCH v2 07/49] Input: atmel_mxt_ts - output status from T42 Touch Suppression Date: Tue, 27 Aug 2019 15:26:32 +0900 Message-ID: <20190827062714.20266-3-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190827062714.20266-1-jiada_wang@mentor.com> References: <20190827062714.20266-1-jiada_wang@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-07.mgc.mentorg.com (147.34.90.207) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Nick Dyer 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 351347e2eced..19fa3e58269a 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;