Loading drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_fw_update.c +24 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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, Loading Loading @@ -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", Loading @@ -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), Loading Loading @@ -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; Loading Loading @@ -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; Loading @@ -2626,6 +2633,7 @@ static int fwu_check_pm_configuration_size(void) return 0; } #endif static int fwu_check_bl_configuration_size(void) { Loading Loading @@ -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; Loading @@ -2834,6 +2843,7 @@ static int fwu_write_pm_configuration(void) return fwu_write_configuration(); } #endif static int fwu_write_flash_configuration(void) { Loading Loading @@ -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; Loading Loading @@ -3118,6 +3129,7 @@ exit: return retval; } #endif static int fwu_do_lockdown_v7(void) { Loading Loading @@ -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; Loading Loading @@ -3397,6 +3410,7 @@ exit: return retval; } #endif static int fwu_start_reflash(void) { Loading Loading @@ -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; Loading Loading @@ -3791,6 +3806,7 @@ exit: return retval; } #endif int synaptics_fw_updater(const unsigned char *fw_data) { Loading Loading @@ -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) Loading Loading @@ -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) Loading Loading @@ -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) { Loading @@ -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, Loading Loading @@ -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); Loading Loading @@ -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); Loading Loading
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_fw_update.c +24 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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, Loading Loading @@ -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", Loading @@ -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), Loading Loading @@ -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; Loading Loading @@ -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; Loading @@ -2626,6 +2633,7 @@ static int fwu_check_pm_configuration_size(void) return 0; } #endif static int fwu_check_bl_configuration_size(void) { Loading Loading @@ -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; Loading @@ -2834,6 +2843,7 @@ static int fwu_write_pm_configuration(void) return fwu_write_configuration(); } #endif static int fwu_write_flash_configuration(void) { Loading Loading @@ -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; Loading Loading @@ -3118,6 +3129,7 @@ exit: return retval; } #endif static int fwu_do_lockdown_v7(void) { Loading Loading @@ -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; Loading Loading @@ -3397,6 +3410,7 @@ exit: return retval; } #endif static int fwu_start_reflash(void) { Loading Loading @@ -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; Loading Loading @@ -3791,6 +3806,7 @@ exit: return retval; } #endif int synaptics_fw_updater(const unsigned char *fw_data) { Loading Loading @@ -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) Loading Loading @@ -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) Loading Loading @@ -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) { Loading @@ -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, Loading Loading @@ -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); Loading Loading @@ -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); Loading