Skip to content

Commit 0347747

Browse files
karl tsoundyer
authored andcommitted
Input: atmel_mxt_ts - add config checksum attribute to sysfs
Signed-off-by: Nick Dyer <[email protected]>
1 parent cbf94a7 commit 0347747

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,6 +2593,15 @@ static int mxt_configure_objects(struct mxt_data *data,
25932593
return error;
25942594
}
25952595

2596+
/* Configuration crc check sum is returned as hex xxxxxx */
2597+
static ssize_t mxt_config_crc_show(struct device *dev,
2598+
struct device_attribute *attr, char *buf)
2599+
{
2600+
struct mxt_data *data = dev_get_drvdata(dev);
2601+
2602+
return scnprintf(buf, PAGE_SIZE, "%06x\n", data->config_crc);
2603+
}
2604+
25962605
/* Firmware Version is returned as Major.Minor.Build */
25972606
static ssize_t mxt_fw_version_show(struct device *dev,
25982607
struct device_attribute *attr, char *buf)
@@ -2948,12 +2957,14 @@ static DEVICE_ATTR(fw_version, S_IRUGO, mxt_fw_version_show, NULL);
29482957
static DEVICE_ATTR(hw_version, S_IRUGO, mxt_hw_version_show, NULL);
29492958
static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL);
29502959
static DEVICE_ATTR(update_cfg, S_IWUSR, NULL, mxt_update_cfg_store);
2960+
static DEVICE_ATTR(config_crc, S_IRUGO, mxt_config_crc_show, NULL);
29512961

29522962
static struct attribute *mxt_attrs[] = {
29532963
&dev_attr_fw_version.attr,
29542964
&dev_attr_hw_version.attr,
29552965
&dev_attr_object.attr,
29562966
&dev_attr_update_cfg.attr,
2967+
&dev_attr_config_crc.attr,
29572968
NULL
29582969
};
29592970

0 commit comments

Comments
 (0)