Lines Matching refs:ret
202 int ret = gt1x_i2c_write(addr, buffer, length); in gt1x_i2c_write_with_readback() local
203 if (ret) { in gt1x_i2c_write_with_readback()
204 return ret; in gt1x_i2c_write_with_readback()
206 ret = gt1x_i2c_read(addr, buf, length); in gt1x_i2c_write_with_readback()
207 if (ret) { in gt1x_i2c_write_with_readback()
208 return ret; in gt1x_i2c_write_with_readback()
242 int ret; in gt1x_auto_update_proc()
247 ret = gt1x_search_update_files(); in gt1x_auto_update_proc()
248 if (ret & (FOUND_FW_PATH_1 | FOUND_FW_PATH_2)) { in gt1x_auto_update_proc()
249 if (ret & FOUND_FW_PATH_1) { in gt1x_auto_update_proc()
257 if (ret & (FOUND_CFG_PATH_1 | FOUND_CFG_PATH_2)) { in gt1x_auto_update_proc()
258 if (ret & FOUND_CFG_PATH_1) { in gt1x_auto_update_proc()
357 int ret = 0; in gt1x_update_firmware()
369 ret = gt1x_update_prepare(filename); in gt1x_update_firmware()
370 if (ret) { in gt1x_update_firmware()
372 return ret; in gt1x_update_firmware()
375 ret = gt1x_check_firmware(); in gt1x_update_firmware()
376 if (ret) { in gt1x_update_firmware()
389 ret = gt1x_update_judge(); in gt1x_update_firmware()
390 if (ret) { in gt1x_update_firmware()
399 ret = ERROR_FW; in gt1x_update_firmware()
405 ret = gt1x_run_ss51_isp(p, update_info.firmware->subsystem[0].length); in gt1x_update_firmware()
406 if (ret) { in gt1x_update_firmware()
418 ret = gt1x_burn_subsystem(&(update_info.firmware->subsystem[i])); in gt1x_update_firmware()
419 if (ret) { in gt1x_update_firmware()
432 ret = ERROR_FW; in gt1x_update_firmware()
437 ret = gt1x_run_ss51_isp(p, update_info.firmware->subsystem[0].length); in gt1x_update_firmware()
438 if (ret) { in gt1x_update_firmware()
450 ret = gt1x_check_subsystem_in_flash(&(update_info.firmware->subsystem[i])); in gt1x_update_firmware()
451 if (ret) { in gt1x_update_firmware()
463 if (ret) { in gt1x_update_firmware()
466 return ret; in gt1x_update_firmware()
478 return ret; in gt1x_update_firmware()
485 int ret = 0;
525 ret = ERROR_RETRY;
541 ret = ERROR_RETRY;
551 return ret;
657 int ret; in gt1x_get_fw_data() local
660 …ret = update_info.fw_file->f_op->read(update_info.fw_file, (char *)update_info.buffer, length, &up… in gt1x_get_fw_data()
661 if (ret < 0) { in gt1x_get_fw_data()
673 int ret; in gt1x_update_judge() local
690 ret = gt1x_i2c_read_dbl_check(GTP_REG_FW_CHK_MAINSYS, reg_val, 1); in gt1x_update_judge()
691 if (ret < 0) { /* read reg failed */ in gt1x_update_judge()
693 } else if (ret > 0) { in gt1x_update_judge()
697 ret = gt1x_i2c_read_dbl_check(GTP_REG_FW_CHK_SUBSYS, ®_val[1], 1); in gt1x_update_judge()
698 if (ret < 0) { in gt1x_update_judge()
700 } else if (ret > 0) { in gt1x_update_judge()
719 ret = gt1x_read_version(&ver_info); in gt1x_update_judge()
720 if (ret < 0) { in gt1x_update_judge()
752 int ret = -1; in __gt1x_hold_ss51_dsp_20() local
760 ret = gt1x_i2c_write(_rRW_MISCTL__SWRST_B0_, buf, 1); in __gt1x_hold_ss51_dsp_20()
761 if (ret) { in __gt1x_hold_ss51_dsp_20()
767 ret = gt1x_i2c_read(_rRW_MISCTL__SWRST_B0_, buf, 1); in __gt1x_hold_ss51_dsp_20()
768 if (ret) { in __gt1x_hold_ss51_dsp_20()
792 int ret = ERROR, retry = 5; in gt1x_hold_ss51_dsp() local
797 ret = gt1x_i2c_read(0x4220, buffer, 1); in gt1x_hold_ss51_dsp()
799 } while (retry-- && ret < 0); in gt1x_hold_ss51_dsp()
801 if (ret < 0) in gt1x_hold_ss51_dsp()
805 ret = __gt1x_hold_ss51_dsp_20(); in gt1x_hold_ss51_dsp()
806 if (ret) { in gt1x_hold_ss51_dsp()
807 return ret; in gt1x_hold_ss51_dsp()
811 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__DSP_MCU_PWR_, buffer, 1); in gt1x_hold_ss51_dsp()
812 if (ret) { in gt1x_hold_ss51_dsp()
814 return ret; in gt1x_hold_ss51_dsp()
818 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__TMR0_EN, buffer, 1); in gt1x_hold_ss51_dsp()
819 if (ret) { in gt1x_hold_ss51_dsp()
821 return ret; in gt1x_hold_ss51_dsp()
825 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__CACHE_EN, buffer, 1); in gt1x_hold_ss51_dsp()
826 if (ret) { in gt1x_hold_ss51_dsp()
828 return ret; in gt1x_hold_ss51_dsp()
832 ret = gt1x_i2c_write(_bWO_MISCTL__CPU_SWRST_PULSE, buffer, 1); in gt1x_hold_ss51_dsp()
833 if (ret) { in gt1x_hold_ss51_dsp()
835 return ret; in gt1x_hold_ss51_dsp()
839 ret = gt1x_i2c_write_with_readback(_rRW_MISCTL__BOOT_OPT_B0_, buffer, 1); in gt1x_hold_ss51_dsp()
840 if (ret) { in gt1x_hold_ss51_dsp()
842 return ret; in gt1x_hold_ss51_dsp()
850 int ret; in gt1x_run_ss51_isp() local
853 ret = gt1x_hold_ss51_dsp(); in gt1x_run_ss51_isp()
854 if (ret) { in gt1x_run_ss51_isp()
855 return ret; in gt1x_run_ss51_isp()
859 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__SRAM_BANK, buffer, 1); in gt1x_run_ss51_isp()
860 if (ret) { in gt1x_run_ss51_isp()
862 return ret; in gt1x_run_ss51_isp()
866 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__PATCH_AREA_EN_, buffer, 1); in gt1x_run_ss51_isp()
867 if (ret) { in gt1x_run_ss51_isp()
869 return ret; in gt1x_run_ss51_isp()
874 ret = gt1x_i2c_write(0xC000, ss51_isp, length); in gt1x_run_ss51_isp()
875 if (ret) { in gt1x_run_ss51_isp()
877 return ret; in gt1x_run_ss51_isp()
880 ret = gt1x_recall_check(ss51_isp, 0xC000, length); in gt1x_run_ss51_isp()
881 if (ret) { in gt1x_run_ss51_isp()
883 return ret; in gt1x_run_ss51_isp()
887 ret = gt1x_i2c_write_with_readback(0x8140, buffer, 10); in gt1x_run_ss51_isp()
891 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__PATCH_AREA_EN_, buffer, 1); in gt1x_run_ss51_isp()
892 if (ret) { in gt1x_run_ss51_isp()
894 return ret; in gt1x_run_ss51_isp()
898 ret = gt1x_i2c_write_with_readback(0x8006, buffer, 8); in gt1x_run_ss51_isp()
899 if (ret) { in gt1x_run_ss51_isp()
901 return ret; in gt1x_run_ss51_isp()
905 ret = gt1x_i2c_write_with_readback(_rRW_MISCTL__SWRST_B0_, buffer, 1); in gt1x_run_ss51_isp()
906 if (ret) { in gt1x_run_ss51_isp()
908 return ret; in gt1x_run_ss51_isp()
913 ret = gt1x_i2c_read(0x8006, buffer, 2); in gt1x_run_ss51_isp()
914 if (ret) { in gt1x_run_ss51_isp()
916 return ret; in gt1x_run_ss51_isp()
941 s32 ret = 0; in gt1x_recall_check() local
948 ret = gt1x_i2c_read(start_addr + compared_length, rd_buf, len); in gt1x_recall_check()
949 if (ret) { in gt1x_recall_check()
951 return ret; in gt1x_recall_check()
979 int ret; in gt1x_burn_subsystem() local
1011 ret = gt1x_i2c_write_with_readback(0x8100, buffer, 4); in gt1x_burn_subsystem()
1012 if (ret) { in gt1x_burn_subsystem()
1017 ret = gt1x_i2c_write(0x8100 + 4, fw, block_len); in gt1x_burn_subsystem()
1018 if (ret) { in gt1x_burn_subsystem()
1025 ret = gt1x_i2c_write_with_readback(0x8100 + 4 + block_len, buffer, 2); in gt1x_burn_subsystem()
1026 if (ret) { in gt1x_burn_subsystem()
1032 ret = gt1x_i2c_write_with_readback(0x8022, buffer, 1); in gt1x_burn_subsystem()
1033 if (ret) { in gt1x_burn_subsystem()
1040 ret = gt1x_i2c_write_with_readback(0x8020, buffer, 2); in gt1x_burn_subsystem()
1041 if (ret) { in gt1x_burn_subsystem()
1052 ret = gt1x_i2c_read(0x8022, buffer, 1); in gt1x_burn_subsystem()
1053 if (ret < 0) { in gt1x_burn_subsystem()
1057 ret = gt1x_i2c_read(0x8022, &confirm, 1); in gt1x_burn_subsystem()
1058 if (ret < 0) { in gt1x_burn_subsystem()
1100 int ret; in gt1x_check_subsystem_in_flash() local
1117 ret = gt1x_read_flash(subsystem->address + checked_len, block_len); in gt1x_check_subsystem_in_flash()
1118 if (ret) { in gt1x_check_subsystem_in_flash()
1119 check_state |= ret; in gt1x_check_subsystem_in_flash()
1122 ret = gt1x_recall_check(fw, 0x8100, block_len); in gt1x_check_subsystem_in_flash()
1123 if (ret) { in gt1x_check_subsystem_in_flash()
1125 check_state |= ret; in gt1x_check_subsystem_in_flash()
1143 int ret = 0; in gt1x_read_flash() local
1150 ret = gt1x_i2c_write_with_readback(0x8022, buffer, 1); in gt1x_read_flash()
1156 ret |= gt1x_i2c_write_with_readback(0x8100, buffer, 4); in gt1x_read_flash()
1160 ret |= gt1x_i2c_write(0x8020, buffer, 2); in gt1x_read_flash()
1161 if (ret) { in gt1x_read_flash()
1163 return ret; in gt1x_read_flash()
1170 ret = gt1x_i2c_read_dbl_check(0x8022, buffer, 1); in gt1x_read_flash()
1171 if (ret) { in gt1x_read_flash()
1192 int ret; in gt1x_error_erase() local
1208 ret = gt1x_run_ss51_isp(fw, update_info.firmware->subsystem[0].length); in gt1x_error_erase()
1209 if (ret) { in gt1x_error_erase()
1236 ret = gt1x_i2c_write_with_readback(0x8100, buffer, 4); in gt1x_error_erase()
1237 if (ret) { in gt1x_error_erase()
1242 ret = gt1x_i2c_write(0x8100 + 4, fw, block_len); in gt1x_error_erase()
1243 if (ret) { in gt1x_error_erase()
1248 ret = gt1x_recall_check(fw, 0x8100 + 4, block_len); in gt1x_error_erase()
1249 if (ret) in gt1x_error_erase()
1254 ret = gt1x_i2c_write_with_readback(0x8100 + 4 + block_len, buffer, 2); in gt1x_error_erase()
1255 if (ret) { in gt1x_error_erase()
1261 ret = gt1x_i2c_write_with_readback(0x8022, buffer, 1); in gt1x_error_erase()
1262 if (ret) { in gt1x_error_erase()
1269 ret = gt1x_i2c_write_with_readback(0x8020, buffer, 2); in gt1x_error_erase()
1270 if (ret) { in gt1x_error_erase()
1279 ret = gt1x_i2c_read_dbl_check(0x8022, buffer, 1); in gt1x_error_erase()
1280 if (ret) in gt1x_error_erase()
1356 int ret = ERROR; in gt1x_hold_ss51_dsp_no_reset() local
1360 ret = __gt1x_hold_ss51_dsp_20(); in gt1x_hold_ss51_dsp_no_reset()
1361 if (ret) in gt1x_hold_ss51_dsp_no_reset()
1362 return ret; in gt1x_hold_ss51_dsp_no_reset()
1365 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__DSP_MCU_PWR_, buffer, 1); in gt1x_hold_ss51_dsp_no_reset()
1366 if (ret) { in gt1x_hold_ss51_dsp_no_reset()
1368 return ret; in gt1x_hold_ss51_dsp_no_reset()
1372 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__TMR0_EN, buffer, 1); in gt1x_hold_ss51_dsp_no_reset()
1373 if (ret) { in gt1x_hold_ss51_dsp_no_reset()
1375 return ret; in gt1x_hold_ss51_dsp_no_reset()
1379 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__CACHE_EN, buffer, 1); in gt1x_hold_ss51_dsp_no_reset()
1380 if (ret) { in gt1x_hold_ss51_dsp_no_reset()
1382 return ret; in gt1x_hold_ss51_dsp_no_reset()
1386 ret = gt1x_i2c_write(_bWO_MISCTL__CPU_SWRST_PULSE, buffer, 1); in gt1x_hold_ss51_dsp_no_reset()
1387 if (ret) { in gt1x_hold_ss51_dsp_no_reset()
1389 return ret; in gt1x_hold_ss51_dsp_no_reset()
1393 ret = gt1x_i2c_write_with_readback(_rRW_MISCTL__BOOT_OPT_B0_, buffer, 1); in gt1x_hold_ss51_dsp_no_reset()
1394 if (ret) { in gt1x_hold_ss51_dsp_no_reset()
1396 return ret; in gt1x_hold_ss51_dsp_no_reset()
1408 s32 ret = 0; in gt1x_load_patch() local
1417 ret = gt1x_i2c_write(_bRW_MISCTL__SRAM_BANK, &bank, 1); in gt1x_load_patch()
1418 if (ret) { in gt1x_load_patch()
1420 return ret; in gt1x_load_patch()
1425 ret = gt1x_i2c_write_with_readback(_bRW_MISCTL__PATCH_AREA_EN_ + bank - 4, &tmp, 1); in gt1x_load_patch()
1426 if (ret) { in gt1x_load_patch()
1428 return ret; in gt1x_load_patch()
1435 ret = gt1x_i2c_write(address, &patch[loaded_length], len); in gt1x_load_patch()
1436 if (ret) { in gt1x_load_patch()
1438 return ret; in gt1x_load_patch()
1440 ret = gt1x_recall_check(&patch[loaded_length], address, len); in gt1x_load_patch()
1441 if (ret) { in gt1x_load_patch()
1443 return ret; in gt1x_load_patch()
1455 s32 ret = 0; in gt1x_startup_patch() local
1460 ret |= gt1x_i2c_write(_bRW_MISCTL__PATCH_AREA_EN_, buffer, 2); in gt1x_startup_patch()
1463 ret |= gt1x_i2c_write(GTP_REG_FLASH_PASSBY, buffer, 8); in gt1x_startup_patch()
1464 ret |= gt1x_i2c_write(GTP_REG_VERSION, buffer, 5); in gt1x_startup_patch()
1467 ret |= gt1x_i2c_write(GTP_REG_CMD, buffer, 1); in gt1x_startup_patch()
1468 ret |= gt1x_i2c_write(GTP_REG_ESD_CHECK, buffer, 1); in gt1x_startup_patch()
1471 ret |= gt1x_i2c_write(_rRW_MISCTL__SWRST_B0_, buffer, 1); in gt1x_startup_patch()
1475 return ret; in gt1x_startup_patch()