From: Jiada Wang <jiada_wang@mentor.com> To: <nick@shmanahar.org>, <dmitry.torokhov@gmail.com>, <jikos@kernel.org>, <benjamin.tissoires@redhat.com>, <rydberg@bitmath.org> Cc: <linux-input@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <jiada_wang@mentor.com> Subject: [PATCH v3 19/49] Input: atmel_mxt_ts - add config checksum attribute to sysfs Date: Tue, 17 Sep 2019 18:37:36 +0900 [thread overview] Message-ID: <20190917093806.18538-5-jiada_wang@mentor.com> (raw) In-Reply-To: <20190917093806.18538-1-jiada_wang@mentor.com> From: karl tsou <karl.funlab@gmail.com> Signed-off-by: Nick Dyer <nick.dyer@itdev.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@mentor.com> Signed-off-by: Jiada Wang <jiada_wang@mentor.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 f0522f4416dc..69e34294688c 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, S_IWUSR, NULL, mxt_update_cfg_store); +static DEVICE_ATTR(config_crc, S_IRUGO, 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.19.2
WARNING: multiple messages have this Message-ID (diff)
From: Jiada Wang <jiada_wang@mentor.com> To: nick@shmanahar.org, dmitry.torokhov@gmail.com, jikos@kernel.org, benjamin.tissoires@redhat.com, rydberg@bitmath.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, jiada_wang@mentor.com Subject: [PATCH v3 19/49] Input: atmel_mxt_ts - add config checksum attribute to sysfs Date: Tue, 17 Sep 2019 18:37:36 +0900 [thread overview] Message-ID: <20190917093806.18538-5-jiada_wang@mentor.com> (raw) In-Reply-To: <20190917093806.18538-1-jiada_wang@mentor.com> From: karl tsou <karl.funlab@gmail.com> Signed-off-by: Nick Dyer <nick.dyer@itdev.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@mentor.com> Signed-off-by: Jiada Wang <jiada_wang@mentor.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 f0522f4416dc..69e34294688c 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, S_IWUSR, NULL, mxt_update_cfg_store); +static DEVICE_ATTR(config_crc, S_IRUGO, 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.19.2
next prev parent reply other threads:[~2019-09-17 9:39 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-17 9:37 [PATCH v3 15/49] Input: atmel_mxt_ts - report failures in suspend/resume Jiada Wang 2019-09-17 9:37 ` Jiada Wang 2019-09-17 9:37 ` [PATCH v3 16/49] Input: atmel_mxt_ts - allow specification of firmware file name Jiada Wang 2019-09-17 9:37 ` Jiada Wang 2019-09-17 9:37 ` [PATCH v3 17/49] Input: atmel_mxt_ts - handle cfg filename via pdata/sysfs Jiada Wang 2019-09-17 9:37 ` Jiada Wang 2019-09-17 9:37 ` [PATCH v3 18/49] Input: atmel_mxt_ts - allow input name to be specified in platform data Jiada Wang 2019-09-17 9:37 ` Jiada Wang 2019-09-17 9:37 ` Jiada Wang [this message] 2019-09-17 9:37 ` [PATCH v3 19/49] Input: atmel_mxt_ts - add config checksum attribute to sysfs Jiada Wang
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190917093806.18538-5-jiada_wang@mentor.com \ --to=jiada_wang@mentor.com \ --cc=benjamin.tissoires@redhat.com \ --cc=dmitry.torokhov@gmail.com \ --cc=jikos@kernel.org \ --cc=linux-input@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=nick@shmanahar.org \ --cc=rydberg@bitmath.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.