Lines Matching refs:error
171 int error; in raydium_i2c_send() local
211 error = raydium_i2c_xfer(client, addr, xfer, ARRAY_SIZE(xfer)); in raydium_i2c_send()
212 if (likely(!error)) in raydium_i2c_send()
218 dev_err(&client->dev, "%s failed: %d\n", __func__, error); in raydium_i2c_send()
221 return error; in raydium_i2c_send()
227 int error; in raydium_i2c_read() local
266 error = raydium_i2c_xfer(client, addr, xfer, ARRAY_SIZE(xfer)); in raydium_i2c_read()
267 if (unlikely(error)) in raydium_i2c_read()
268 return error; in raydium_i2c_read()
281 int error; in raydium_i2c_sw_reset() local
283 error = raydium_i2c_send(client, RM_RESET_MSG_ADDR, &soft_rst_cmd, in raydium_i2c_sw_reset()
285 if (error) { in raydium_i2c_sw_reset()
286 dev_err(&client->dev, "software reset failed: %d\n", error); in raydium_i2c_sw_reset()
287 return error; in raydium_i2c_sw_reset()
302 int error; in raydium_i2c_query_ts_bootloader_info() local
304 error = raydium_i2c_send(client, RM_CMD_BOOT_WRT, in raydium_i2c_query_ts_bootloader_info()
306 if (error) { in raydium_i2c_query_ts_bootloader_info()
307 dev_err(&client->dev, "WRT HWID command failed: %d\n", error); in raydium_i2c_query_ts_bootloader_info()
308 return error; in raydium_i2c_query_ts_bootloader_info()
311 error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, rbuf, 1); in raydium_i2c_query_ts_bootloader_info()
312 if (error) { in raydium_i2c_query_ts_bootloader_info()
313 dev_err(&client->dev, "Ack HWID command failed: %d\n", error); in raydium_i2c_query_ts_bootloader_info()
314 return error; in raydium_i2c_query_ts_bootloader_info()
317 error = raydium_i2c_read(client, RM_CMD_BOOT_CHK, rbuf, sizeof(rbuf)); in raydium_i2c_query_ts_bootloader_info()
318 if (error) { in raydium_i2c_query_ts_bootloader_info()
320 error, rbuf + 1); in raydium_i2c_query_ts_bootloader_info()
330 return error; in raydium_i2c_query_ts_bootloader_info()
339 int error, retry_cnt; in raydium_i2c_query_ts_info() local
342 error = raydium_i2c_read(client, RM_CMD_DATA_BANK, in raydium_i2c_query_ts_info()
344 if (error) in raydium_i2c_query_ts_info()
368 error = raydium_i2c_read(client, RM_CMD_QUERY_BANK, in raydium_i2c_query_ts_info()
371 if (error) in raydium_i2c_query_ts_info()
374 error = raydium_i2c_read(client, le32_to_cpu(query_bank_addr), in raydium_i2c_query_ts_info()
376 if (error) in raydium_i2c_query_ts_info()
382 dev_err(&client->dev, "failed to query device parameters: %d\n", error); in raydium_i2c_query_ts_info()
383 return error; in raydium_i2c_query_ts_info()
392 int error; in raydium_i2c_check_fw_status() local
394 error = raydium_i2c_read(client, RM_CMD_BOOT_READ, buf, sizeof(buf)); in raydium_i2c_check_fw_status()
395 if (!error) { in raydium_i2c_check_fw_status()
403 return error; in raydium_i2c_check_fw_status()
409 int error, retry_cnt; in raydium_i2c_initialize() local
415 error = raydium_i2c_check_fw_status(ts); in raydium_i2c_initialize()
416 if (error) { in raydium_i2c_initialize()
418 "failed to read 'hello' packet: %d\n", error); in raydium_i2c_initialize()
428 if (error) in raydium_i2c_initialize()
436 return error; in raydium_i2c_initialize()
445 int error; in raydium_i2c_bl_chk_state() local
453 error = raydium_i2c_read(client, RM_CMD_BOOT_CHK, in raydium_i2c_bl_chk_state()
455 if (!error && rbuf[0] == RM_BOOT_RDY) in raydium_i2c_bl_chk_state()
461 error = raydium_i2c_read(client, RM_CMD_BOOT_CHK, in raydium_i2c_bl_chk_state()
463 if (!error && !memcmp(rbuf, ack_ok, sizeof(ack_ok))) in raydium_i2c_bl_chk_state()
484 int error; in raydium_i2c_write_object() local
487 error = raydium_i2c_send(client, RM_CMD_BOOT_WRT, data, len); in raydium_i2c_write_object()
488 if (error) { in raydium_i2c_write_object()
490 error); in raydium_i2c_write_object()
491 return error; in raydium_i2c_write_object()
494 error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, cmd, sizeof(cmd)); in raydium_i2c_write_object()
495 if (error) { in raydium_i2c_write_object()
496 dev_err(&client->dev, "Ack obj command failed: %d\n", error); in raydium_i2c_write_object()
497 return error; in raydium_i2c_write_object()
500 error = raydium_i2c_bl_chk_state(client, state); in raydium_i2c_write_object()
501 if (error) { in raydium_i2c_write_object()
502 dev_err(&client->dev, "BL check state failed: %d\n", error); in raydium_i2c_write_object()
503 return error; in raydium_i2c_write_object()
520 int error; in raydium_i2c_boot_trigger() local
523 error = raydium_i2c_write_object(client, cmd[i], sizeof(cmd[i]), in raydium_i2c_boot_trigger()
525 if (error) { in raydium_i2c_boot_trigger()
528 i, error); in raydium_i2c_boot_trigger()
529 return error; in raydium_i2c_boot_trigger()
546 int error; in raydium_i2c_fw_trigger() local
549 error = raydium_i2c_write_object(client, cmd[i], sizeof(cmd[i]), in raydium_i2c_fw_trigger()
551 if (error) { in raydium_i2c_fw_trigger()
554 i, error); in raydium_i2c_fw_trigger()
555 return error; in raydium_i2c_fw_trigger()
565 int error; in raydium_i2c_check_path() local
567 error = raydium_i2c_write_object(client, cmd, sizeof(cmd), in raydium_i2c_check_path()
569 if (error) { in raydium_i2c_check_path()
570 dev_err(&client->dev, "check path command failed: %d\n", error); in raydium_i2c_check_path()
571 return error; in raydium_i2c_check_path()
580 int error; in raydium_i2c_enter_bl() local
582 error = raydium_i2c_write_object(client, cal_cmd, sizeof(cal_cmd), in raydium_i2c_enter_bl()
584 if (error) { in raydium_i2c_enter_bl()
585 dev_err(&client->dev, "enter bl command failed: %d\n", error); in raydium_i2c_enter_bl()
586 return error; in raydium_i2c_enter_bl()
596 int error; in raydium_i2c_leave_bl() local
598 error = raydium_i2c_write_object(client, leave_cmd, sizeof(leave_cmd), in raydium_i2c_leave_bl()
600 if (error) { in raydium_i2c_leave_bl()
601 dev_err(&client->dev, "leave bl command failed: %d\n", error); in raydium_i2c_leave_bl()
602 return error; in raydium_i2c_leave_bl()
613 int error; in raydium_i2c_write_checksum() local
618 error = raydium_i2c_write_object(client, in raydium_i2c_write_checksum()
621 if (error) { in raydium_i2c_write_checksum()
623 error); in raydium_i2c_write_checksum()
624 return error; in raydium_i2c_write_checksum()
633 int error; in raydium_i2c_disable_watch_dog() local
635 error = raydium_i2c_write_object(client, cmd, sizeof(cmd), in raydium_i2c_disable_watch_dog()
637 if (error) { in raydium_i2c_disable_watch_dog()
639 error); in raydium_i2c_disable_watch_dog()
640 return error; in raydium_i2c_disable_watch_dog()
651 int error; in raydium_i2c_fw_write_page() local
667 error = raydium_i2c_write_object(client, buf, RM_BL_WRT_LEN, in raydium_i2c_fw_write_page()
669 if (error) { in raydium_i2c_fw_write_page()
672 page_idx, i, error); in raydium_i2c_fw_write_page()
673 return error; in raydium_i2c_fw_write_page()
680 return error; in raydium_i2c_fw_write_page()
703 int error; in raydium_i2c_do_update_firmware() local
711 error = raydium_i2c_check_fw_status(ts); in raydium_i2c_do_update_firmware()
712 if (error) { in raydium_i2c_do_update_firmware()
713 dev_err(&client->dev, "Unable to access IC %d\n", error); in raydium_i2c_do_update_firmware()
714 return error; in raydium_i2c_do_update_firmware()
719 error = raydium_i2c_enter_bl(client); in raydium_i2c_do_update_firmware()
720 if (!error) { in raydium_i2c_do_update_firmware()
721 error = raydium_i2c_check_fw_status(ts); in raydium_i2c_do_update_firmware()
722 if (error) { in raydium_i2c_do_update_firmware()
725 error); in raydium_i2c_do_update_firmware()
726 return error; in raydium_i2c_do_update_firmware()
737 error); in raydium_i2c_do_update_firmware()
742 error = raydium_i2c_disable_watch_dog(client); in raydium_i2c_do_update_firmware()
743 if (error) in raydium_i2c_do_update_firmware()
744 return error; in raydium_i2c_do_update_firmware()
746 error = raydium_i2c_check_path(client); in raydium_i2c_do_update_firmware()
747 if (error) in raydium_i2c_do_update_firmware()
748 return error; in raydium_i2c_do_update_firmware()
750 error = raydium_i2c_boot_trigger(client); in raydium_i2c_do_update_firmware()
751 if (error) { in raydium_i2c_do_update_firmware()
752 dev_err(&client->dev, "send boot trigger fail: %d\n", error); in raydium_i2c_do_update_firmware()
753 return error; in raydium_i2c_do_update_firmware()
765 error = raydium_i2c_fw_write_page(client, page_nr++, data, len); in raydium_i2c_do_update_firmware()
766 if (error) in raydium_i2c_do_update_firmware()
767 return error; in raydium_i2c_do_update_firmware()
775 error = raydium_i2c_leave_bl(client); in raydium_i2c_do_update_firmware()
776 if (error) { in raydium_i2c_do_update_firmware()
778 "failed to leave boot loader: %d\n", error); in raydium_i2c_do_update_firmware()
779 return error; in raydium_i2c_do_update_firmware()
785 error = raydium_i2c_check_fw_status(ts); in raydium_i2c_do_update_firmware()
786 if (error) { in raydium_i2c_do_update_firmware()
789 error); in raydium_i2c_do_update_firmware()
790 return error; in raydium_i2c_do_update_firmware()
796 error); in raydium_i2c_do_update_firmware()
800 error = raydium_i2c_fw_trigger(client); in raydium_i2c_do_update_firmware()
801 if (error) { in raydium_i2c_do_update_firmware()
802 dev_err(&client->dev, "failed to trigger fw: %d\n", error); in raydium_i2c_do_update_firmware()
803 return error; in raydium_i2c_do_update_firmware()
808 error = raydium_i2c_write_checksum(client, fw->size, fw_checksum); in raydium_i2c_do_update_firmware()
809 if (error) in raydium_i2c_do_update_firmware()
810 return error; in raydium_i2c_do_update_firmware()
820 int error; in raydium_i2c_fw_update() local
829 error = request_firmware(&fw, fw_file, &client->dev); in raydium_i2c_fw_update()
830 if (error) { in raydium_i2c_fw_update()
837 error = raydium_i2c_do_update_firmware(ts, fw); in raydium_i2c_fw_update()
838 if (error) { in raydium_i2c_fw_update()
839 dev_err(&client->dev, "firmware update failed: %d\n", error); in raydium_i2c_fw_update()
844 error = raydium_i2c_initialize(ts); in raydium_i2c_fw_update()
845 if (error) { in raydium_i2c_fw_update()
848 error); in raydium_i2c_fw_update()
864 return error; in raydium_i2c_fw_update()
903 int error; in raydium_i2c_irq() local
910 error = raydium_i2c_read(ts->client, ts->data_bank_addr, in raydium_i2c_irq()
912 if (error) in raydium_i2c_irq()
966 int error; in raydium_i2c_update_fw_store() local
968 error = mutex_lock_interruptible(&ts->sysfs_mutex); in raydium_i2c_update_fw_store()
969 if (error) in raydium_i2c_update_fw_store()
970 return error; in raydium_i2c_update_fw_store()
972 error = raydium_i2c_fw_update(ts); in raydium_i2c_update_fw_store()
976 return error ?: count; in raydium_i2c_update_fw_store()
986 int error; in raydium_i2c_calibrate_store() local
988 error = mutex_lock_interruptible(&ts->sysfs_mutex); in raydium_i2c_calibrate_store()
989 if (error) in raydium_i2c_calibrate_store()
990 return error; in raydium_i2c_calibrate_store()
992 error = raydium_i2c_write_object(client, cal_cmd, sizeof(cal_cmd), in raydium_i2c_calibrate_store()
994 if (error) in raydium_i2c_calibrate_store()
995 dev_err(&client->dev, "calibrate command failed: %d\n", error); in raydium_i2c_calibrate_store()
998 return error ?: count; in raydium_i2c_calibrate_store()
1022 int error; in raydium_i2c_power_on() local
1029 error = regulator_enable(ts->avdd); in raydium_i2c_power_on()
1030 if (error) { in raydium_i2c_power_on()
1032 "failed to enable avdd regulator: %d\n", error); in raydium_i2c_power_on()
1036 error = regulator_enable(ts->vccio); in raydium_i2c_power_on()
1037 if (error) { in raydium_i2c_power_on()
1040 "failed to enable vccio regulator: %d\n", error); in raydium_i2c_power_on()
1049 if (error) in raydium_i2c_power_on()
1050 return error; in raydium_i2c_power_on()
1072 int error; in raydium_i2c_probe() local
1105 error = raydium_i2c_power_on(ts); in raydium_i2c_probe()
1106 if (error) in raydium_i2c_probe()
1107 return error; in raydium_i2c_probe()
1109 error = devm_add_action_or_reset(&client->dev, in raydium_i2c_probe()
1111 if (error) { in raydium_i2c_probe()
1113 "failed to install power off action: %d\n", error); in raydium_i2c_probe()
1114 return error; in raydium_i2c_probe()
1124 error = raydium_i2c_initialize(ts); in raydium_i2c_probe()
1125 if (error) { in raydium_i2c_probe()
1126 dev_err(&client->dev, "failed to initialize: %d\n", error); in raydium_i2c_probe()
1127 return error; in raydium_i2c_probe()
1154 error = input_mt_init_slots(ts->input, RM_MAX_TOUCH_NUM, in raydium_i2c_probe()
1156 if (error) { in raydium_i2c_probe()
1158 "failed to initialize MT slots: %d\n", error); in raydium_i2c_probe()
1159 return error; in raydium_i2c_probe()
1162 error = input_register_device(ts->input); in raydium_i2c_probe()
1163 if (error) { in raydium_i2c_probe()
1165 "unable to register input device: %d\n", error); in raydium_i2c_probe()
1166 return error; in raydium_i2c_probe()
1169 error = devm_request_threaded_irq(&client->dev, client->irq, in raydium_i2c_probe()
1172 if (error) { in raydium_i2c_probe()
1174 return error; in raydium_i2c_probe()
1177 error = devm_device_add_group(&client->dev, in raydium_i2c_probe()
1179 if (error) { in raydium_i2c_probe()
1181 error); in raydium_i2c_probe()
1182 return error; in raydium_i2c_probe()
1191 int error; in raydium_enter_sleep() local
1193 error = raydium_i2c_send(client, RM_CMD_ENTER_SLEEP, in raydium_enter_sleep()
1195 if (error) in raydium_enter_sleep()
1197 "sleep command failed: %d\n", error); in raydium_enter_sleep()