Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5afdb009 authored by Amy Maloche's avatar Amy Maloche Committed by Abinaya P
Browse files

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.

This patch is a propagated patch from 3.4 kernel
commit - d25bd8cb1b354ce33ecbc2cb5deb61c39a081823,
input: synaptics_fw_update: Add sysfs entry to expose Config ID

Change-Id: Iaa66ff8e328d0480d2e4ce4fc0d9f57434dc7b86
Signed-off-by: default avatarAmy Maloche <amaloche@codeaurora.org>
parent 65bdd3d2
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -135,6 +135,9 @@ static ssize_t fwu_sysfs_bl_config_block_count_show(struct device *dev,
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 @@ static struct device_attribute attrs[] = {
	__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;
@@ -1519,6 +1525,20 @@ static ssize_t fwu_sysfs_disp_config_block_count_show(struct device *dev,
	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)
{