Loading drivers/input/touchscreen/synaptics_dsx/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -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 Loading drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_fw_update.c +25 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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, Loading Loading @@ -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", Loading @@ -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), Loading Loading @@ -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) Loading Loading @@ -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; Loading @@ -3077,6 +3087,7 @@ static int fwu_check_pm_configuration_size(void) return 0; } #endif static int fwu_check_bl_configuration_size(void) { Loading Loading @@ -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; Loading @@ -3469,6 +3481,7 @@ static int fwu_write_tddi_lockdown_data(void) return 0; } #endif #endif static int fwu_write_flash_configuration(void) { Loading Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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; Loading Loading @@ -4339,6 +4355,7 @@ static int fwu_start_write_config(void) return retval; } #endif static int fwu_start_reflash(void) { Loading Loading @@ -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) Loading Loading @@ -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) { Loading Loading @@ -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) { Loading @@ -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, Loading @@ -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); Loading Loading @@ -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); Loading Loading
drivers/input/touchscreen/synaptics_dsx/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_fw_update.c +25 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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, Loading Loading @@ -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", Loading @@ -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), Loading Loading @@ -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) Loading Loading @@ -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; Loading @@ -3077,6 +3087,7 @@ static int fwu_check_pm_configuration_size(void) return 0; } #endif static int fwu_check_bl_configuration_size(void) { Loading Loading @@ -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; Loading @@ -3469,6 +3481,7 @@ static int fwu_write_tddi_lockdown_data(void) return 0; } #endif #endif static int fwu_write_flash_configuration(void) { Loading Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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; Loading Loading @@ -4339,6 +4355,7 @@ static int fwu_start_write_config(void) return retval; } #endif static int fwu_start_reflash(void) { Loading Loading @@ -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) Loading Loading @@ -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) { Loading Loading @@ -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) { Loading @@ -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, Loading @@ -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); Loading Loading @@ -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); Loading