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

Commit fc64cb5b authored by Andrew Chant's avatar Andrew Chant Committed by Shantanu Jain
Browse files

input: touchscreen: synaptics_dsx_2.6: Remove fw_update sysfs entries

Remove the sysfs entrypoints to fw_update of synaptics_dsx_2.6
touch driver.

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


Signed-off-by: default avatarAndrew Chant <achant@google.com>
[shjain@codeaurora.org: kconfig change already cherry-picked
as part of commit 663f06e13d9e506af328e433c6904e45ef0d8410.]
Signed-off-by: default avatarShantanu Jain <shjain@codeaurora.org>
parent 8d0bafc0
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ static int fwu_do_reflash(void);

static int fwu_recovery_check_status(void);

#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);
@@ -179,6 +180,7 @@ static ssize_t fwu_sysfs_guest_code_block_count_show(struct device *dev,

static ssize_t fwu_sysfs_write_guest_code_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count);
#endif

enum f34_version {
	F34_V0 = 0,
@@ -650,6 +652,7 @@ struct synaptics_rmi4_fwu_handle {
	struct work_struct fwu_work;
};

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static struct bin_attribute dev_attr_data = {
	.attr = {
		.name = "data",
@@ -659,8 +662,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(dorecovery, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_do_recovery_store),
@@ -706,6 +711,7 @@ static struct device_attribute attrs[] = {
	__ATTR(writeguestcode, S_IWUSR | S_IWGRP,
			NULL,
			fwu_sysfs_write_guest_code_store),
#endif
};

static struct synaptics_rmi4_fwu_handle *fwu;
@@ -2610,6 +2616,7 @@ static int fwu_check_dp_configuration_size(void)
	return 0;
}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static int fwu_check_pm_configuration_size(void)
{
	unsigned short block_count;
@@ -2626,6 +2633,7 @@ static int fwu_check_pm_configuration_size(void)

	return 0;
}
#endif

static int fwu_check_bl_configuration_size(void)
{
@@ -2825,6 +2833,7 @@ static int fwu_write_dp_configuration(void)
	return fwu_write_configuration();
}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static int fwu_write_pm_configuration(void)
{
	fwu->config_area = PM_CONFIG_AREA;
@@ -2834,6 +2843,7 @@ static int fwu_write_pm_configuration(void)

	return fwu_write_configuration();
}
#endif

static int fwu_write_flash_configuration(void)
{
@@ -3041,6 +3051,7 @@ static int fwu_do_reflash(void)
	return retval;
}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static int fwu_do_read_config(void)
{
	int retval;
@@ -3118,6 +3129,7 @@ exit:

	return retval;
}
#endif

static int fwu_do_lockdown_v7(void)
{
@@ -3192,6 +3204,7 @@ static int fwu_do_lockdown_v5v6(void)
	return retval;
}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static int fwu_start_write_guest_code(void)
{
	int retval;
@@ -3397,6 +3410,7 @@ exit:

	return retval;
}
#endif

static int fwu_start_reflash(void)
{
@@ -3598,6 +3612,7 @@ static int fwu_recovery_check_status(void)
	return 0;
}

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static int fwu_recovery_erase_all(void)
{
	int retval;
@@ -3791,6 +3806,7 @@ exit:

	return retval;
}
#endif

int synaptics_fw_updater(const unsigned char *fw_data)
{
@@ -3849,6 +3865,7 @@ static void fwu_startup_fw_update_work(struct work_struct *work)
}
#endif

#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)
@@ -4220,6 +4237,7 @@ exit:
	fwu->image = NULL;
	return retval;
}
#endif

static void synaptics_rmi4_fwu_attn(struct synaptics_rmi4_data *rmi4_data,
		unsigned char intr_mask)
@@ -4304,6 +4322,7 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
	fwu->do_lockdown = DO_LOCKDOWN;
	fwu->initialized = true;

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
	retval = sysfs_create_bin_file(&rmi4_data->input_dev->dev.kobj,
			&dev_attr_data);
	if (retval < 0) {
@@ -4312,6 +4331,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->input_dev->dev.kobj,
@@ -4340,7 +4360,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->image_name);
@@ -4371,7 +4393,9 @@ static void synaptics_rmi4_fwu_remove(struct synaptics_rmi4_data *rmi4_data)
				&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

	kfree(fwu->read_config_buf);
	kfree(fwu->image_name);