From patchwork Wed Nov 6 07:01:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11229507 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 D6FBA1575 for ; Wed, 6 Nov 2019 07:05:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5493217F4 for ; Wed, 6 Nov 2019 07:05:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731348AbfKFHCR (ORCPT ); Wed, 6 Nov 2019 02:02:17 -0500 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:22383 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726772AbfKFHCR (ORCPT ); Wed, 6 Nov 2019 02:02:17 -0500 IronPort-SDR: Z7D48N2N7OolbdDc4bQ+ARKmjc31ovAmEmWmroXrpgOGTHQvVkEQXYm31P5UkUwYa9Wn9W+lAg a4iLOx1sqZK9geHrdaMCsaGVIxiZAY+1KgMuCbbCt3GNl422PXy9GPWrnZEm1rmqKOBmYN72AO Jqmic6K1iR0T6TeklkfZh/3LRi1LBIRHBuBHy5lNa2pPXbfhcUN9NX2lDVeZ7CTw5Qk+zhJIam VcTyZ/emaDDYvKzn57JEj5RWrreKoh4dqrhDMcVyFEDXUY4E17BTxfSgO+8BCypmZTi18La3nf VMA= X-IronPort-AV: E=Sophos;i="5.68,272,1569312000"; d="scan'208";a="42848231" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 05 Nov 2019 23:02:16 -0800 IronPort-SDR: yGB/Lc6cZJ/EqbnUCPEqs/zJOgeYjZsTZTaf3A+zBrPHYjFOEEsjjqGdDuEABN13dpr2XIX56+ d1Rypph9Z0bRYlyUJvGgf7gTPDbJRR0NzPhdcIadVJMJjUy62lEtvrNW3PCirpWoG8U2RaLyPl +dWhYzz4RX+UCMPSYvqR378YMP748edyAsOZkcxtyF3jq/vN4s0Ie7wj2fGiOCTcHqVaXJVhXq iMmnUjBN4V4lymgdJrUfu5Rhq56VqZEn3+rkbAgr8uB38xsinMsBwGS57y5ptjV8tfFKVcH5tU Pwo= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v5 06/48] Input: atmel_mxt_ts - output status from T42 Touch Suppression Date: Wed, 6 Nov 2019 16:01:04 +0900 Message-ID: <20191106070146.18759-7-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106070146.18759-1-jiada_wang@mentor.com> References: <20191106070146.18759-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 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 41a69ec5395a..4e0dae004927 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;