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

Commit 69147b61 authored by Andrew Chant's avatar Andrew Chant Committed by Gerrit - the friendly Code Review server
Browse files

input: touchscreen: synaptics: Remove fw_update sysfs entries

Remove the sysfs entrypoints to fw_update of synaptics driver.

BUG: 32769717
Change-Id: I710cb37a8b5382dce7aa6a1d8748be5853a18a7a
Git-commit: 2615c5f302441568e6dd20007bc5246d72837e80
Git-repo: https://android.googlesource.com/kernel/msm.git


Signed-off-by: default avatarAndrew Chant <achant@google.com>
[shjain@codeaurora.org: picked those lines that are applying
cleanly to the driver. Some of the lines as per googlesource.com
git commit is not applying cleanly.]
Signed-off-by: default avatarShantanu Jain <shjain@codeaurora.org>
parent 8d0bafc0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -995,6 +995,16 @@ config TOUCHSCREEN_FT5X06_GESTURE

         If unsure, say N.

config TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
	bool "Synaptics DSX firmware update extra sysfs attributes"
	depends on TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE
	help
	  Say Y here to enable support for extra sysfs attributes
	  supporting firmware update in a development environment.
	  This does not affect the core or other subsystem attributes.

	  If unsure, say N.

config SECURE_TOUCH
	bool "Secure Touch"
	depends on (TOUCHSCREEN_SYNAPTICS_I2C_RMI4 || \
+16 −0
Original line number Diff line number Diff line
@@ -1305,6 +1305,7 @@ write_config:
	return retval;
}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static int fwu_start_write_config(void)
{
	int retval;
@@ -1357,6 +1358,7 @@ static int fwu_start_write_config(void)

	return retval;
}
#endif

static int fwu_do_write_lockdown(bool reset)
{
@@ -1404,6 +1406,7 @@ exit:
	return retval;
}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static int fwu_start_write_lockdown(void)
{
	if (parse_header())
@@ -1505,6 +1508,7 @@ static int fwu_do_read_config(void)
exit:
	return retval;
}
#endif

static int fwu_do_reflash(void)
{
@@ -1730,6 +1734,7 @@ int synaptics_fw_updater(void)
}
EXPORT_SYMBOL(synaptics_fw_updater);

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static ssize_t fwu_sysfs_show_image(struct file *data_file,
		struct kobject *kobj, struct bin_attribute *attributes,
		char *buf, loff_t pos, size_t count)
@@ -2154,6 +2159,7 @@ static ssize_t fwu_sysfs_package_id_show(struct device *dev,
		(pkg_id[1] << 8) | pkg_id[0],
		(pkg_id[3] << 8) | pkg_id[2]);
}
#endif

static int synaptics_rmi4_debug_dump_info(struct seq_file *m, void *v)
{
@@ -2187,6 +2193,7 @@ static void synaptics_rmi4_fwu_attn(struct synaptics_rmi4_data *rmi4_data,
	return;
}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static struct bin_attribute dev_attr_data = {
	.attr = {
		.name = "data",
@@ -2196,8 +2203,10 @@ static struct bin_attribute dev_attr_data = {
	.read = fwu_sysfs_show_image,
	.write = fwu_sysfs_store_image,
};
#endif

static struct device_attribute attrs[] = {
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
	__ATTR(fw_name, S_IRUGO | S_IWUSR | S_IWGRP,
			fwu_sysfs_image_name_show,
			fwu_sysfs_image_name_store),
@@ -2246,6 +2255,7 @@ static struct device_attribute attrs[] = {
	__ATTR(package_id, S_IRUGO,
			fwu_sysfs_package_id_show,
			synaptics_rmi4_store_error),
#endif
};


@@ -2325,6 +2335,7 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
	fwu->initialized = true;
	fwu->polling_mode = false;

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
	retval = sysfs_create_bin_file(&rmi4_data->i2c_client->dev.kobj,
			&dev_attr_data);
	if (retval < 0) {
@@ -2333,6 +2344,7 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
				__func__);
		goto exit_free_mem;
	}
#endif

	for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++) {
		retval = sysfs_create_file(&rmi4_data->i2c_client->dev.kobj,
@@ -2380,7 +2392,9 @@ exit_remove_attrs:
				&attrs[attr_count].attr);
	}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
	sysfs_remove_bin_file(&rmi4_data->input_dev->dev.kobj, &dev_attr_data);
#endif

exit_free_mem:
	kfree(fwu->fn_ptr);
@@ -2397,7 +2411,9 @@ static void synaptics_rmi4_fwu_remove(struct synaptics_rmi4_data *rmi4_data)
{
	unsigned char attr_count;

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
	sysfs_remove_bin_file(&rmi4_data->input_dev->dev.kobj, &dev_attr_data);
#endif

	for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++) {
		sysfs_remove_file(&rmi4_data->input_dev->dev.kobj,