input: synaptics_fw_update: Add sysfs entry to expose Config ID
Config ID is used to differentiate between different versions of
configuration data on the panel and is needed for debugging.
Change-Id: Iaa66ff8e328d0480d2e4ce4fc0d9f57434dc7b86
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
diff --git a/drivers/input/touchscreen/synaptics_fw_update.c b/drivers/input/touchscreen/synaptics_fw_update.c
index 3b20661..c447231 100644
--- a/drivers/input/touchscreen/synaptics_fw_update.c
+++ b/drivers/input/touchscreen/synaptics_fw_update.c
@@ -135,6 +135,9 @@
static ssize_t fwu_sysfs_disp_config_block_count_show(struct device *dev,
struct device_attribute *attr, char *buf);
+static ssize_t fwu_sysfs_config_id_show(struct device *dev,
+ struct device_attribute *attr, char *buf);
+
static int fwu_wait_for_idle(int timeout_ms);
struct image_header {
@@ -289,6 +292,9 @@
__ATTR(dispconfigblockcount, S_IRUGO,
fwu_sysfs_disp_config_block_count_show,
synaptics_rmi4_store_error),
+ __ATTR(config_id, S_IRUGO,
+ fwu_sysfs_config_id_show,
+ synaptics_rmi4_store_error),
};
static struct synaptics_rmi4_fwu_handle *fwu;
@@ -1520,6 +1526,20 @@
return snprintf(buf, PAGE_SIZE, "%u\n", fwu->disp_config_block_count);
}
+static ssize_t fwu_sysfs_config_id_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ unsigned char config_id[8];
+ /* device config id */
+ fwu->fn_ptr->read(fwu->rmi4_data,
+ fwu->f34_fd.ctrl_base_addr,
+ config_id,
+ sizeof(config_id));
+
+ return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n",
+ config_id[0], config_id[1], config_id[2], config_id[3]);
+}
+
static void synaptics_rmi4_fwu_attn(struct synaptics_rmi4_data *rmi4_data,
unsigned char intr_mask)
{