Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp595397pja; Thu, 19 Mar 2020 08:03:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtJuzjqq8JCwFI9qTSrjNeJHCFj4R6jMgsX27p1ArFT/dsfiGn9AFM+90ARfZkZOFZMOQm3 X-Received: by 2002:a54:478d:: with SMTP id o13mr2745880oic.166.1584630217597; Thu, 19 Mar 2020 08:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584630217; cv=none; d=google.com; s=arc-20160816; b=uQPgBFF9Ri6wI3s1emDfWfzic4c3k2KZp7g3A+EO8uW0NRSFQboB+/vUoJHBWBdzfi heHXC3HCA9A7yAt/ToaxkMOlDxi+JM7av/igOoP8kAfn3ygv3PGRROxTvK4AKbv3fAkk LHMJISOC5H4rvs4l7BFiCLAXy8Tc3PVTxB0GgjKLOoqvYi8yZmG6EKYgrLKeOom/VK+a 8842Ry6XBCbgf1JsL96tL5Lq7t1t86tx8etFFVjVQjnLKMwG7hNImaB8STQiKO/6rkBS WrQDrSvisnhfmZ8yc799xk3cXa5ODmKZ+zdl5J8Ba0hWnl84KsAD9LlKXWXvOax85/YL OU3w== 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=GHCFa14hR/pDjAzQm/fGazb0aPE5A71Bl1w7MLE0QBM=; b=Xnxf+fm/86j4Ol7GEv1FTPeYesVNWuGWGi/klWrFl33wncs+jxJ2L4Iz8J0INTB7WP fI3iV2644XxJ7B/ijVIk4SIatn58/v0+abmGQU+ZKvc4HPmYz+g4J1CGAsiA2gBUt7mc tFphYiv5P6v5/LTMkQaCq3EaQPEFtImBVxkKEKZrL+MHu5UZw2sn3nN0AWj/7CaOQvju 9bakVG815c7dJblF73dBfo3sd/g2AtjDJFS4GgjE6BppHqL+OCiGpFkT3EzwKMsfJoCZ E/p/F2DH4GVuzl3kF+/yGaYl3C65rRq8X03TYQF90QjN4PXmUOPO1iOY7dkdzstpICac UBqA== 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 s199si1162395oih.169.2020.03.19.08.03.06; Thu, 19 Mar 2020 08:03:37 -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 S1728018AbgCSPBv (ORCPT + 99 others); Thu, 19 Mar 2020 11:01:51 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:16057 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727587AbgCSPBv (ORCPT ); Thu, 19 Mar 2020 11:01:51 -0400 IronPort-SDR: TNgvDA/KA46KYzSH5F2jb3EAU33a5W1Q+RTaPW6EdIcB59dPMeuH0sxMeN2Y4GJrrd7peXTKOC /g7mZrajPqWNAbMAKJVIEoTA/yBIDTBaC/okhNNXK2Vlr2mO3QeTL5XfgIEOmxmcq2BQqcPDrc 1NBuP8De3UysYhHURT4XGWkKRt88m2zq5Q6wRjlYvqd6ARaUe4K124FcKl+CuS/CvKE75RKNU/ n9mqtSrrbiK8Dn1/xWF7SC6gaZfRQPdlhX7EenKrUPUrHgtoMKnow9WaVCfO3fe4G2PP+pxWW2 0sw= X-IronPort-AV: E=Sophos;i="5.70,572,1574150400"; d="scan'208";a="48850273" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 19 Mar 2020 07:01:44 -0800 IronPort-SDR: GifHhdW9reHsOWogjSgcwZvkwmP2j3u57IFc+zwcZktN6TY/ZF53GcsTXew8owpgGEh54bcg2x pqr6Y1x5eXBTTihMFbUoRJqxJkGVpgJb9upEXMlcq+OKoa9o07Ny8mS5F9oriulCjOzngd75S7 fqxcrmsNRSjdztUypj1wPMEhu4+zN5azZ271UgFNp0AKEhVWxfJhBkgS48Z4sLQK0hqexQiyZN f7XhGGtxz2gS2+krkbFimkyjt+NmkTNRzlYsJTGaEDrt3DjytqZot7IQbm02Akz0oogQJ2SRhS +I0= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v8 21/52] Input: atmel_mxt_ts - add config checksum attribute to sysfs Date: Thu, 19 Mar 2020 07:59:45 -0700 Message-ID: <20200319150016.61398-22-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200319150016.61398-1-jiada_wang@mentor.com> References: <20200319150016.61398-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 Change Symbolic permissions 'S_IRUGO' to 0444] 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 c884c254ad2d..7441dc71bbab 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3128,6 +3128,15 @@ static int mxt_configure_objects(struct mxt_data *data, return error; } +/* Configuration crc check sum is returned as hex xxxxxx */ +static ssize_t mxt_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 mxt_fw_version_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -3481,12 +3490,14 @@ static DEVICE_ATTR(fw_version, S_IRUGO, mxt_fw_version_show, NULL); static DEVICE_ATTR(hw_version, S_IRUGO, mxt_hw_version_show, NULL); static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL); static DEVICE_ATTR(update_cfg, 0200, NULL, mxt_update_cfg_store); +static DEVICE_ATTR(config_crc, 0444, mxt_config_crc_show, NULL); 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