Lines Matching refs:error

172 	int error;  in cyapa_get_state()  local
182 error = cyapa_i2c_reg_read_block(cyapa, BL_HEAD_OFFSET, BL_STATUS_SIZE, in cyapa_get_state()
190 if (cyapa->smbus && (error == -ETIMEDOUT || error == -ENXIO)) { in cyapa_get_state()
192 error = cyapa_read_block(cyapa, in cyapa_get_state()
197 if (error != BL_STATUS_SIZE) in cyapa_get_state()
198 goto error; in cyapa_get_state()
210 error = cyapa_gen3_ops.state_parse(cyapa, in cyapa_get_state()
212 if (!error) in cyapa_get_state()
218 error = cyapa_pip_state_parse(cyapa, in cyapa_get_state()
220 if (!error) in cyapa_get_state()
227 error = cyapa_gen5_ops.state_parse(cyapa, in cyapa_get_state()
229 if (!error) in cyapa_get_state()
240 error = cyapa_i2c_write(cyapa, 0, 2, cmd); in cyapa_get_state()
241 if (error) in cyapa_get_state()
242 goto error; in cyapa_get_state()
246 error = cyapa_i2c_read(cyapa, BL_HEAD_OFFSET, in cyapa_get_state()
248 if (error) in cyapa_get_state()
249 goto error; in cyapa_get_state()
253 goto error; in cyapa_get_state()
260 error: in cyapa_get_state()
261 return (error < 0) ? error : -EAGAIN; in cyapa_get_state()
281 int error; in cyapa_poll_state() local
285 error = cyapa_get_state(cyapa); in cyapa_poll_state()
286 if (!error && cyapa->state > CYAPA_STATE_BL_BUSY) in cyapa_poll_state()
292 return (error == -EAGAIN || error == -ETIMEDOUT) ? -ETIMEDOUT : error; in cyapa_poll_state()
313 int error; in cyapa_check_is_operational() local
315 error = cyapa_poll_state(cyapa, 4000); in cyapa_check_is_operational()
316 if (error) in cyapa_check_is_operational()
317 return error; in cyapa_check_is_operational()
333 error = cyapa->ops->operational_check(cyapa); in cyapa_check_is_operational()
334 if (!error && cyapa_is_operational_mode(cyapa)) in cyapa_check_is_operational()
339 return error; in cyapa_check_is_operational()
351 int error; in cyapa_detect() local
353 error = cyapa_check_is_operational(cyapa); in cyapa_detect()
354 if (error) { in cyapa_detect()
355 if (error != -ETIMEDOUT && error != -ENODEV && in cyapa_detect()
361 dev_err(dev, "no device detected: %d\n", error); in cyapa_detect()
362 return error; in cyapa_detect()
373 int error; in cyapa_open() local
375 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_open()
376 if (error) in cyapa_open()
377 return error; in cyapa_open()
385 error = cyapa->ops->set_power_mode(cyapa, in cyapa_open()
387 if (error) { in cyapa_open()
388 dev_warn(dev, "set active power failed: %d\n", error); in cyapa_open()
392 error = cyapa_reinitialize(cyapa); in cyapa_open()
393 if (error || !cyapa->operational) { in cyapa_open()
394 error = error ? error : -EAGAIN; in cyapa_open()
410 return error; in cyapa_open()
437 int error; in cyapa_create_input_dev() local
507 error = input_mt_init_slots(input, CYAPA_MAX_MT_SLOTS, in cyapa_create_input_dev()
509 if (error) { in cyapa_create_input_dev()
510 dev_err(dev, "failed to initialize MT slots: %d\n", error); in cyapa_create_input_dev()
511 return error; in cyapa_create_input_dev()
515 error = input_register_device(input); in cyapa_create_input_dev()
516 if (error) { in cyapa_create_input_dev()
517 dev_err(dev, "failed to register input device: %d\n", error); in cyapa_create_input_dev()
518 return error; in cyapa_create_input_dev()
592 int error = 0; in cyapa_initialize() local
607 error = cyapa_gen3_ops.initialize(cyapa); in cyapa_initialize()
608 if (!error) in cyapa_initialize()
609 error = cyapa_gen5_ops.initialize(cyapa); in cyapa_initialize()
610 if (!error) in cyapa_initialize()
611 error = cyapa_gen6_ops.initialize(cyapa); in cyapa_initialize()
612 if (error) in cyapa_initialize()
613 return error; in cyapa_initialize()
615 error = cyapa_detect(cyapa); in cyapa_initialize()
616 if (error) in cyapa_initialize()
617 return error; in cyapa_initialize()
631 int error; in cyapa_reinitialize() local
641 error = cyapa_detect(cyapa); in cyapa_reinitialize()
642 if (error) in cyapa_reinitialize()
646 error = cyapa_create_input_dev(cyapa); in cyapa_reinitialize()
647 if (error) { in cyapa_reinitialize()
649 error); in cyapa_reinitialize()
660 } else if (!error && cyapa->operational) { in cyapa_reinitialize()
673 return error; in cyapa_reinitialize()
680 int error; in cyapa_irq() local
701 error = cyapa->ops->irq_handler(cyapa); in cyapa_irq()
717 if (!cyapa->operational || error) { in cyapa_irq()
746 int error; in cyapa_show_suspend_scanrate() local
748 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_show_suspend_scanrate()
749 if (error) in cyapa_show_suspend_scanrate()
750 return error; in cyapa_show_suspend_scanrate()
783 int error; in cyapa_update_suspend_scanrate() local
785 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_update_suspend_scanrate()
786 if (error) in cyapa_update_suspend_scanrate()
787 return error; in cyapa_update_suspend_scanrate()
832 int error; in cyapa_prepare_wakeup_controls() local
835 error = sysfs_merge_group(&dev->kobj, in cyapa_prepare_wakeup_controls()
837 if (error) { in cyapa_prepare_wakeup_controls()
839 error); in cyapa_prepare_wakeup_controls()
840 return error; in cyapa_prepare_wakeup_controls()
843 error = devm_add_action_or_reset(dev, in cyapa_prepare_wakeup_controls()
845 if (error) { in cyapa_prepare_wakeup_controls()
847 error); in cyapa_prepare_wakeup_controls()
848 return error; in cyapa_prepare_wakeup_controls()
869 int error; in cyapa_show_rt_suspend_scanrate() local
871 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_show_rt_suspend_scanrate()
872 if (error) in cyapa_show_rt_suspend_scanrate()
873 return error; in cyapa_show_rt_suspend_scanrate()
892 int error; in cyapa_update_rt_suspend_scanrate() local
906 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_update_rt_suspend_scanrate()
907 if (error) in cyapa_update_rt_suspend_scanrate()
908 return error; in cyapa_update_rt_suspend_scanrate()
946 int error; in cyapa_start_runtime() local
952 error = sysfs_merge_group(&dev->kobj, &cyapa_power_runtime_group); in cyapa_start_runtime()
953 if (error) { in cyapa_start_runtime()
955 "failed to create power runtime group: %d\n", error); in cyapa_start_runtime()
956 return error; in cyapa_start_runtime()
959 error = devm_add_action_or_reset(dev, cyapa_remove_power_runtime_group, in cyapa_start_runtime()
961 if (error) { in cyapa_start_runtime()
964 error); in cyapa_start_runtime()
965 return error; in cyapa_start_runtime()
985 int error; in cyapa_show_fm_ver() local
988 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_show_fm_ver()
989 if (error) in cyapa_show_fm_ver()
990 return error; in cyapa_show_fm_ver()
991 error = scnprintf(buf, PAGE_SIZE, "%d.%d\n", cyapa->fw_maj_ver, in cyapa_show_fm_ver()
994 return error; in cyapa_show_fm_ver()
1002 int error; in cyapa_show_product_id() local
1004 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_show_product_id()
1005 if (error) in cyapa_show_product_id()
1006 return error; in cyapa_show_product_id()
1016 int error; in cyapa_firmware() local
1018 error = request_firmware(&fw, fw_name, dev); in cyapa_firmware()
1019 if (error) { in cyapa_firmware()
1021 fw_name, error); in cyapa_firmware()
1022 return error; in cyapa_firmware()
1025 error = cyapa->ops->check_fw(cyapa, fw); in cyapa_firmware()
1026 if (error) { in cyapa_firmware()
1042 error = cyapa->ops->bl_enter(cyapa); in cyapa_firmware()
1043 if (error) { in cyapa_firmware()
1044 dev_err(dev, "bl_enter failed, %d\n", error); in cyapa_firmware()
1048 error = cyapa->ops->bl_activate(cyapa); in cyapa_firmware()
1049 if (error) { in cyapa_firmware()
1050 dev_err(dev, "bl_activate failed, %d\n", error); in cyapa_firmware()
1054 error = cyapa->ops->bl_initiate(cyapa, fw); in cyapa_firmware()
1055 if (error) { in cyapa_firmware()
1056 dev_err(dev, "bl_initiate failed, %d\n", error); in cyapa_firmware()
1060 error = cyapa->ops->update_fw(cyapa, fw); in cyapa_firmware()
1061 if (error) { in cyapa_firmware()
1062 dev_err(dev, "update_fw failed, %d\n", error); in cyapa_firmware()
1072 return error; in cyapa_firmware()
1081 int ret, error; in cyapa_update_fw_store() local
1104 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_update_fw_store()
1105 if (error) { in cyapa_update_fw_store()
1111 return error; in cyapa_update_fw_store()
1114 error = cyapa_firmware(cyapa, fw_name); in cyapa_update_fw_store()
1115 if (error) in cyapa_update_fw_store()
1116 dev_err(dev, "firmware update failed: %d\n", error); in cyapa_update_fw_store()
1127 error = error ? error : ret; in cyapa_update_fw_store()
1132 return error ? error : count; in cyapa_update_fw_store()
1140 int error; in cyapa_calibrate_store() local
1142 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_calibrate_store()
1143 if (error) in cyapa_calibrate_store()
1144 return error; in cyapa_calibrate_store()
1148 error = cyapa->ops->calibrate_store(dev, attr, buf, count); in cyapa_calibrate_store()
1151 error = -EBUSY; /* Still running in bootloader mode. */ in cyapa_calibrate_store()
1155 return error < 0 ? error : count; in cyapa_calibrate_store()
1162 ssize_t error; in cyapa_show_baseline() local
1164 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_show_baseline()
1165 if (error) in cyapa_show_baseline()
1166 return error; in cyapa_show_baseline()
1170 error = cyapa->ops->show_baseline(dev, attr, buf); in cyapa_show_baseline()
1173 error = -EBUSY; /* Still running in bootloader mode. */ in cyapa_show_baseline()
1177 return error; in cyapa_show_baseline()
1206 int error; in cyapa_show_mode() local
1208 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_show_mode()
1209 if (error) in cyapa_show_mode()
1210 return error; in cyapa_show_mode()
1253 int error; in cyapa_probe() local
1281 error = PTR_ERR(cyapa->vcc); in cyapa_probe()
1282 dev_err(dev, "failed to get vcc regulator: %d\n", error); in cyapa_probe()
1283 return error; in cyapa_probe()
1286 error = regulator_enable(cyapa->vcc); in cyapa_probe()
1287 if (error) { in cyapa_probe()
1288 dev_err(dev, "failed to enable regulator: %d\n", error); in cyapa_probe()
1289 return error; in cyapa_probe()
1292 error = devm_add_action_or_reset(dev, cyapa_disable_regulator, cyapa); in cyapa_probe()
1293 if (error) { in cyapa_probe()
1295 error); in cyapa_probe()
1296 return error; in cyapa_probe()
1299 error = cyapa_initialize(cyapa); in cyapa_probe()
1300 if (error) { in cyapa_probe()
1302 return error; in cyapa_probe()
1305 error = devm_device_add_group(dev, &cyapa_sysfs_group); in cyapa_probe()
1306 if (error) { in cyapa_probe()
1307 dev_err(dev, "failed to create sysfs entries: %d\n", error); in cyapa_probe()
1308 return error; in cyapa_probe()
1311 error = cyapa_prepare_wakeup_controls(cyapa); in cyapa_probe()
1312 if (error) { in cyapa_probe()
1313 dev_err(dev, "failed to prepare wakeup controls: %d\n", error); in cyapa_probe()
1314 return error; in cyapa_probe()
1317 error = cyapa_start_runtime(cyapa); in cyapa_probe()
1318 if (error) { in cyapa_probe()
1319 dev_err(dev, "failed to start pm_runtime: %d\n", error); in cyapa_probe()
1320 return error; in cyapa_probe()
1323 error = devm_request_threaded_irq(dev, client->irq, in cyapa_probe()
1327 if (error) { in cyapa_probe()
1328 dev_err(dev, "failed to request threaded irq: %d\n", error); in cyapa_probe()
1329 return error; in cyapa_probe()
1341 error = cyapa_create_input_dev(cyapa); in cyapa_probe()
1342 if (error) { in cyapa_probe()
1344 error); in cyapa_probe()
1345 return error; in cyapa_probe()
1357 int error; in cyapa_suspend() local
1359 error = mutex_lock_interruptible(&cyapa->state_sync_lock); in cyapa_suspend()
1360 if (error) in cyapa_suspend()
1361 return error; in cyapa_suspend()
1379 error = cyapa->ops->set_power_mode(cyapa, power_mode, in cyapa_suspend()
1381 if (error) in cyapa_suspend()
1383 error); in cyapa_suspend()
1404 int error; in cyapa_resume() local
1417 error = cyapa_reinitialize(cyapa); in cyapa_resume()
1418 if (error) in cyapa_resume()
1419 dev_warn(dev, "failed to reinitialize TP device: %d\n", error); in cyapa_resume()
1430 int error; in cyapa_runtime_suspend() local
1432 error = cyapa->ops->set_power_mode(cyapa, in cyapa_runtime_suspend()
1436 if (error) in cyapa_runtime_suspend()
1437 dev_warn(dev, "runtime suspend failed: %d\n", error); in cyapa_runtime_suspend()
1445 int error; in cyapa_runtime_resume() local
1447 error = cyapa->ops->set_power_mode(cyapa, in cyapa_runtime_resume()
1449 if (error) in cyapa_runtime_resume()
1450 dev_warn(dev, "runtime resume failed: %d\n", error); in cyapa_runtime_resume()