Lines Matching full:client
119 struct i2c_client *client; member
149 static int raydium_i2c_xfer(struct i2c_client *client, u32 addr, in raydium_i2c_xfer() argument
160 ret = i2c_transfer(client->adapter, &xfer[xfer_start_idx], xfer_count); in raydium_i2c_xfer()
167 static int raydium_i2c_send(struct i2c_client *client, in raydium_i2c_send() argument
200 .addr = client->addr, in raydium_i2c_send()
205 .addr = client->addr, in raydium_i2c_send()
211 error = raydium_i2c_xfer(client, addr, xfer, ARRAY_SIZE(xfer)); in raydium_i2c_send()
218 dev_err(&client->dev, "%s failed: %d\n", __func__, error); in raydium_i2c_send()
224 static int raydium_i2c_read(struct i2c_client *client, in raydium_i2c_read() argument
249 .addr = client->addr, in raydium_i2c_read()
254 .addr = client->addr, in raydium_i2c_read()
259 .addr = client->addr, in raydium_i2c_read()
266 error = raydium_i2c_xfer(client, addr, xfer, ARRAY_SIZE(xfer)); in raydium_i2c_read()
278 static int raydium_i2c_sw_reset(struct i2c_client *client) in raydium_i2c_sw_reset() argument
283 error = raydium_i2c_send(client, RM_RESET_MSG_ADDR, &soft_rst_cmd, in raydium_i2c_sw_reset()
286 dev_err(&client->dev, "software reset failed: %d\n", error); in raydium_i2c_sw_reset()
297 struct i2c_client *client = ts->client; 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()
307 dev_err(&client->dev, "WRT HWID command failed: %d\n", 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()
313 dev_err(&client->dev, "Ack HWID command failed: %d\n", 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()
319 dev_err(&client->dev, "Read HWID command failed: %d (%4ph)\n", in raydium_i2c_query_ts_bootloader_info()
335 struct i2c_client *client = ts->client; in raydium_i2c_query_ts_info() local
342 error = raydium_i2c_read(client, RM_CMD_DATA_BANK, in raydium_i2c_query_ts_info()
353 dev_warn(&client->dev, in raydium_i2c_query_ts_info()
364 dev_dbg(&client->dev, in raydium_i2c_query_ts_info()
368 error = raydium_i2c_read(client, RM_CMD_QUERY_BANK, in raydium_i2c_query_ts_info()
374 error = raydium_i2c_read(client, le32_to_cpu(query_bank_addr), 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()
388 struct i2c_client *client = ts->client; 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()
408 struct i2c_client *client = ts->client; in raydium_i2c_initialize() local
417 dev_err(&client->dev, in raydium_i2c_initialize()
439 static int raydium_i2c_bl_chk_state(struct i2c_client *client, in raydium_i2c_bl_chk_state() argument
453 error = raydium_i2c_read(client, RM_CMD_BOOT_CHK, in raydium_i2c_bl_chk_state()
461 error = raydium_i2c_read(client, RM_CMD_BOOT_CHK, in raydium_i2c_bl_chk_state()
469 dev_err(&client->dev, "%s: invalid target state %d\n", in raydium_i2c_bl_chk_state()
480 static int raydium_i2c_write_object(struct i2c_client *client, in raydium_i2c_write_object() argument
487 error = raydium_i2c_send(client, RM_CMD_BOOT_WRT, data, len); in raydium_i2c_write_object()
489 dev_err(&client->dev, "WRT obj command failed: %d\n", in raydium_i2c_write_object()
494 error = raydium_i2c_send(client, RM_CMD_BOOT_ACK, cmd, sizeof(cmd)); in raydium_i2c_write_object()
496 dev_err(&client->dev, "Ack obj command failed: %d\n", error); in raydium_i2c_write_object()
500 error = raydium_i2c_bl_chk_state(client, state); in raydium_i2c_write_object()
502 dev_err(&client->dev, "BL check state failed: %d\n", error); in raydium_i2c_write_object()
508 static int raydium_i2c_boot_trigger(struct i2c_client *client) in raydium_i2c_boot_trigger() argument
523 error = raydium_i2c_write_object(client, cmd[i], sizeof(cmd[i]), in raydium_i2c_boot_trigger()
526 dev_err(&client->dev, in raydium_i2c_boot_trigger()
536 static int raydium_i2c_fw_trigger(struct i2c_client *client) in raydium_i2c_fw_trigger() argument
549 error = raydium_i2c_write_object(client, cmd[i], sizeof(cmd[i]), in raydium_i2c_fw_trigger()
552 dev_err(&client->dev, in raydium_i2c_fw_trigger()
562 static int raydium_i2c_check_path(struct i2c_client *client) in raydium_i2c_check_path() argument
567 error = raydium_i2c_write_object(client, cmd, sizeof(cmd), in raydium_i2c_check_path()
570 dev_err(&client->dev, "check path command failed: %d\n", error); in raydium_i2c_check_path()
577 static int raydium_i2c_enter_bl(struct i2c_client *client) in raydium_i2c_enter_bl() argument
582 error = raydium_i2c_write_object(client, cal_cmd, sizeof(cal_cmd), in raydium_i2c_enter_bl()
585 dev_err(&client->dev, "enter bl command failed: %d\n", error); in raydium_i2c_enter_bl()
593 static int raydium_i2c_leave_bl(struct i2c_client *client) in raydium_i2c_leave_bl() argument
598 error = raydium_i2c_write_object(client, leave_cmd, sizeof(leave_cmd), in raydium_i2c_leave_bl()
601 dev_err(&client->dev, "leave bl command failed: %d\n", error); in raydium_i2c_leave_bl()
609 static int raydium_i2c_write_checksum(struct i2c_client *client, in raydium_i2c_write_checksum() argument
618 error = raydium_i2c_write_object(client, in raydium_i2c_write_checksum()
622 dev_err(&client->dev, "failed to write checksum: %d\n", in raydium_i2c_write_checksum()
630 static int raydium_i2c_disable_watch_dog(struct i2c_client *client) in raydium_i2c_disable_watch_dog() argument
635 error = raydium_i2c_write_object(client, cmd, sizeof(cmd), in raydium_i2c_disable_watch_dog()
638 dev_err(&client->dev, "disable watchdog command failed: %d\n", in raydium_i2c_disable_watch_dog()
646 static int raydium_i2c_fw_write_page(struct i2c_client *client, in raydium_i2c_fw_write_page() argument
667 error = raydium_i2c_write_object(client, buf, RM_BL_WRT_LEN, in raydium_i2c_fw_write_page()
670 dev_err(&client->dev, in raydium_i2c_fw_write_page()
697 struct i2c_client *client = ts->client; in raydium_i2c_do_update_firmware() local
707 dev_err(&client->dev, "Invalid firmware length\n"); in raydium_i2c_do_update_firmware()
713 dev_err(&client->dev, "Unable to access IC %d\n", error); in raydium_i2c_do_update_firmware()
719 error = raydium_i2c_enter_bl(client); in raydium_i2c_do_update_firmware()
723 dev_err(&client->dev, in raydium_i2c_do_update_firmware()
735 dev_err(&client->dev, in raydium_i2c_do_update_firmware()
742 error = raydium_i2c_disable_watch_dog(client); in raydium_i2c_do_update_firmware()
746 error = raydium_i2c_check_path(client); in raydium_i2c_do_update_firmware()
750 error = raydium_i2c_boot_trigger(client); in raydium_i2c_do_update_firmware()
752 dev_err(&client->dev, "send boot trigger fail: %d\n", 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()
775 error = raydium_i2c_leave_bl(client); in raydium_i2c_do_update_firmware()
777 dev_err(&client->dev, in raydium_i2c_do_update_firmware()
782 dev_dbg(&client->dev, "left boot loader mode\n"); in raydium_i2c_do_update_firmware()
787 dev_err(&client->dev, in raydium_i2c_do_update_firmware()
794 dev_err(&client->dev, in raydium_i2c_do_update_firmware()
800 error = raydium_i2c_fw_trigger(client); in raydium_i2c_do_update_firmware()
802 dev_err(&client->dev, "failed to trigger fw: %d\n", error); in raydium_i2c_do_update_firmware()
808 error = raydium_i2c_write_checksum(client, fw->size, fw_checksum); in raydium_i2c_do_update_firmware()
817 struct i2c_client *client = ts->client; in raydium_i2c_fw_update() local
827 dev_dbg(&client->dev, "firmware name: %s\n", fw_file); in raydium_i2c_fw_update()
829 error = request_firmware(&fw, fw_file, &client->dev); in raydium_i2c_fw_update()
831 dev_err(&client->dev, "Unable to open firmware %s\n", fw_file); in raydium_i2c_fw_update()
835 disable_irq(client->irq); in raydium_i2c_fw_update()
839 dev_err(&client->dev, "firmware update failed: %d\n", error); in raydium_i2c_fw_update()
846 dev_err(&client->dev, in raydium_i2c_fw_update()
856 enable_irq(client->irq); in raydium_i2c_fw_update()
910 error = raydium_i2c_read(ts->client, ts->data_bank_addr, in raydium_i2c_irq()
918 dev_warn(&ts->client->dev, in raydium_i2c_irq()
933 struct i2c_client *client = to_i2c_client(dev); in raydium_i2c_fw_ver_show() local
934 struct raydium_data *ts = i2c_get_clientdata(client); in raydium_i2c_fw_ver_show()
942 struct i2c_client *client = to_i2c_client(dev); in raydium_i2c_hw_ver_show() local
943 struct raydium_data *ts = i2c_get_clientdata(client); in raydium_i2c_hw_ver_show()
952 struct i2c_client *client = to_i2c_client(dev); in raydium_i2c_boot_mode_show() local
953 struct raydium_data *ts = i2c_get_clientdata(client); in raydium_i2c_boot_mode_show()
964 struct i2c_client *client = to_i2c_client(dev); in raydium_i2c_update_fw_store() local
965 struct raydium_data *ts = i2c_get_clientdata(client); in raydium_i2c_update_fw_store()
983 struct i2c_client *client = to_i2c_client(dev); in raydium_i2c_calibrate_store() local
984 struct raydium_data *ts = i2c_get_clientdata(client); in raydium_i2c_calibrate_store()
992 error = raydium_i2c_write_object(client, cal_cmd, sizeof(cal_cmd), in raydium_i2c_calibrate_store()
995 dev_err(&client->dev, "calibrate command failed: %d\n", error); in raydium_i2c_calibrate_store()
1028 dev_err(&ts->client->dev, in raydium_i2c_power_on()
1036 dev_err(&ts->client->dev, in raydium_i2c_power_on()
1065 static int raydium_i2c_probe(struct i2c_client *client) in raydium_i2c_probe() argument
1071 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { in raydium_i2c_probe()
1072 dev_err(&client->dev, in raydium_i2c_probe()
1077 ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); in raydium_i2c_probe()
1083 ts->client = client; in raydium_i2c_probe()
1084 i2c_set_clientdata(client, ts); in raydium_i2c_probe()
1086 ts->avdd = devm_regulator_get(&client->dev, "avdd"); in raydium_i2c_probe()
1088 return dev_err_probe(&client->dev, PTR_ERR(ts->avdd), in raydium_i2c_probe()
1091 ts->vccio = devm_regulator_get(&client->dev, "vccio"); in raydium_i2c_probe()
1093 return dev_err_probe(&client->dev, PTR_ERR(ts->vccio), in raydium_i2c_probe()
1096 ts->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", in raydium_i2c_probe()
1099 return dev_err_probe(&client->dev, PTR_ERR(ts->reset_gpio), in raydium_i2c_probe()
1106 error = devm_add_action_or_reset(&client->dev, in raydium_i2c_probe()
1109 dev_err(&client->dev, in raydium_i2c_probe()
1115 if (i2c_smbus_xfer(client->adapter, client->addr, 0, in raydium_i2c_probe()
1117 dev_err(&client->dev, "nothing at this address\n"); in raydium_i2c_probe()
1123 dev_err(&client->dev, "failed to initialize: %d\n", error); in raydium_i2c_probe()
1127 ts->report_data = devm_kmalloc(&client->dev, in raydium_i2c_probe()
1132 ts->input = devm_input_allocate_device(&client->dev); in raydium_i2c_probe()
1134 dev_err(&client->dev, "Failed to allocate input device\n"); in raydium_i2c_probe()
1154 dev_err(&client->dev, in raydium_i2c_probe()
1161 dev_err(&client->dev, in raydium_i2c_probe()
1166 error = devm_request_threaded_irq(&client->dev, client->irq, in raydium_i2c_probe()
1168 IRQF_ONESHOT, client->name, ts); in raydium_i2c_probe()
1170 dev_err(&client->dev, "Failed to register interrupt\n"); in raydium_i2c_probe()
1177 static void raydium_enter_sleep(struct i2c_client *client) in raydium_enter_sleep() argument
1182 error = raydium_i2c_send(client, RM_CMD_ENTER_SLEEP, in raydium_enter_sleep()
1185 dev_err(&client->dev, in raydium_enter_sleep()
1191 struct i2c_client *client = to_i2c_client(dev); in raydium_i2c_suspend() local
1192 struct raydium_data *ts = i2c_get_clientdata(client); in raydium_i2c_suspend()
1198 disable_irq(client->irq); in raydium_i2c_suspend()
1201 raydium_enter_sleep(client); in raydium_i2c_suspend()
1211 struct i2c_client *client = to_i2c_client(dev); in raydium_i2c_resume() local
1212 struct raydium_data *ts = i2c_get_clientdata(client); in raydium_i2c_resume()
1215 raydium_i2c_sw_reset(client); in raydium_i2c_resume()
1221 enable_irq(client->irq); in raydium_i2c_resume()