Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3364591ybb; Tue, 31 Mar 2020 03:52:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv6txvpXQEvmcB23lKcaMzaD/8TAAQs5uGIGYdXNOlTUPUDkEZnadaYjrtRUFzQ6lxfjb2s X-Received: by 2002:a54:4094:: with SMTP id i20mr1494636oii.141.1585651922355; Tue, 31 Mar 2020 03:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585651922; cv=none; d=google.com; s=arc-20160816; b=gosoPs24UcHgDDMlscgpoCLZzCBkQIcxeYVj2nMBrHJpb38KLKbeYqn50msfzfhs5i vyz+asQQ3YhDAeTtGpSHJQKRRkkP1W9MgYxtAjTGXRNiruZr/zkAfedGcvhguhPA/vsQ fwz2lBgnUn5Xi+R5jsePzOiarsrYK2rooomJSwTqWgrxoBhUDoDiP+4ENGYXrSJmmxL1 qVWZBmaFzj2WmCYt5vclwEEut5Hz+q3YSSotFloetuLAnLfm0tyxyg/0gtl8d0Ch3GHU 9z9yBo2gSYCutBWIygIw9b+CJJUERZmaFYm8OOfkWkxSK4gaZrlheGpYZDKAStSPnL3d Xn7w== 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=kLCbYMh/s4k5K1B/GvDFWaqbenmrTPm7fJfAz0imuGY=; b=CTVdL1PRozpYmIVq2z5H7FiXfUYw13aNdifXvRuswS3DliT0DRaKysv7RGdqSlh3O4 WM+0vaoveg3oczgCmSErXRyJFDCawVLTH2GhUELdPYy/UW8dD/f7mlZX6RR5wtpip+wt ToeaR/ZNo+03ZzScFBanhrMwkMyjvgqgU2NEvKbs0JUSU2u5a0zmORMnS1kpp0yBDsTt P475ZT9lD9mEV3TjQvQvbRwL/57L7OmLhI5pB5PaQtkepJKGM8d2ZG3VcAZToM2cM3l5 KumSVEQ1Lle1J3OIF5jDqi6Th6f98mXyiD1Gb41TigzRjlf7JPaMnCm05YnYx8tsagfS A8vg== 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 x189si7200529oia.270.2020.03.31.03.51.50; Tue, 31 Mar 2020 03:52:02 -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 S1730547AbgCaKvS (ORCPT + 99 others); Tue, 31 Mar 2020 06:51:18 -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 S1730424AbgCaKvQ (ORCPT ); Tue, 31 Mar 2020 06:51:16 -0400 IronPort-SDR: ekTQT4IZbqBQYC80HHO/OZuIDUZXtnPo0i4rR88oeJ8+2mqjgzzqs+72Ob07rjKL+cHRwfrjkd /4PB79WgEfO/32W8hboicLRIK10lTEoNuFpoJONNZnesVMCs05usYfH+oggzjWETzc2OVvQL8E sv9WLp2CfD2+js+8kUmto8pBO2cEycgvWdcgwwYxtAyp6lhj6fHYKv4W79jmFFsvt88TXoHFeL m/fp3+2Ep1GFNjRdJ7+ffSJqO3RD25b7Gc4bVrq8vVhiCGzSc5TsYfdWWqy0oSzUEWGwa8D8bd wJw= X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="47330722" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 31 Mar 2020 02:51:16 -0800 IronPort-SDR: E3vTCVqNcNWHEhN9CeT4d8n5Ar1bi2bmzATtIPDPUG8AfoMT5yTdlpTXtv3EG6n3HJ+pWicZWf epwg3IjTqICX3Y8U1j3W5vj+VhSPKm3gqeVEKpWruzYAXg5qZ8q0e/a2pPpkRrqbgaM83EHO/u GJXnRO1p89yxJrDGCDdG9nsQacO863/0SzKX5wyJV6XJnNXlEkNKz/+oB7VNT1Ic+UfEgr9P9h SNQZTaRLmuyoUR442XLbnHMI/7DCiqVOQf+7j7PSMFRgdxxPR7z+K93g9fXYdCXcKRpEXkRH83 g1U= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v10 05/55] Input: atmel_mxt_ts - output status from T48 Noise Supression Date: Tue, 31 Mar 2020 03:50:01 -0700 Message-ID: <20200331105051.58896-6-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 T48 Noise Supression Signed-off-by: Nick Dyer Acked-by: Benson Leung Acked-by: Yufeng Shen (cherry picked from ndyer/linux/for-upstream commit 2895a6ff150a49f27a02938f8d262be238b296d8) Signed-off-by: George G. Davis 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 7e6a66e3e1e0..a53985a7736f 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -324,6 +324,7 @@ struct mxt_data { u16 T18_address; u8 T19_reportid; u16 T44_address; + u8 T48_reportid; u8 T100_reportid_min; u8 T100_reportid_max; @@ -978,6 +979,24 @@ static void mxt_proc_t100_message(struct mxt_data *data, u8 *message) data->update_input = true; } +static int mxt_proc_t48_messages(struct mxt_data *data, u8 *msg) +{ + struct device *dev = &data->client->dev; + u8 status, state; + + status = msg[1]; + state = msg[4]; + + dev_dbg(dev, "T48 state %d status %02X %s%s%s%s%s\n", state, status, + status & 0x01 ? "FREQCHG " : "", + status & 0x02 ? "APXCHG " : "", + status & 0x04 ? "ALGOERR " : "", + status & 0x10 ? "STATCHG " : "", + status & 0x20 ? "NLVLCHG " : ""); + + return 0; +} + static int mxt_proc_message(struct mxt_data *data, u8 *message) { u8 report_id = message[0]; @@ -987,6 +1006,8 @@ 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->T48_reportid) { + mxt_proc_t48_messages(data, message); } else if (!data->input_dev) { /* * Do not report events if input device @@ -1666,6 +1687,7 @@ static void mxt_free_object_table(struct mxt_data *data) data->T18_address = 0; data->T19_reportid = 0; data->T44_address = 0; + data->T48_reportid = 0; data->T100_reportid_min = 0; data->T100_reportid_max = 0; data->max_reportid = 0; @@ -1747,6 +1769,9 @@ static int mxt_parse_object_table(struct mxt_data *data, case MXT_SPT_GPIOPWM_T19: data->T19_reportid = min_id; break; + case MXT_PROCG_NOISESUPPRESSION_T48: + data->T48_reportid = min_id; + break; case MXT_TOUCH_MULTITOUCHSCREEN_T100: data->multitouch = MXT_TOUCH_MULTITOUCHSCREEN_T100; data->T100_reportid_min = min_id; -- 2.17.1