Merge "input: touchscreen: synaptics_dsx: Remove fw_update sysfs entries"
This commit is contained in:
commit
49dae267db
2 changed files with 26 additions and 0 deletions
|
@ -1128,6 +1128,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 TOUCHSCREEN_ROHM_BU21023
|
||||
tristate "ROHM BU21023/24 Dual touch support resistive touchscreens"
|
||||
depends on I2C
|
||||
|
|
|
@ -102,6 +102,7 @@
|
|||
(fwu->config_data[2] == config_id[2]) && \
|
||||
(fwu->config_data[3] == config_id[3]))
|
||||
|
||||
#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);
|
||||
|
@ -157,6 +158,7 @@ static ssize_t fwu_sysfs_config_id_show(struct device *dev,
|
|||
|
||||
static ssize_t fwu_sysfs_package_id_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
#endif
|
||||
|
||||
enum bl_version {
|
||||
V5 = 5,
|
||||
|
@ -296,6 +298,7 @@ struct synaptics_rmi4_fwu_handle {
|
|||
struct synaptics_rmi4_data *rmi4_data;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
|
||||
static struct bin_attribute dev_attr_data = {
|
||||
.attr = {
|
||||
.name = "data",
|
||||
|
@ -305,9 +308,11 @@ 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(force_update_fw, S_IWUSR | S_IWGRP,
|
||||
NULL,
|
||||
fwu_sysfs_force_reflash_store),
|
||||
|
@ -353,6 +358,7 @@ static struct device_attribute attrs[] = {
|
|||
__ATTR(package_id, S_IRUGO,
|
||||
fwu_sysfs_package_id_show,
|
||||
synaptics_rmi4_store_error),
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct synaptics_rmi4_fwu_handle *fwu;
|
||||
|
@ -1220,6 +1226,7 @@ write_config:
|
|||
return retval;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
|
||||
static int fwu_start_write_config(void)
|
||||
{
|
||||
int retval;
|
||||
|
@ -1395,6 +1402,7 @@ exit:
|
|||
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fwu_do_lockdown(void)
|
||||
{
|
||||
|
@ -1585,6 +1593,7 @@ int synaptics_dsx_fw_updater(unsigned char *fw_data)
|
|||
}
|
||||
EXPORT_SYMBOL(synaptics_dsx_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)
|
||||
|
@ -1972,6 +1981,7 @@ static ssize_t fwu_sysfs_package_id_show(struct device *dev,
|
|||
(package_id[1] << 8) | package_id[0],
|
||||
(package_id[3] << 8) | package_id[2]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void synaptics_rmi4_fwu_attn(struct synaptics_rmi4_data *rmi4_data,
|
||||
unsigned char intr_mask)
|
||||
|
@ -2045,6 +2055,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) {
|
||||
|
@ -2053,6 +2064,7 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
|
|||
__func__);
|
||||
goto exit_free_fwu;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++) {
|
||||
retval = sysfs_create_file(&rmi4_data->input_dev->dev.kobj,
|
||||
|
@ -2074,7 +2086,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_fwu:
|
||||
kfree(fwu);
|
||||
|
@ -2096,7 +2110,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);
|
||||
|
|
Loading…
Add table
Reference in a new issue