Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp624549ybb; Wed, 25 Mar 2020 06:36:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vteNf3VBLpb6AmnyEcyfBDPd/t3jB1wI5SfXHrSKM8md9YC65PqW0feaXl3pzl5NNtHd2F2 X-Received: by 2002:a4a:6842:: with SMTP id a2mr1233409oof.42.1585143381934; Wed, 25 Mar 2020 06:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585143381; cv=none; d=google.com; s=arc-20160816; b=okoCXof00FxoPx9UTGHrIrXk/riFM1FLjNjooscyk0YGfKRkhm9RmZT5dt6BhZKRwz 304U8vzQGht88duIT+Ul/ptoaVYxY93ERJGLH5CsC9A7uvUi5fvXNszETS8PXDchdi3G I6lt5mlHppvMT1iA8btouIl7/YTgAgBfcy+v+rN5V8f0F+sqzqrfovrYa2iyH5ZNMDzZ 2zfVDr1X2lyrefVYegoWjj4gJYSU87Gstd/YErPyDohQGd6BhEG8hc8JGREmuY22ZKP8 5mEPLMlvOJNvvUPi8BGobPb4AGzKGAeLRaCzrmeVbzKqtYYuSRqQaSK8aDqzn7QkiGhk /ZPw== 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=9ZD9hmm0eMLWMQPzAxSsp2AILdfV1wXh6Z5u54PMz6A=; b=x976qtjXPWe4v59pKbVvAgPOVI33wrd7si6nlsgTBNFR3So+E9Mrzc0Jr0o5lQNGFm G79QOqQKUjAOo68CVCGDOxgjXGHkRvHhk13XC11vp06dqvPk3hW5WVoVn/CgphcTbcIV WGMYCvZ8vniHtZbgsvnr+RigAY2QyaIfVDM+5tjGvMBnG/GKsoJVbv3lEqP7NXmlWTVI W0P/x/FM2G8rTO1wisDixrEJRwIJIDnMCEB3LZ/5f2+JZnT4nFUNolmSOBFTfgku5bvV pm8PCDu7nseRkVmK2FVaqxqpS5AZFeydmA4pdaqg6caD2XvuwCcAzW/rxto9D4e0+mhR iTpg== 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 s5si9949079oie.153.2020.03.25.06.36.09; Wed, 25 Mar 2020 06:36:21 -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 S1727845AbgCYNfS (ORCPT + 99 others); Wed, 25 Mar 2020 09:35:18 -0400 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:53177 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbgCYNfR (ORCPT ); Wed, 25 Mar 2020 09:35:17 -0400 IronPort-SDR: hmVZ95EUR1bd4jFG43LVrAfX2UQzURZqy2WiPoNykKrKdo4x4yYpQZAMT/IMv5DyQiEyUGOlxz oCqCSlnZ1QQa0E7pf3SzLi2UtIaCyUemn+kV9GKzJ6TGGmT19i3TkUyyT9ri93emMru9LA2n2L 9RNbDfG/oPojkO0sfFN2Nf/EF1P27NqWafpqnr4GDIpBmY5dSlH9n6AVDfJRNE36DlS19O7OKX FzsYcyVp3YhfpfyPZTec/b0icsJrZRV4IunDpi1DHPNc71DTu37eUxn1QtKkzwWJOX+A686y/X 09A= X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="47099711" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 25 Mar 2020 05:35:16 -0800 IronPort-SDR: PfbfrQHd7zN653eNLd+FsAiuGKJm4OzT24pz3mGUSahLNk66jEH3JBPLtKYmk55FB1VyFZHvEK 6KScSgdy9t5oTAiQprEDfQe+qLLI4X/Q9nzK+uTELTy3ThYKZlfrzm5H7Gklm8f7MKI09gzP6U Ygoz0DqyVK0xjdwGHWi34pxmvmKTMvrWi3fVMOOSlAfg7+tr68kWHueAB7cCWxE4QLRGdWI+iW 7PrAGCMalX3HCkT0qMMmysOnyRKRLMjEoP29HZAy2rqt7XGfJNcaCf+GIWfhIftKIqc4pW7cII GjM= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v9 24/55] Input: atmel_mxt_ts - add config checksum attribute to sysfs Date: Wed, 25 Mar 2020 06:33:03 -0700 Message-ID: <20200325133334.19346-25-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200325133334.19346-1-jiada_wang@mentor.com> References: <20200325133334.19346-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 dfc20c0ca0a5..67931cf64629 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 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) @@ -3481,12 +3490,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