[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200508055656.96389-26-jiada_wang@mentor.com>
Date: Thu, 7 May 2020 22:56:25 -0700
From: Jiada Wang <jiada_wang@...tor.com>
To: <nick@...anahar.org>, <dmitry.torokhov@...il.com>,
<jikos@...nel.org>, <benjamin.tissoires@...hat.com>,
<bsz@...ihalf.com>
CC: <linux-input@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<erosca@...adit-jv.com>, <Andrew_Gabbasov@...tor.com>,
<jiada_wang@...tor.com>
Subject: [PATCH v11 25/56] Input: atmel_mxt_ts - add config checksum attribute to sysfs
From: karl tsou <karl.funlab@...il.com>
Add config checksum attribute to sysfs
Signed-off-by: karl tsou <karl.funlab@...il.com>
Signed-off-by: Nick Dyer <nick.dyer@...ev.co.uk>
(cherry picked from ndyer/linux/for-upstream commit 03477477ddbe5dcad42853ab3f84166a8f807acf)
[gdavis: Forward port and fix conflicts.]
Signed-off-by: George G. Davis <george_davis@...tor.com>
[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 <jiada_wang@...tor.com>
---
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
Powered by blists - more mailing lists