Skip to content

Commit

Permalink
Input: atmel_mxt_ts - add config checksum attribute to sysfs
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
  • Loading branch information
karl tsou authored and ndyer committed Apr 26, 2016
1 parent cbf94a7 commit 0347747
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -2593,6 +2593,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)
Expand Down Expand Up @@ -2948,12 +2957,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
};

Expand Down

0 comments on commit 0347747

Please sign in to comment.