Loading drivers/input/touchscreen/gt9xx/goodix_tool.c +3 −3 Original line number Diff line number Diff line Loading @@ -212,8 +212,9 @@ s32 init_wr_node(struct i2c_client *client) i = 5; while ((!cmd_head.data) && i) { cmd_head.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL); if (NULL != cmd_head.data) cmd_head.data = devm_kzalloc(&client->dev, i * DATA_LENGTH_UINT, GFP_KERNEL); if (cmd_head.data) break; i--; } Loading Loading @@ -247,7 +248,6 @@ s32 init_wr_node(struct i2c_client *client) void uninit_wr_node(void) { kfree(cmd_head.data); cmd_head.data = NULL; unregister_i2c_func(); remove_proc_entry(procname, NULL); Loading drivers/input/touchscreen/gt9xx/gt9xx.c +1 −4 Original line number Diff line number Diff line Loading @@ -1652,7 +1652,7 @@ static int goodix_ts_probe(struct i2c_client *client, return -ENODEV; } ts = kzalloc(sizeof(*ts), GFP_KERNEL); ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); if (!ts) { dev_err(&client->dev, "GTP not enough memory for ts\n"); return -ENOMEM; Loading Loading @@ -1795,7 +1795,6 @@ exit_deinit_power: goodix_power_deinit(ts); exit_free_client_data: i2c_set_clientdata(client, NULL); kfree(ts); return ret; } Loading Loading @@ -1844,7 +1843,6 @@ static int goodix_ts_remove(struct i2c_client *client) input_free_device(ts->input_dev); ts->input_dev = NULL; } kfree(ts->config_data); if (gpio_is_valid(ts->pdata->reset_gpio)) gpio_free(ts->pdata->reset_gpio); Loading @@ -1854,7 +1852,6 @@ static int goodix_ts_remove(struct i2c_client *client) goodix_power_off(ts); goodix_power_deinit(ts); i2c_set_clientdata(client, NULL); kfree(ts); } return 0; Loading drivers/input/touchscreen/gt9xx/gt9xx_update.c +93 −103 Original line number Diff line number Diff line Loading @@ -583,11 +583,11 @@ static u8 ascii2hex(u8 a) static s8 gup_update_config(struct i2c_client *client) { s32 file_len = 0; u32 file_len = 0; s32 ret = 0; s32 i = 0; s32 file_cfg_len = 0; s32 chip_cfg_len = 0; u32 chip_cfg_len = 0; s32 count = 0; u8 *buf; u8 *pre_buf; Loading Loading @@ -623,9 +623,25 @@ static s8 gup_update_config(struct i2c_client *client) return -EINVAL; } buf = kzalloc(file_len, GFP_KERNEL); pre_buf = kzalloc(file_len, GFP_KERNEL); file_config = kzalloc(chip_cfg_len + GTP_ADDR_LENGTH, GFP_KERNEL); buf = devm_kzalloc(&client->dev, file_len, GFP_KERNEL); if (!buf) { dev_err(&client->dev, "Memory allocation failed for buf."); return -ENOMEM; } pre_buf = devm_kzalloc(&client->dev, file_len, GFP_KERNEL); if (!pre_buf) { dev_err(&client->dev, "Memory allocation failed for pre_buf."); return -ENOMEM; } file_config = devm_kzalloc(&client->dev, chip_cfg_len + GTP_ADDR_LENGTH, GFP_KERNEL); if (!file_config) { dev_err(&client->dev, "Memory allocation failed."); return -ENOMEM; } update_msg.cfg_file->f_op->llseek(update_msg.cfg_file, 0, SEEK_SET); GTP_DEBUG("[update_cfg]Read config from file."); Loading @@ -633,7 +649,7 @@ static s8 gup_update_config(struct i2c_client *client) (char *)pre_buf, file_len, &update_msg.cfg_file->f_pos); if (ret < 0) { GTP_ERROR("[update_cfg]Read config file failed."); goto update_cfg_file_failed; return ret; } GTP_DEBUG("[update_cfg]Delete illgal charactor."); Loading @@ -657,13 +673,13 @@ static s8 gup_update_config(struct i2c_client *client) if ((high == 0xFF) || (low == 0xFF)) { ret = 0; GTP_ERROR("[update_cfg]Illegal config file."); goto update_cfg_file_failed; return ret; } file_config[file_cfg_len++] = (high<<4) + low; } else { ret = 0; GTP_ERROR("[update_cfg]Illegal config file."); goto update_cfg_file_failed; return ret; } } Loading @@ -686,10 +702,6 @@ static s8 gup_update_config(struct i2c_client *client) GTP_ERROR("[update_cfg]Send config i2c error."); } update_cfg_file_failed: kfree(pre_buf); kfree(buf); kfree(file_config); return ret; } Loading Loading @@ -791,15 +803,25 @@ static u8 gup_check_update_file(struct i2c_client *client, st_fw_head *fw_head, sizeof(UPDATE_FILE_PATH_2)); u8 cfp_len = max(sizeof(CONFIG_FILE_PATH_1), sizeof(CONFIG_FILE_PATH_2)); u8 *search_update_path = kzalloc(fp_len, GFP_KERNEL); u8 *search_cfg_path = kzalloc(cfp_len, GFP_KERNEL); u8 *search_update_path = devm_kzalloc(&client->dev, fp_len, GFP_KERNEL); if (!search_update_path) { dev_err(&client->dev, "Memory allocation falied."); goto load_failed; } u8 *search_cfg_path = devm_kzalloc(&client->dev, cfp_len, GFP_KERNEL); if (!search_cfg_path) { dev_err(&client->dev, "Memory allocation falied."); goto load_failed; } /* Begin to search update file,the config file & firmware file must be in the same path,single or double. */ searching_file = 1; for (i = 0; i < GUP_SEARCH_FILE_TIMES; i++) { if (searching_file == 0) { kfree(search_update_path); kfree(search_cfg_path); GTP_INFO(".bin/.cfg update file search " \ "forcely terminated!"); return FAIL; Loading Loading @@ -847,8 +869,6 @@ static u8 gup_check_update_file(struct i2c_client *client, st_fw_head *fw_head, } searching_file = 0; kfree(search_update_path); kfree(search_cfg_path); if (!got_file_flag) { GTP_ERROR("Can't find update file."); Loading Loading @@ -1170,7 +1190,8 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) /* step1:alloc memory */ GTP_DEBUG("[burn_dsp_isp]step1:alloc memory"); while (retry++ < 5) { fw_dsp_isp = kzalloc(FW_DSP_ISP_LENGTH, GFP_KERNEL); fw_dsp_isp = devm_kzalloc(&client->dev, FW_DSP_ISP_LENGTH, GFP_KERNEL); if (fw_dsp_isp == NULL) { continue; } else { Loading @@ -1179,7 +1200,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) break; } } if (retry >= 5) { if (retry == 5) { GTP_ERROR("[burn_dsp_isp]Alloc memory fail,exit."); return FAIL; } Loading @@ -1190,7 +1211,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) FW_DSP_LENGTH + FW_BOOT_LENGTH), FW_DSP_ISP_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_dsp_isp]load firmware dsp_isp fail."); goto exit_burn_dsp_isp; return FAIL; } /* step3:disable wdt,clear cache enable */ Loading @@ -1198,14 +1219,12 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__TMR0_EN, 0x00); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]disable wdt fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } ret = gup_set_ic_msg(client, _bRW_MISCTL__CACHE_EN, 0x00); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]clear cache enable fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step4:hold ss51 & dsp */ Loading @@ -1213,8 +1232,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]hold ss51 & dsp fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step5:set boot from sram */ Loading @@ -1222,8 +1240,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOTCTL_B0_, 0x02); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]set boot from sram fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step6:software reboot */ Loading @@ -1231,8 +1248,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bWO_MISCTL__CPU_SWRST_PULSE, 0x01); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]software reboot fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step7:select bank2 */ Loading @@ -1240,8 +1256,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x02); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]select bank2 fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step8:enable accessing code */ Loading @@ -1249,8 +1264,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__MEM_CD_EN, 0x01); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]enable accessing code fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step9:burn 4k dsp_isp */ Loading @@ -1258,7 +1272,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_burn_proc(client, fw_dsp_isp, 0xC000, FW_DSP_ISP_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_dsp_isp]burn dsp_isp fail."); goto exit_burn_dsp_isp; return FAIL; } /* step10:set scramble */ Loading @@ -1266,14 +1280,10 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]set scramble fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } ret = SUCCESS; exit_burn_dsp_isp: kfree(fw_dsp_isp); return ret; return SUCCESS; } static u8 gup_burn_fw_ss51(struct i2c_client *client) Loading @@ -1287,7 +1297,8 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) /* step1:alloc memory */ GTP_DEBUG("[burn_fw_ss51]step1:alloc memory"); while (retry++ < 5) { fw_ss51 = kzalloc(FW_SECTION_LENGTH, GFP_KERNEL); fw_ss51 = devm_kzalloc(&client->dev, FW_SECTION_LENGTH, GFP_KERNEL); if (fw_ss51 == NULL) { continue; } else { Loading @@ -1296,7 +1307,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) break; } } if (retry >= 5) { if (retry == 5) { GTP_ERROR("[burn_fw_ss51]Alloc memory fail,exit."); return FAIL; } Loading @@ -1306,7 +1317,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_load_section_file(fw_ss51, 0, FW_SECTION_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 1 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step3:clear control flag */ Loading @@ -1314,8 +1325,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x00); if (ret <= 0) { GTP_ERROR("[burn_fw_ss51]clear control flag fail."); ret = FAIL; goto exit_burn_fw_ss51; return FAIL; } /* step4:burn ss51 firmware section 1 */ Loading @@ -1323,7 +1333,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_burn_fw_section(client, fw_ss51, 0xC000, 0x01); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 1 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step5:load ss51 firmware section 2 file data */ Loading @@ -1332,7 +1342,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) FW_SECTION_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 2 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step6:burn ss51 firmware section 2 */ Loading @@ -1340,7 +1350,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_burn_fw_section(client, fw_ss51, 0xE000, 0x02); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 2 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step7:load ss51 firmware section 3 file data */ Loading @@ -1349,7 +1359,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) FW_SECTION_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 3 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step8:burn ss51 firmware section 3 */ Loading @@ -1357,7 +1367,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_burn_fw_section(client, fw_ss51, 0xC000, 0x13); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 3 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step9:load ss51 firmware section 4 file data */ Loading @@ -1366,7 +1376,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) FW_SECTION_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 4 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step10:burn ss51 firmware section 4 */ Loading @@ -1374,14 +1384,10 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_burn_fw_section(client, fw_ss51, 0xE000, 0x14); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 4 fail."); goto exit_burn_fw_ss51; return FAIL; } ret = SUCCESS; exit_burn_fw_ss51: kfree(fw_ss51); return ret; return SUCCESS; } static u8 gup_burn_fw_dsp(struct i2c_client *client) Loading @@ -1395,7 +1401,8 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) /* step1:alloc memory */ GTP_DEBUG("[burn_fw_dsp]step1:alloc memory"); while (retry++ < 5) { fw_dsp = kzalloc(FW_DSP_LENGTH, GFP_KERNEL); fw_dsp = devm_kzalloc(&client->dev, FW_DSP_LENGTH, GFP_KERNEL); if (fw_dsp == NULL) { continue; } else { Loading @@ -1404,7 +1411,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) break; } } if (retry >= 5) { if (retry == 5) { GTP_ERROR("[burn_fw_dsp]Alloc memory fail,exit."); return FAIL; } Loading @@ -1414,7 +1421,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_load_section_file(fw_dsp, 4*FW_SECTION_LENGTH, FW_DSP_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_dsp]load firmware dsp fail."); goto exit_burn_fw_dsp; return ret; } /* step3:select bank3 */ Loading @@ -1422,8 +1429,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x03); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]select bank3 fail."); ret = FAIL; goto exit_burn_fw_dsp; return FAIL; } /* Step4:hold ss51 & dsp */ Loading @@ -1431,8 +1437,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]hold ss51 & dsp fail."); ret = FAIL; goto exit_burn_fw_dsp; return FAIL; } /* step5:set scramble */ Loading @@ -1440,8 +1445,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]set scramble fail."); ret = FAIL; goto exit_burn_fw_dsp; return FAIL; } /* step6:release ss51 & dsp */ Loading @@ -1449,8 +1453,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x04); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]release ss51 & dsp fail."); ret = FAIL; goto exit_burn_fw_dsp; return FAIL; } /* must delay */ msleep(20); Loading @@ -1458,9 +1461,9 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) /* step7:burn 4k dsp firmware */ GTP_DEBUG("[burn_fw_dsp]step7:burn 4k dsp firmware"); ret = gup_burn_proc(client, fw_dsp, 0x9000, FW_DSP_LENGTH); if (FAIL == ret) { if (ret == FAIL) { GTP_ERROR("[burn_fw_dsp]burn fw_section fail."); goto exit_burn_fw_dsp; return ret; } /* step8:send burn cmd to move data to flash from sram */ Loading @@ -1469,14 +1472,14 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x05); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]send burn cmd fail."); goto exit_burn_fw_dsp; return ret; } GTP_DEBUG("[burn_fw_dsp]Wait for the burn is complete......"); do { ret = gup_get_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, rd_buf, 1); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]Get burn state fail"); goto exit_burn_fw_dsp; return ret; } msleep(20); /* GTP_DEBUG("[burn_fw_dsp]Get burn state:%d.", Loading @@ -1488,14 +1491,10 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_recall_check(client, fw_dsp, 0x9000, FW_DSP_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_dsp]recall check 4k dsp firmware fail."); goto exit_burn_fw_dsp; return ret; } ret = SUCCESS; exit_burn_fw_dsp: kfree(fw_dsp); return ret; } static u8 gup_burn_fw_boot(struct i2c_client *client) Loading @@ -1510,7 +1509,8 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) /* step1:Alloc memory */ GTP_DEBUG("[burn_fw_boot]step1:Alloc memory"); while (retry++ < 5) { fw_boot = kzalloc(FW_BOOT_LENGTH, GFP_KERNEL); fw_boot = devm_kzalloc(&client->dev, FW_BOOT_LENGTH, GFP_KERNEL); if (fw_boot == NULL) { continue; } else { Loading @@ -1519,7 +1519,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) break; } } if (retry >= 5) { if (retry == 5) { GTP_ERROR("[burn_fw_boot]Alloc memory fail,exit."); return FAIL; } Loading @@ -1530,7 +1530,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) FW_DSP_LENGTH), FW_BOOT_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_boot]load firmware dsp fail."); goto exit_burn_fw_boot; return ret; } /* step3:hold ss51 & dsp */ Loading @@ -1538,8 +1538,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]hold ss51 & dsp fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* step4:set scramble */ Loading @@ -1547,8 +1546,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]set scramble fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* step5:release ss51 & dsp */ Loading @@ -1556,8 +1554,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x04); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]release ss51 & dsp fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* must delay */ msleep(20); Loading @@ -1567,8 +1564,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x03); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]select bank3 fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* step7:burn 2k bootloader firmware */ Loading @@ -1576,7 +1572,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_burn_proc(client, fw_boot, 0x9000, FW_BOOT_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_boot]burn fw_section fail."); goto exit_burn_fw_boot; return ret; } /* step7:send burn cmd to move data to flash from sram */ Loading @@ -1585,14 +1581,14 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x06); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]send burn cmd fail."); goto exit_burn_fw_boot; return ret; } GTP_DEBUG("[burn_fw_boot]Wait for the burn is complete......"); do { ret = gup_get_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, rd_buf, 1); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]Get burn state fail"); goto exit_burn_fw_boot; return ret; } msleep(20); /* GTP_DEBUG("[burn_fw_boot]Get burn state:%d.", Loading @@ -1604,7 +1600,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_recall_check(client, fw_boot, 0x9000, FW_BOOT_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_boot]recall check 4k dsp firmware fail."); goto exit_burn_fw_boot; return ret; } /* step9:enable download DSP code */ Loading @@ -1612,8 +1608,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x99); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]enable download DSP code fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* step10:release ss51 & hold dsp */ Loading @@ -1621,15 +1616,10 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x08); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]release ss51 & hold dsp fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } ret = SUCCESS; exit_burn_fw_boot: kfree(fw_boot); return ret; return SUCCESS; } s32 gup_update_proc(void *dir) Loading Loading
drivers/input/touchscreen/gt9xx/goodix_tool.c +3 −3 Original line number Diff line number Diff line Loading @@ -212,8 +212,9 @@ s32 init_wr_node(struct i2c_client *client) i = 5; while ((!cmd_head.data) && i) { cmd_head.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL); if (NULL != cmd_head.data) cmd_head.data = devm_kzalloc(&client->dev, i * DATA_LENGTH_UINT, GFP_KERNEL); if (cmd_head.data) break; i--; } Loading Loading @@ -247,7 +248,6 @@ s32 init_wr_node(struct i2c_client *client) void uninit_wr_node(void) { kfree(cmd_head.data); cmd_head.data = NULL; unregister_i2c_func(); remove_proc_entry(procname, NULL); Loading
drivers/input/touchscreen/gt9xx/gt9xx.c +1 −4 Original line number Diff line number Diff line Loading @@ -1652,7 +1652,7 @@ static int goodix_ts_probe(struct i2c_client *client, return -ENODEV; } ts = kzalloc(sizeof(*ts), GFP_KERNEL); ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); if (!ts) { dev_err(&client->dev, "GTP not enough memory for ts\n"); return -ENOMEM; Loading Loading @@ -1795,7 +1795,6 @@ exit_deinit_power: goodix_power_deinit(ts); exit_free_client_data: i2c_set_clientdata(client, NULL); kfree(ts); return ret; } Loading Loading @@ -1844,7 +1843,6 @@ static int goodix_ts_remove(struct i2c_client *client) input_free_device(ts->input_dev); ts->input_dev = NULL; } kfree(ts->config_data); if (gpio_is_valid(ts->pdata->reset_gpio)) gpio_free(ts->pdata->reset_gpio); Loading @@ -1854,7 +1852,6 @@ static int goodix_ts_remove(struct i2c_client *client) goodix_power_off(ts); goodix_power_deinit(ts); i2c_set_clientdata(client, NULL); kfree(ts); } return 0; Loading
drivers/input/touchscreen/gt9xx/gt9xx_update.c +93 −103 Original line number Diff line number Diff line Loading @@ -583,11 +583,11 @@ static u8 ascii2hex(u8 a) static s8 gup_update_config(struct i2c_client *client) { s32 file_len = 0; u32 file_len = 0; s32 ret = 0; s32 i = 0; s32 file_cfg_len = 0; s32 chip_cfg_len = 0; u32 chip_cfg_len = 0; s32 count = 0; u8 *buf; u8 *pre_buf; Loading Loading @@ -623,9 +623,25 @@ static s8 gup_update_config(struct i2c_client *client) return -EINVAL; } buf = kzalloc(file_len, GFP_KERNEL); pre_buf = kzalloc(file_len, GFP_KERNEL); file_config = kzalloc(chip_cfg_len + GTP_ADDR_LENGTH, GFP_KERNEL); buf = devm_kzalloc(&client->dev, file_len, GFP_KERNEL); if (!buf) { dev_err(&client->dev, "Memory allocation failed for buf."); return -ENOMEM; } pre_buf = devm_kzalloc(&client->dev, file_len, GFP_KERNEL); if (!pre_buf) { dev_err(&client->dev, "Memory allocation failed for pre_buf."); return -ENOMEM; } file_config = devm_kzalloc(&client->dev, chip_cfg_len + GTP_ADDR_LENGTH, GFP_KERNEL); if (!file_config) { dev_err(&client->dev, "Memory allocation failed."); return -ENOMEM; } update_msg.cfg_file->f_op->llseek(update_msg.cfg_file, 0, SEEK_SET); GTP_DEBUG("[update_cfg]Read config from file."); Loading @@ -633,7 +649,7 @@ static s8 gup_update_config(struct i2c_client *client) (char *)pre_buf, file_len, &update_msg.cfg_file->f_pos); if (ret < 0) { GTP_ERROR("[update_cfg]Read config file failed."); goto update_cfg_file_failed; return ret; } GTP_DEBUG("[update_cfg]Delete illgal charactor."); Loading @@ -657,13 +673,13 @@ static s8 gup_update_config(struct i2c_client *client) if ((high == 0xFF) || (low == 0xFF)) { ret = 0; GTP_ERROR("[update_cfg]Illegal config file."); goto update_cfg_file_failed; return ret; } file_config[file_cfg_len++] = (high<<4) + low; } else { ret = 0; GTP_ERROR("[update_cfg]Illegal config file."); goto update_cfg_file_failed; return ret; } } Loading @@ -686,10 +702,6 @@ static s8 gup_update_config(struct i2c_client *client) GTP_ERROR("[update_cfg]Send config i2c error."); } update_cfg_file_failed: kfree(pre_buf); kfree(buf); kfree(file_config); return ret; } Loading Loading @@ -791,15 +803,25 @@ static u8 gup_check_update_file(struct i2c_client *client, st_fw_head *fw_head, sizeof(UPDATE_FILE_PATH_2)); u8 cfp_len = max(sizeof(CONFIG_FILE_PATH_1), sizeof(CONFIG_FILE_PATH_2)); u8 *search_update_path = kzalloc(fp_len, GFP_KERNEL); u8 *search_cfg_path = kzalloc(cfp_len, GFP_KERNEL); u8 *search_update_path = devm_kzalloc(&client->dev, fp_len, GFP_KERNEL); if (!search_update_path) { dev_err(&client->dev, "Memory allocation falied."); goto load_failed; } u8 *search_cfg_path = devm_kzalloc(&client->dev, cfp_len, GFP_KERNEL); if (!search_cfg_path) { dev_err(&client->dev, "Memory allocation falied."); goto load_failed; } /* Begin to search update file,the config file & firmware file must be in the same path,single or double. */ searching_file = 1; for (i = 0; i < GUP_SEARCH_FILE_TIMES; i++) { if (searching_file == 0) { kfree(search_update_path); kfree(search_cfg_path); GTP_INFO(".bin/.cfg update file search " \ "forcely terminated!"); return FAIL; Loading Loading @@ -847,8 +869,6 @@ static u8 gup_check_update_file(struct i2c_client *client, st_fw_head *fw_head, } searching_file = 0; kfree(search_update_path); kfree(search_cfg_path); if (!got_file_flag) { GTP_ERROR("Can't find update file."); Loading Loading @@ -1170,7 +1190,8 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) /* step1:alloc memory */ GTP_DEBUG("[burn_dsp_isp]step1:alloc memory"); while (retry++ < 5) { fw_dsp_isp = kzalloc(FW_DSP_ISP_LENGTH, GFP_KERNEL); fw_dsp_isp = devm_kzalloc(&client->dev, FW_DSP_ISP_LENGTH, GFP_KERNEL); if (fw_dsp_isp == NULL) { continue; } else { Loading @@ -1179,7 +1200,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) break; } } if (retry >= 5) { if (retry == 5) { GTP_ERROR("[burn_dsp_isp]Alloc memory fail,exit."); return FAIL; } Loading @@ -1190,7 +1211,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) FW_DSP_LENGTH + FW_BOOT_LENGTH), FW_DSP_ISP_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_dsp_isp]load firmware dsp_isp fail."); goto exit_burn_dsp_isp; return FAIL; } /* step3:disable wdt,clear cache enable */ Loading @@ -1198,14 +1219,12 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__TMR0_EN, 0x00); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]disable wdt fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } ret = gup_set_ic_msg(client, _bRW_MISCTL__CACHE_EN, 0x00); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]clear cache enable fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step4:hold ss51 & dsp */ Loading @@ -1213,8 +1232,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]hold ss51 & dsp fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step5:set boot from sram */ Loading @@ -1222,8 +1240,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOTCTL_B0_, 0x02); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]set boot from sram fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step6:software reboot */ Loading @@ -1231,8 +1248,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bWO_MISCTL__CPU_SWRST_PULSE, 0x01); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]software reboot fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step7:select bank2 */ Loading @@ -1240,8 +1256,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x02); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]select bank2 fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step8:enable accessing code */ Loading @@ -1249,8 +1264,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__MEM_CD_EN, 0x01); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]enable accessing code fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } /* step9:burn 4k dsp_isp */ Loading @@ -1258,7 +1272,7 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_burn_proc(client, fw_dsp_isp, 0xC000, FW_DSP_ISP_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_dsp_isp]burn dsp_isp fail."); goto exit_burn_dsp_isp; return FAIL; } /* step10:set scramble */ Loading @@ -1266,14 +1280,10 @@ static u8 gup_burn_dsp_isp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00); if (ret <= 0) { GTP_ERROR("[burn_dsp_isp]set scramble fail."); ret = FAIL; goto exit_burn_dsp_isp; return FAIL; } ret = SUCCESS; exit_burn_dsp_isp: kfree(fw_dsp_isp); return ret; return SUCCESS; } static u8 gup_burn_fw_ss51(struct i2c_client *client) Loading @@ -1287,7 +1297,8 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) /* step1:alloc memory */ GTP_DEBUG("[burn_fw_ss51]step1:alloc memory"); while (retry++ < 5) { fw_ss51 = kzalloc(FW_SECTION_LENGTH, GFP_KERNEL); fw_ss51 = devm_kzalloc(&client->dev, FW_SECTION_LENGTH, GFP_KERNEL); if (fw_ss51 == NULL) { continue; } else { Loading @@ -1296,7 +1307,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) break; } } if (retry >= 5) { if (retry == 5) { GTP_ERROR("[burn_fw_ss51]Alloc memory fail,exit."); return FAIL; } Loading @@ -1306,7 +1317,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_load_section_file(fw_ss51, 0, FW_SECTION_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 1 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step3:clear control flag */ Loading @@ -1314,8 +1325,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x00); if (ret <= 0) { GTP_ERROR("[burn_fw_ss51]clear control flag fail."); ret = FAIL; goto exit_burn_fw_ss51; return FAIL; } /* step4:burn ss51 firmware section 1 */ Loading @@ -1323,7 +1333,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_burn_fw_section(client, fw_ss51, 0xC000, 0x01); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 1 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step5:load ss51 firmware section 2 file data */ Loading @@ -1332,7 +1342,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) FW_SECTION_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 2 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step6:burn ss51 firmware section 2 */ Loading @@ -1340,7 +1350,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_burn_fw_section(client, fw_ss51, 0xE000, 0x02); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 2 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step7:load ss51 firmware section 3 file data */ Loading @@ -1349,7 +1359,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) FW_SECTION_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 3 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step8:burn ss51 firmware section 3 */ Loading @@ -1357,7 +1367,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_burn_fw_section(client, fw_ss51, 0xC000, 0x13); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 3 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step9:load ss51 firmware section 4 file data */ Loading @@ -1366,7 +1376,7 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) FW_SECTION_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 4 fail."); goto exit_burn_fw_ss51; return FAIL; } /* step10:burn ss51 firmware section 4 */ Loading @@ -1374,14 +1384,10 @@ static u8 gup_burn_fw_ss51(struct i2c_client *client) ret = gup_burn_fw_section(client, fw_ss51, 0xE000, 0x14); if (ret == FAIL) { GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 4 fail."); goto exit_burn_fw_ss51; return FAIL; } ret = SUCCESS; exit_burn_fw_ss51: kfree(fw_ss51); return ret; return SUCCESS; } static u8 gup_burn_fw_dsp(struct i2c_client *client) Loading @@ -1395,7 +1401,8 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) /* step1:alloc memory */ GTP_DEBUG("[burn_fw_dsp]step1:alloc memory"); while (retry++ < 5) { fw_dsp = kzalloc(FW_DSP_LENGTH, GFP_KERNEL); fw_dsp = devm_kzalloc(&client->dev, FW_DSP_LENGTH, GFP_KERNEL); if (fw_dsp == NULL) { continue; } else { Loading @@ -1404,7 +1411,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) break; } } if (retry >= 5) { if (retry == 5) { GTP_ERROR("[burn_fw_dsp]Alloc memory fail,exit."); return FAIL; } Loading @@ -1414,7 +1421,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_load_section_file(fw_dsp, 4*FW_SECTION_LENGTH, FW_DSP_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_dsp]load firmware dsp fail."); goto exit_burn_fw_dsp; return ret; } /* step3:select bank3 */ Loading @@ -1422,8 +1429,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x03); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]select bank3 fail."); ret = FAIL; goto exit_burn_fw_dsp; return FAIL; } /* Step4:hold ss51 & dsp */ Loading @@ -1431,8 +1437,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]hold ss51 & dsp fail."); ret = FAIL; goto exit_burn_fw_dsp; return FAIL; } /* step5:set scramble */ Loading @@ -1440,8 +1445,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]set scramble fail."); ret = FAIL; goto exit_burn_fw_dsp; return FAIL; } /* step6:release ss51 & dsp */ Loading @@ -1449,8 +1453,7 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x04); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]release ss51 & dsp fail."); ret = FAIL; goto exit_burn_fw_dsp; return FAIL; } /* must delay */ msleep(20); Loading @@ -1458,9 +1461,9 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) /* step7:burn 4k dsp firmware */ GTP_DEBUG("[burn_fw_dsp]step7:burn 4k dsp firmware"); ret = gup_burn_proc(client, fw_dsp, 0x9000, FW_DSP_LENGTH); if (FAIL == ret) { if (ret == FAIL) { GTP_ERROR("[burn_fw_dsp]burn fw_section fail."); goto exit_burn_fw_dsp; return ret; } /* step8:send burn cmd to move data to flash from sram */ Loading @@ -1469,14 +1472,14 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x05); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]send burn cmd fail."); goto exit_burn_fw_dsp; return ret; } GTP_DEBUG("[burn_fw_dsp]Wait for the burn is complete......"); do { ret = gup_get_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, rd_buf, 1); if (ret <= 0) { GTP_ERROR("[burn_fw_dsp]Get burn state fail"); goto exit_burn_fw_dsp; return ret; } msleep(20); /* GTP_DEBUG("[burn_fw_dsp]Get burn state:%d.", Loading @@ -1488,14 +1491,10 @@ static u8 gup_burn_fw_dsp(struct i2c_client *client) ret = gup_recall_check(client, fw_dsp, 0x9000, FW_DSP_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_dsp]recall check 4k dsp firmware fail."); goto exit_burn_fw_dsp; return ret; } ret = SUCCESS; exit_burn_fw_dsp: kfree(fw_dsp); return ret; } static u8 gup_burn_fw_boot(struct i2c_client *client) Loading @@ -1510,7 +1509,8 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) /* step1:Alloc memory */ GTP_DEBUG("[burn_fw_boot]step1:Alloc memory"); while (retry++ < 5) { fw_boot = kzalloc(FW_BOOT_LENGTH, GFP_KERNEL); fw_boot = devm_kzalloc(&client->dev, FW_BOOT_LENGTH, GFP_KERNEL); if (fw_boot == NULL) { continue; } else { Loading @@ -1519,7 +1519,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) break; } } if (retry >= 5) { if (retry == 5) { GTP_ERROR("[burn_fw_boot]Alloc memory fail,exit."); return FAIL; } Loading @@ -1530,7 +1530,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) FW_DSP_LENGTH), FW_BOOT_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_boot]load firmware dsp fail."); goto exit_burn_fw_boot; return ret; } /* step3:hold ss51 & dsp */ Loading @@ -1538,8 +1538,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]hold ss51 & dsp fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* step4:set scramble */ Loading @@ -1547,8 +1546,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]set scramble fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* step5:release ss51 & dsp */ Loading @@ -1556,8 +1554,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x04); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]release ss51 & dsp fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* must delay */ msleep(20); Loading @@ -1567,8 +1564,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x03); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]select bank3 fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* step7:burn 2k bootloader firmware */ Loading @@ -1576,7 +1572,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_burn_proc(client, fw_boot, 0x9000, FW_BOOT_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_boot]burn fw_section fail."); goto exit_burn_fw_boot; return ret; } /* step7:send burn cmd to move data to flash from sram */ Loading @@ -1585,14 +1581,14 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x06); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]send burn cmd fail."); goto exit_burn_fw_boot; return ret; } GTP_DEBUG("[burn_fw_boot]Wait for the burn is complete......"); do { ret = gup_get_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, rd_buf, 1); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]Get burn state fail"); goto exit_burn_fw_boot; return ret; } msleep(20); /* GTP_DEBUG("[burn_fw_boot]Get burn state:%d.", Loading @@ -1604,7 +1600,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_recall_check(client, fw_boot, 0x9000, FW_BOOT_LENGTH); if (ret == FAIL) { GTP_ERROR("[burn_fw_boot]recall check 4k dsp firmware fail."); goto exit_burn_fw_boot; return ret; } /* step9:enable download DSP code */ Loading @@ -1612,8 +1608,7 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x99); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]enable download DSP code fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } /* step10:release ss51 & hold dsp */ Loading @@ -1621,15 +1616,10 @@ static u8 gup_burn_fw_boot(struct i2c_client *client) ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x08); if (ret <= 0) { GTP_ERROR("[burn_fw_boot]release ss51 & hold dsp fail."); ret = FAIL; goto exit_burn_fw_boot; return FAIL; } ret = SUCCESS; exit_burn_fw_boot: kfree(fw_boot); return ret; return SUCCESS; } s32 gup_update_proc(void *dir) Loading