Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1367844ybj; Thu, 7 May 2020 23:01:03 -0700 (PDT) X-Google-Smtp-Source: APiQypJq5NRh5IiURHOY9toq3liNXHhycUlX4Ne2Jd1cEyUPCimgSZQ9yZYOLi4v87CfaahND9Az X-Received: by 2002:a05:6402:b3b:: with SMTP id bo27mr770600edb.115.1588917663719; Thu, 07 May 2020 23:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588917663; cv=none; d=google.com; s=arc-20160816; b=fCwBHjRP65FnSOKm5rL9LiXmZ9OIfAGnJE0aH+A/uo0yb3YAGoXvyXspth8TXrIiQS N+U+dzPA1rRq47CDKecCo8lngCd7myAZAeIx5K62DfpaqkqmAtulN+keLyGGfHT+UVzk 5f0JiJOqyue+5kRXhRqlacI6K5Zo1EuGnMcS4fTS1scVpDw2KHsTyDVHW37ty16rartF feeApUsqfySBkRrP0JKZIkOAaPV8IVUGLK3nbcJadKCifbnkCjZm0tSVrOEZiasKJMR7 bz5wsdUY5O6OScJkuGHluJorfFTqcKe/ojdvKL40t688ypbGD7bJQ5c3FW+Qn7QK06pz 3G2A== 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=yk6venjbGEsgJ/+WMZjM4HeG6+XdPhHgrizQL3ZKxhc=; b=zEWxwFAqCfh6x/KvkOov6IrTpYvc3YCqIOhVY5KhKxw4hwC4gjhKM8bFxcigZagrvN i0hsamBDwprw7U23rOnIIXh8iZTVGtA/BpHoUMCALsZ5VOBdALYAqY1Eqo0qsbRAkHkr /PpXCcbFzVsE1kK8cfIYb8HgZCC27jkOkuhv3ZLOOtfUyKDcXd3j+yrCovl+GQyZue8P ezIsUamlIO/sa0DoIGG3dAl+2uZ8SyKsRLX4Y0ETp52neUhpuYDnm1mA2S1DKAEZbaFX 3GvMVjxjoJ+kLcRP8xf6NlE4YW+mVK1HykSrHHSs7PCcVEsJHWd+rLfBKLqZ9TSpKCLc UpGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck5si385132ejb.12.2020.05.07.23.00.41; Thu, 07 May 2020 23:01:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727999AbgEHF6l (ORCPT + 99 others); Fri, 8 May 2020 01:58:41 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:38715 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbgEHF6h (ORCPT ); Fri, 8 May 2020 01:58:37 -0400 IronPort-SDR: k4w5bE0IfG/9q0oozAj0dg7WD4gOnWpnkfigWXICqFYbIxaUxLAZwRkbIRFGIG1hFU3re9zq2F tePF+0Ja51GQ/kthVrxNif6soi66qPSe8QNmQn4CkOim2PsFJ//TUhW2x4xfksoqMKIUSJulyz JJQGsS+01X58W6oe/mpidjFm2YRUxTeFNruzvxcpMrTqCgw07OPokIV9T5oDiHyOoc8HoOtmT4 TlZ2xRxHzDBBodGUMYcMWbj7fABPWn6nxSmusOQduUyLK/ZXVICo7F/qZw3ucwoA8uzXeb4myw v3A= X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="50670094" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 07 May 2020 21:58:35 -0800 IronPort-SDR: gaOKQOPg0wMl4YVGAFmvieHGkAxL/K4e31nEbZnhxMELlNVcA/PHCoQw3xnAxpVQ33+mOFNxOl qwOZFb6PMFRiUo3ZruP/yovJ4lbaJMF5bU3tFPIRE9f+yR3dZ5RWj6r+Nl9uT1ZvOGtxza+sVY ebRIZGGoGcszokmqRxuSsVi+qpwsPfK89OkNHpNCsVgLv6tz/FmieTo/WZRcygmcpHJZF2y63K 7TJdTElbWaoN0gDe0UwZgTpQuTgprnZcO9ZOaEMcxbQlKFMFjPQTgX8ZFDEqcwCxRxhVI9a80X A9g= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v11 25/56] Input: atmel_mxt_ts - add config checksum attribute to sysfs Date: Thu, 7 May 2020 22:56:25 -0700 Message-ID: <20200508055656.96389-26-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508055656.96389-1-jiada_wang@mentor.com> References: <20200508055656.96389-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: karl tsou Add config checksum attribute to sysfs Signed-off-by: karl tsou Signed-off-by: Nick Dyer (cherry picked from ndyer/linux/for-upstream commit 03477477ddbe5dcad42853ab3f84166a8f807acf) [gdavis: Forward port and fix conflicts.] Signed-off-by: George G. Davis [jiada: Add commit description Rename mxt_config_crc_show to config_crc_show Replace DEVICE_ATTR with DEVICE_ATTR_RO] Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index affd2bf32969..780850343089 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3124,6 +3124,15 @@ static int mxt_configure_objects(struct mxt_data *data, return error; } +/* Configuration crc check sum is returned as hex xxxxxx */ +static ssize_t config_crc_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct mxt_data *data = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%06x\n", data->config_crc); +} + /* Firmware Version is returned as Major.Minor.Build */ static ssize_t fw_version_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -3477,12 +3486,14 @@ static DEVICE_ATTR_RO(fw_version); static DEVICE_ATTR_RO(hw_version); static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL); static DEVICE_ATTR_WO(update_cfg); +static DEVICE_ATTR_RO(config_crc); static struct attribute *mxt_attrs[] = { &dev_attr_fw_version.attr, &dev_attr_hw_version.attr, &dev_attr_object.attr, &dev_attr_update_cfg.attr, + &dev_attr_config_crc.attr, NULL }; -- 2.17.1