Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3364663ybb; Tue, 31 Mar 2020 03:52:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu4bUtCC4eondyYi08fbnzmYeDoCclQ+JLSuEBFUFtuCXbJJtZoG6omZUfesFSgicKqc647 X-Received: by 2002:a9d:c61:: with SMTP id 88mr12877602otr.144.1585651928905; Tue, 31 Mar 2020 03:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585651928; cv=none; d=google.com; s=arc-20160816; b=WRGy7l5BnvToCFumlspIfv2oCOB22i6ak0Ea1dY1iedDQGfYJkhxSoD8c7Q/MtqZ8s 3fRHQ8pJ1mnK0kOMkij3/9JbJrl+fdfAGW/7HhZzD3QVK7Rdyz/5AknI7zVxpOWL5CnN +DK1ZX/rqg+86ZrZKve+vzgKqNLZantJftgq5BFKFn1J4PapeaYGIi2maVduMyk85kN9 lDAYIEyBUvosHGGTKMtFUZJrOrgCEjmahb8W0SEEy1Yv6QNYZHxTAjHD3JWgf+31LTCE A5mATLd3yvXb2J65ZfMRUTW4PVVW1XRobicowL1tOcE/l5GnGmCl1exaSoKXBOh6CBDu cmpA== 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=LHcJ0apwcmUnk9TmssbBQmYacz1bBfipEkKo0c0mlp/KsJYkNQ1vy8WCoVOUSPiGtI 0UsvxyxxtEDAm/E+1JZOOMgqrcIEmKE9DXuVIgHkvj20ROAXbDn6KllJocELpGTAscfz 3lz/O0WhvoMzpZBEZjNbNP3m0W/vcP14mkw2DEFYvNeyqjnKRKrufnbsIHdOIUO+7nk7 5v8LMgG27Km416fw/vnyggrNqfvFg9H37z6fruA3B0Z1navU9pxCaqZhRjhrsgwH6BoL AtVKLXfViFKtOcg/iYha28iVFy9XPrY/+cm3rmyPYRZqQSznRq0m0hKhXgMmnWothtDg lzHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a206si6672154oii.132.2020.03.31.03.51.57; Tue, 31 Mar 2020 03:52:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730561AbgCaKvX (ORCPT + 99 others); Tue, 31 Mar 2020 06:51:23 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:43515 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730424AbgCaKvU (ORCPT ); Tue, 31 Mar 2020 06:51:20 -0400 IronPort-SDR: 4rVpxID+bA2mfJoVXMtBTbdg3O4QRfjHEoJcEhUVP7p1My5NfDA8fXfsBcPDdRT2gZr3UGEnPQ /mwR9g1LX7rojL/XViRyJpgOCboI3uDxdVnbiyNSVjvgYpGY+q+h5n0yRf7f2i+ewge/RuRLJ1 MhZRfx+F7D6uIeZTw1jpXQRw49GtEt309vq/13aFQVmOQ+6WzBcxF7LLONTl6nM1Z+veYIoi73 hZaWBsX2+BOGgfwfuuKUAzuJKgR90pgM+t6nmYde1HrQEP8jvxDtBZe9Z8FaTvuksGSXt8AyMJ P10= X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="47330725" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 31 Mar 2020 02:51:20 -0800 IronPort-SDR: RZ+I+4MxsrXODsWjEBP1HPOY9RNdGXxeapsC1ki+zerD5OuzBG1IndRVXF4b6ajHOomLFxQeeN EHiysL6i0EEGw0Mub9nKRcrEnL6B6VHbi7oCnCUsq2lFg3X/khlRYR2d/SoUdzhWgxXdicVFPz fd5uHGeExe4fP7RJnB7uxf/tmPQ4fbYZwFX6fGtnRfjWlCwi9RWlXJJ7oeTydRMYmoL/7/VDMo HifUM8yQkT4AFQ3MaKDiJ3UnuFddIZaXLoeE2BRSI7B6Cr6jbu/cWgKix9Akhy+bUUDInRmC0i 1QY= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v10 06/55] Input: atmel_mxt_ts - output status from T42 Touch Suppression Date: Tue, 31 Mar 2020 03:50:02 -0700 Message-ID: <20200331105051.58896-7-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200331105051.58896-1-jiada_wang@mentor.com> References: <20200331105051.58896-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