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

Commit b12c0274 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "input: touchscreen: synaptics_dsx: Remove fw_update sysfs entries"

parents 0fb96900 c263f2b5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -59,6 +59,16 @@ config TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE
	  To compile this driver as a module, choose M here: the
	  module will be called synaptics_dsx_fw_update.

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

	  If unsure, say N.

config TOUCHSCREEN_SYNAPTICS_DSX_TEST_REPORTING
	tristate "Synaptics DSX test reporting module"
	depends on TOUCHSCREEN_SYNAPTICS_DSX_CORE
+25 −0
Original line number Diff line number Diff line
@@ -137,6 +137,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);
@@ -201,6 +202,8 @@ static ssize_t fwu_sysfs_read_lockdown_code_show(struct device *dev,
		struct device_attribute *attr, char *buf);
#endif

#endif

enum f34_version {
	F34_V0 = 0,
	F34_V1,
@@ -757,6 +760,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",
@@ -766,8 +770,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, 0220,
			synaptics_rmi4_show_error,
			fwu_sysfs_do_recovery_store),
@@ -821,13 +827,16 @@ static struct device_attribute attrs[] = {
			fwu_sysfs_read_lockdown_code_show,
			fwu_sysfs_write_lockdown_code_store),
#endif
#endif
};

static struct synaptics_rmi4_fwu_handle *fwu;

DECLARE_COMPLETION(fwu_remove_complete);

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
DEFINE_MUTEX(fwu_sysfs_mutex);
#endif

static void calculate_checksum(unsigned short *data, unsigned long len,
		unsigned long *result)
@@ -3061,6 +3070,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;
@@ -3077,6 +3087,7 @@ static int fwu_check_pm_configuration_size(void)

	return 0;
}
#endif

static int fwu_check_bl_configuration_size(void)
{
@@ -3444,6 +3455,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;
@@ -3469,6 +3481,7 @@ static int fwu_write_tddi_lockdown_data(void)
	return 0;
}
#endif
#endif

static int fwu_write_flash_configuration(void)
{
@@ -3757,6 +3770,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;
@@ -3984,6 +3998,7 @@ int set_tddi_lockdown_data(unsigned char *lockdown_data, unsigned short leng)
	return retval;
}
#endif
#endif

static int fwu_do_lockdown_v7(void)
{
@@ -4134,6 +4149,7 @@ static int fwu_do_restore_f51_cal_data(void)
}
#endif

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
static int fwu_start_write_guest_code(void)
{
	int retval;
@@ -4339,6 +4355,7 @@ static int fwu_start_write_config(void)

	return retval;
}
#endif

static int fwu_start_reflash(void)
{
@@ -4970,6 +4987,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)
@@ -5566,6 +5584,7 @@ static ssize_t fwu_sysfs_write_lockdown_code_store(struct device *dev,
	return count;
}
#endif
#endif
static void synaptics_rmi4_fwu_attn(struct synaptics_rmi4_data *rmi4_data,
		unsigned char intr_mask)
{
@@ -5668,6 +5687,7 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
	if (ENABLE_SYS_REFLASH == false)
		return 0;

#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) {
@@ -5676,6 +5696,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,
@@ -5697,7 +5718,9 @@ static int synaptics_rmi4_fwu_init(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

exit_free_mem:
	kfree(fwu->image_name);
@@ -5739,7 +5762,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

exit:
	complete(&fwu_remove_complete);