Lines Matching refs:error
142 int error; in elan_i2c_initialize() local
145 error = elan_i2c_write_cmd(client, ETP_I2C_STAND_CMD, ETP_I2C_RESET); in elan_i2c_initialize()
146 if (error) { in elan_i2c_initialize()
147 dev_err(dev, "device reset failed: %d\n", error); in elan_i2c_initialize()
148 return error; in elan_i2c_initialize()
155 error = i2c_master_recv(client, val, ETP_I2C_INF_LENGTH); in elan_i2c_initialize()
156 if (error < 0) { in elan_i2c_initialize()
157 dev_err(dev, "failed to read reset response: %d\n", error); in elan_i2c_initialize()
158 return error; in elan_i2c_initialize()
161 error = elan_i2c_read_block(client, ETP_I2C_DESC_CMD, in elan_i2c_initialize()
163 if (error) { in elan_i2c_initialize()
164 dev_err(dev, "cannot get device descriptor: %d\n", error); in elan_i2c_initialize()
165 return error; in elan_i2c_initialize()
168 error = elan_i2c_read_block(client, ETP_I2C_REPORT_DESC_CMD, in elan_i2c_initialize()
170 if (error) { in elan_i2c_initialize()
171 dev_err(dev, "fetching report descriptor failed.: %d\n", error); in elan_i2c_initialize()
172 return error; in elan_i2c_initialize()
188 int error; in elan_i2c_power_control() local
190 error = elan_i2c_read_cmd(client, ETP_I2C_POWER_CMD, val); in elan_i2c_power_control()
191 if (error) { in elan_i2c_power_control()
194 error); in elan_i2c_power_control()
195 return error; in elan_i2c_power_control()
204 error = elan_i2c_write_cmd(client, ETP_I2C_POWER_CMD, reg); in elan_i2c_power_control()
205 if (error) { in elan_i2c_power_control()
208 error); in elan_i2c_power_control()
209 return error; in elan_i2c_power_control()
234 int error; in elan_i2c_get_baseline_data() local
237 error = elan_i2c_read_cmd(client, in elan_i2c_get_baseline_data()
241 if (error) in elan_i2c_get_baseline_data()
242 return error; in elan_i2c_get_baseline_data()
251 int error; in elan_i2c_get_pattern() local
254 error = elan_i2c_read_cmd(client, ETP_I2C_PATTERN_CMD, val); in elan_i2c_get_pattern()
255 if (error) { in elan_i2c_get_pattern()
256 dev_err(&client->dev, "failed to get pattern: %d\n", error); in elan_i2c_get_pattern()
257 return error; in elan_i2c_get_pattern()
273 int error; in elan_i2c_get_version() local
284 error = elan_i2c_read_cmd(client, cmd, val); in elan_i2c_get_version()
285 if (error) { in elan_i2c_get_version()
287 iap ? "IAP" : "FW", error); in elan_i2c_get_version()
288 return error; in elan_i2c_get_version()
301 int error; in elan_i2c_get_sm_version() local
305 error = elan_i2c_read_cmd(client, ETP_I2C_IC_TYPE_CMD, val); in elan_i2c_get_sm_version()
306 if (error) { in elan_i2c_get_sm_version()
308 error); in elan_i2c_get_sm_version()
309 return error; in elan_i2c_get_sm_version()
313 error = elan_i2c_read_cmd(client, ETP_I2C_NSM_VERSION_CMD, in elan_i2c_get_sm_version()
315 if (error) { in elan_i2c_get_sm_version()
317 error); in elan_i2c_get_sm_version()
318 return error; in elan_i2c_get_sm_version()
323 error = elan_i2c_read_cmd(client, ETP_I2C_OSM_VERSION_CMD, val); in elan_i2c_get_sm_version()
324 if (error) { in elan_i2c_get_sm_version()
326 error); in elan_i2c_get_sm_version()
327 return error; in elan_i2c_get_sm_version()
331 error = elan_i2c_read_cmd(client, ETP_I2C_IC_TYPE_P0_CMD, val); in elan_i2c_get_sm_version()
332 if (error) { in elan_i2c_get_sm_version()
334 error); in elan_i2c_get_sm_version()
335 return error; in elan_i2c_get_sm_version()
339 error = elan_i2c_read_cmd(client, ETP_I2C_NSM_VERSION_CMD, in elan_i2c_get_sm_version()
341 if (error) { in elan_i2c_get_sm_version()
343 error); in elan_i2c_get_sm_version()
344 return error; in elan_i2c_get_sm_version()
354 int error; in elan_i2c_get_product_id() local
357 error = elan_i2c_read_cmd(client, ETP_I2C_UNIQUEID_CMD, val); in elan_i2c_get_product_id()
358 if (error) { in elan_i2c_get_product_id()
359 dev_err(&client->dev, "failed to get product ID: %d\n", error); in elan_i2c_get_product_id()
360 return error; in elan_i2c_get_product_id()
370 int error; in elan_i2c_get_checksum() local
373 error = elan_i2c_read_cmd(client, in elan_i2c_get_checksum()
377 if (error) { in elan_i2c_get_checksum()
379 iap ? "IAP" : "FW", error); in elan_i2c_get_checksum()
380 return error; in elan_i2c_get_checksum()
390 int error; in elan_i2c_get_max() local
393 error = elan_i2c_read_cmd(client, ETP_I2C_MAX_X_AXIS_CMD, val); in elan_i2c_get_max()
394 if (error) { in elan_i2c_get_max()
395 dev_err(&client->dev, "failed to get X dimension: %d\n", error); in elan_i2c_get_max()
396 return error; in elan_i2c_get_max()
401 error = elan_i2c_read_cmd(client, ETP_I2C_MAX_Y_AXIS_CMD, val); in elan_i2c_get_max()
402 if (error) { in elan_i2c_get_max()
403 dev_err(&client->dev, "failed to get Y dimension: %d\n", error); in elan_i2c_get_max()
404 return error; in elan_i2c_get_max()
415 int error; in elan_i2c_get_resolution() local
418 error = elan_i2c_read_cmd(client, ETP_I2C_RESOLUTION_CMD, val); in elan_i2c_get_resolution()
419 if (error) { in elan_i2c_get_resolution()
420 dev_err(&client->dev, "failed to get resolution: %d\n", error); in elan_i2c_get_resolution()
421 return error; in elan_i2c_get_resolution()
434 int error; in elan_i2c_get_num_traces() local
437 error = elan_i2c_read_cmd(client, ETP_I2C_XY_TRACENUM_CMD, val); in elan_i2c_get_num_traces()
438 if (error) { in elan_i2c_get_num_traces()
439 dev_err(&client->dev, "failed to get trace info: %d\n", error); in elan_i2c_get_num_traces()
440 return error; in elan_i2c_get_num_traces()
452 int error; in elan_i2c_get_pressure_adjustment() local
455 error = elan_i2c_read_cmd(client, ETP_I2C_PRESSURE_CMD, val); in elan_i2c_get_pressure_adjustment()
456 if (error) { in elan_i2c_get_pressure_adjustment()
458 error); in elan_i2c_get_pressure_adjustment()
459 return error; in elan_i2c_get_pressure_adjustment()
472 int error; in elan_i2c_iap_get_mode() local
476 error = elan_i2c_read_cmd(client, ETP_I2C_IAP_CTRL_CMD, val); in elan_i2c_iap_get_mode()
477 if (error) { in elan_i2c_iap_get_mode()
480 error); in elan_i2c_iap_get_mode()
481 return error; in elan_i2c_iap_get_mode()
494 int error; in elan_i2c_iap_reset() local
496 error = elan_i2c_write_cmd(client, ETP_I2C_IAP_RESET_CMD, in elan_i2c_iap_reset()
498 if (error) { in elan_i2c_iap_reset()
499 dev_err(&client->dev, "cannot reset IC: %d\n", error); in elan_i2c_iap_reset()
500 return error; in elan_i2c_iap_reset()
508 int error; in elan_i2c_set_flash_key() local
510 error = elan_i2c_write_cmd(client, ETP_I2C_IAP_CMD, in elan_i2c_set_flash_key()
512 if (error) { in elan_i2c_set_flash_key()
513 dev_err(&client->dev, "cannot set flash key: %d\n", error); in elan_i2c_set_flash_key()
514 return error; in elan_i2c_set_flash_key()
522 int error; in elan_read_write_iap_type() local
528 error = elan_i2c_write_cmd(client, ETP_I2C_IAP_TYPE_CMD, in elan_read_write_iap_type()
530 if (error) { in elan_read_write_iap_type()
532 "cannot write iap type: %d\n", error); in elan_read_write_iap_type()
533 return error; in elan_read_write_iap_type()
536 error = elan_i2c_read_cmd(client, ETP_I2C_IAP_TYPE_CMD, val); in elan_read_write_iap_type()
537 if (error) { in elan_read_write_iap_type()
540 error); in elan_read_write_iap_type()
541 return error; in elan_read_write_iap_type()
559 int error; in elan_i2c_prepare_fw_update() local
565 error = elan_i2c_iap_get_mode(client, &mode); in elan_i2c_prepare_fw_update()
566 if (error) in elan_i2c_prepare_fw_update()
567 return error; in elan_i2c_prepare_fw_update()
571 error = elan_i2c_iap_reset(client); in elan_i2c_prepare_fw_update()
572 if (error) in elan_i2c_prepare_fw_update()
573 return error; in elan_i2c_prepare_fw_update()
579 error = elan_i2c_set_flash_key(client); in elan_i2c_prepare_fw_update()
580 if (error) in elan_i2c_prepare_fw_update()
581 return error; in elan_i2c_prepare_fw_update()
587 error = elan_i2c_iap_get_mode(client, &mode); in elan_i2c_prepare_fw_update()
588 if (error) in elan_i2c_prepare_fw_update()
589 return error; in elan_i2c_prepare_fw_update()
597 error = elan_read_write_iap_type(client, fw_page_size); in elan_i2c_prepare_fw_update()
598 if (error) in elan_i2c_prepare_fw_update()
599 return error; in elan_i2c_prepare_fw_update()
603 error = elan_i2c_set_flash_key(client); in elan_i2c_prepare_fw_update()
604 if (error) in elan_i2c_prepare_fw_update()
605 return error; in elan_i2c_prepare_fw_update()
611 error = elan_i2c_read_cmd(client, ETP_I2C_IAP_CMD, val); in elan_i2c_prepare_fw_update()
612 if (error) { in elan_i2c_prepare_fw_update()
614 error); in elan_i2c_prepare_fw_update()
615 return error; in elan_i2c_prepare_fw_update()
634 int ret, error; in elan_i2c_write_fw_block() local
648 error = ret < 0 ? ret : -EIO; in elan_i2c_write_fw_block()
649 dev_err(dev, "Failed to write page %d: %d\n", idx, error); in elan_i2c_write_fw_block()
656 error = elan_i2c_read_cmd(client, ETP_I2C_IAP_CTRL_CMD, val); in elan_i2c_write_fw_block()
657 if (error) { in elan_i2c_write_fw_block()
658 dev_err(dev, "Failed to read IAP write result: %d\n", error); in elan_i2c_write_fw_block()
666 error = -EIO; in elan_i2c_write_fw_block()
672 return error; in elan_i2c_write_fw_block()
679 int error = 0; in elan_i2c_finish_fw_update() local
685 error = len < 0 ? len : -EIO; in elan_i2c_finish_fw_update()
687 error, len); in elan_i2c_finish_fw_update()
693 error = elan_i2c_write_cmd(client, ETP_I2C_STAND_CMD, ETP_I2C_RESET); in elan_i2c_finish_fw_update()
694 if (error) { in elan_i2c_finish_fw_update()
695 dev_err(dev, "device reset failed: %d\n", error); in elan_i2c_finish_fw_update()
699 error = -ETIMEDOUT; in elan_i2c_finish_fw_update()
704 if (error) in elan_i2c_finish_fw_update()
705 return error; in elan_i2c_finish_fw_update()
709 error = len < 0 ? len : -EIO; in elan_i2c_finish_fw_update()
711 error, len); in elan_i2c_finish_fw_update()
712 return error; in elan_i2c_finish_fw_update()