{
I("%s:Entering!\n", __func__);
if (g_core_fp.fp_fw_ver_bin() == 0) {
- if (((ic_data->vendor_fw_ver < g_i_FW_VER) || (ic_data->vendor_config_ver < g_i_CFG_VER))) {
+ if (((ic_data->vendor_fw_ver != g_i_FW_VER) || (ic_data->vendor_config_ver != g_i_CFG_VER))) {
I("Need to update!\n");
return NO_ERR;
} else {
I("No need to update!\n");
+ private_ts->fw_upgrade_status = NO_ERR;
return 1;
}
} else {
goto update_retry;
} else {
result = -1;
+ private_ts->fw_upgrade_status = FW_NOT_READY;
} /*upgrade fail*/
} else {
g_core_fp.fp_read_FW_ver();
g_core_fp.fp_touch_information();
result = 1;/*upgrade success*/
+ private_ts->fw_upgrade_status = READY_TO_SERVE;
I("%s: TP upgrade OK\n", __func__);
}
E("%s: Flash command fail: %d\n", __func__, __LINE__);
break;
}
+ if (result == 0)
+ private_ts->fw_upgrade_status = FW_NOT_READY;
+ else
+ private_ts->fw_upgrade_status = READY_TO_SERVE;
+
release_firmware(fw);
g_core_fp.fp_read_FW_ver();
g_core_fp.fp_touch_information();
fw_update_complete = false;
break;
}
+ if (fw_update_complete != true)
+ private_ts->fw_upgrade_status = FW_NOT_READY;
+ else
+ private_ts->fw_upgrade_status = READY_TO_SERVE;
+
release_firmware(fw);
goto firmware_upgrade_done;
#endif
*/
}
+static ssize_t himax_fw_upgrade_read(struct file *file, char *buf,
+ size_t len, loff_t *pos)
+{
+ struct himax_ts_data *ts_data;
+ size_t ret = 0;
+ char *temp_buf;
+ ts_data = private_ts;
+
+ if (*pos != 0)
+ return 0;
+
+ temp_buf = kzalloc(len, GFP_KERNEL);
+ ret = snprintf(temp_buf + ret, len - ret, "%d\n", ts_data->fw_upgrade_status);
+ I("[%s][%d]read:%s\n", __func__, __LINE__, temp_buf);
+
+ if (copy_to_user(buf, temp_buf, len))
+ E("%s,here:%d\n", __func__, __LINE__);
+ *pos += ret;
+
+ kfree(temp_buf);
+
+ return ret;
+}
+
+static struct file_operations himax_proc_fw_upgrade_ops = {
+ .owner = THIS_MODULE,
+ .read = himax_fw_upgrade_read,
+};
static ssize_t himax_sense_on_off_write(struct file *file, const char *buff,
size_t len, loff_t *pos)
goto fail_18;
}
+ himax_proc_fw_upgrade_file = proc_create(HIMAX_PROC_FW_UPGRADE_FILE, (S_IWUSR | S_IRUGO),
+ himax_touch_proc_dir, &himax_proc_fw_upgrade_ops);
+ if (himax_proc_fw_upgrade_file == NULL) {
+ E(" %s: proc fw_upgrade_status file create failed!\n", __func__);
+ goto fail_19;
+ }
+
return 0 ;
+fail_19:
+ remove_proc_entry(HIMAX_PROC_CRC_TEST_FILE, himax_touch_proc_dir);
fail_18:
#ifdef HX_ESD_RECOVERY
remove_proc_entry(HIMAX_PROC_ESD_CNT_FILE, himax_touch_proc_dir);
#define HIMAX_PROC_INT_EN_FILE "int_en"
#define HIMAX_PROC_LAYOUT_FILE "layout"
#define HIMAX_PROC_CRC_TEST_FILE "CRC_test"
+#define HIMAX_PROC_FW_UPGRADE_FILE "fw_upgrade_status"
static struct proc_dir_entry *himax_proc_debug_level_file;
static struct proc_dir_entry *himax_proc_vendor_file;
static struct proc_dir_entry *himax_proc_int_en_file;
static struct proc_dir_entry *himax_proc_layout_file;
static struct proc_dir_entry *himax_proc_CRC_test_file;
+static struct proc_dir_entry *himax_proc_fw_upgrade_file;
int himax_touch_proc_init(void);
void himax_touch_proc_deinit(void);