Lines Matching refs:rc

84 	int rc;  in cyttsp4_load_status_regs()  local
86 rc = cyttsp4_adap_read(cd, CY_REG_BASE, si->si_ofs.mode_size, in cyttsp4_load_status_regs()
88 if (rc < 0) in cyttsp4_load_status_regs()
90 __func__, rc); in cyttsp4_load_status_regs()
95 return rc; in cyttsp4_load_status_regs()
101 int rc; in cyttsp4_handshake() local
110 rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(cmd), &cmd); in cyttsp4_handshake()
111 if (rc < 0) in cyttsp4_handshake()
113 __func__, rc); in cyttsp4_handshake()
115 return rc; in cyttsp4_handshake()
121 int rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(cmd), &cmd); in cyttsp4_hw_soft_reset() local
122 if (rc < 0) { in cyttsp4_hw_soft_reset()
125 return rc; in cyttsp4_hw_soft_reset()
143 int rc = cyttsp4_hw_hard_reset(cd); in cyttsp4_hw_reset() local
144 if (rc == -ENOSYS) in cyttsp4_hw_reset()
145 rc = cyttsp4_hw_soft_reset(cd); in cyttsp4_hw_reset()
146 return rc; in cyttsp4_hw_reset()
163 int rc = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(si->si_data), in cyttsp4_si_data_offsets() local
165 if (rc < 0) { in cyttsp4_si_data_offsets()
167 __func__, rc); in cyttsp4_si_data_offsets()
168 return rc; in cyttsp4_si_data_offsets()
193 return rc; in cyttsp4_si_data_offsets()
202 int rc; in cyttsp4_si_get_cydata() local
218 rc = cyttsp4_adap_read(cd, read_offset, in cyttsp4_si_get_cydata()
222 if (rc < 0) { in cyttsp4_si_get_cydata()
224 __func__, rc); in cyttsp4_si_get_cydata()
225 return rc; in cyttsp4_si_get_cydata()
241 rc = cyttsp4_adap_read(cd, read_offset, si->si_ptrs.cydata->mfgid_sz, in cyttsp4_si_get_cydata()
243 if (rc < 0) { in cyttsp4_si_get_cydata()
245 __func__, rc); in cyttsp4_si_get_cydata()
246 return rc; in cyttsp4_si_get_cydata()
252 rc = cyttsp4_adap_read(cd, read_offset, in cyttsp4_si_get_cydata()
256 if (rc < 0) { in cyttsp4_si_get_cydata()
258 __func__, rc); in cyttsp4_si_get_cydata()
259 return rc; in cyttsp4_si_get_cydata()
264 return rc; in cyttsp4_si_get_cydata()
271 int rc; in cyttsp4_si_get_test_data() local
282 rc = cyttsp4_adap_read(cd, si->si_ofs.test_ofs, si->si_ofs.test_size, in cyttsp4_si_get_test_data()
284 if (rc < 0) { in cyttsp4_si_get_test_data()
286 __func__, rc); in cyttsp4_si_get_test_data()
287 return rc; in cyttsp4_si_get_test_data()
315 return rc; in cyttsp4_si_get_test_data()
322 int rc; in cyttsp4_si_get_pcfg_data() local
328 rc = -ENOMEM; in cyttsp4_si_get_pcfg_data()
330 __func__, rc); in cyttsp4_si_get_pcfg_data()
331 return rc; in cyttsp4_si_get_pcfg_data()
335 rc = cyttsp4_adap_read(cd, si->si_ofs.pcfg_ofs, si->si_ofs.pcfg_size, in cyttsp4_si_get_pcfg_data()
337 if (rc < 0) { in cyttsp4_si_get_pcfg_data()
339 __func__, rc); in cyttsp4_si_get_pcfg_data()
340 return rc; in cyttsp4_si_get_pcfg_data()
357 return rc; in cyttsp4_si_get_pcfg_data()
368 int rc; in cyttsp4_si_get_opcfg_data() local
375 rc = -ENOMEM; in cyttsp4_si_get_opcfg_data()
380 rc = cyttsp4_adap_read(cd, si->si_ofs.opcfg_ofs, si->si_ofs.opcfg_size, in cyttsp4_si_get_opcfg_data()
382 if (rc < 0) { in cyttsp4_si_get_opcfg_data()
384 __func__, rc); in cyttsp4_si_get_opcfg_data()
451 return rc; in cyttsp4_si_get_opcfg_data()
458 int rc; in cyttsp4_si_get_ddata() local
469 rc = cyttsp4_adap_read(cd, si->si_ofs.ddata_ofs, si->si_ofs.ddata_size, in cyttsp4_si_get_ddata()
471 if (rc < 0) in cyttsp4_si_get_ddata()
473 __func__, rc); in cyttsp4_si_get_ddata()
478 return rc; in cyttsp4_si_get_ddata()
485 int rc; in cyttsp4_si_get_mdata() local
496 rc = cyttsp4_adap_read(cd, si->si_ofs.mdata_ofs, si->si_ofs.mdata_size, in cyttsp4_si_get_mdata()
498 if (rc < 0) in cyttsp4_si_get_mdata()
500 __func__, rc); in cyttsp4_si_get_mdata()
505 return rc; in cyttsp4_si_get_mdata()
515 int rc = 0; in cyttsp4_si_get_btn_data() local
552 return rc; in cyttsp4_si_get_btn_data()
558 return rc; in cyttsp4_si_get_btn_data()
654 int rc; in cyttsp4_get_sysinfo_regs() local
656 rc = cyttsp4_si_data_offsets(cd); in cyttsp4_get_sysinfo_regs()
657 if (rc < 0) in cyttsp4_get_sysinfo_regs()
658 return rc; in cyttsp4_get_sysinfo_regs()
660 rc = cyttsp4_si_get_cydata(cd); in cyttsp4_get_sysinfo_regs()
661 if (rc < 0) in cyttsp4_get_sysinfo_regs()
662 return rc; in cyttsp4_get_sysinfo_regs()
664 rc = cyttsp4_si_get_test_data(cd); in cyttsp4_get_sysinfo_regs()
665 if (rc < 0) in cyttsp4_get_sysinfo_regs()
666 return rc; in cyttsp4_get_sysinfo_regs()
668 rc = cyttsp4_si_get_pcfg_data(cd); in cyttsp4_get_sysinfo_regs()
669 if (rc < 0) in cyttsp4_get_sysinfo_regs()
670 return rc; in cyttsp4_get_sysinfo_regs()
672 rc = cyttsp4_si_get_opcfg_data(cd); in cyttsp4_get_sysinfo_regs()
673 if (rc < 0) in cyttsp4_get_sysinfo_regs()
674 return rc; in cyttsp4_get_sysinfo_regs()
676 rc = cyttsp4_si_get_ddata(cd); in cyttsp4_get_sysinfo_regs()
677 if (rc < 0) in cyttsp4_get_sysinfo_regs()
678 return rc; in cyttsp4_get_sysinfo_regs()
680 rc = cyttsp4_si_get_mdata(cd); in cyttsp4_get_sysinfo_regs()
681 if (rc < 0) in cyttsp4_get_sysinfo_regs()
682 return rc; in cyttsp4_get_sysinfo_regs()
684 rc = cyttsp4_si_get_btn_data(cd); in cyttsp4_get_sysinfo_regs()
685 if (rc < 0) in cyttsp4_get_sysinfo_regs()
686 return rc; in cyttsp4_get_sysinfo_regs()
688 rc = cyttsp4_si_get_op_data_ptrs(cd); in cyttsp4_get_sysinfo_regs()
689 if (rc < 0) { in cyttsp4_get_sysinfo_regs()
692 return rc; in cyttsp4_get_sysinfo_regs()
698 rc = cyttsp4_handshake(cd, si->si_data.hst_mode); in cyttsp4_get_sysinfo_regs()
699 if (rc < 0) in cyttsp4_get_sysinfo_regs()
704 return rc; in cyttsp4_get_sysinfo_regs()
946 int rc = 0; in cyttsp4_xy_worker() local
978 rc = cyttsp4_adap_read(cd, si->si_ofs.tt_stat_ofs + 1, in cyttsp4_xy_worker()
981 if (rc < 0) { in cyttsp4_xy_worker()
983 __func__, rc); in cyttsp4_xy_worker()
995 rc = 0; in cyttsp4_xy_worker()
1016 rc = 0; in cyttsp4_xy_worker()
1019 return rc; in cyttsp4_xy_worker()
1026 int rc = 0; in cyttsp4_mt_attention() local
1034 rc = cyttsp4_xy_worker(cd); in cyttsp4_mt_attention()
1040 if (rc < 0) in cyttsp4_mt_attention()
1041 dev_err(dev, "%s: xy_worker error r=%d\n", __func__, rc); in cyttsp4_mt_attention()
1043 return rc; in cyttsp4_mt_attention()
1053 int rc; in cyttsp4_irq() local
1073 rc = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), mode); in cyttsp4_irq()
1074 if (rc) { in cyttsp4_irq()
1075 dev_err(cd->dev, "%s: Fail read adapter r=%d\n", __func__, rc); in cyttsp4_irq()
1188 rc = cyttsp4_load_status_regs(cd); in cyttsp4_irq()
1189 if (rc < 0) in cyttsp4_irq()
1191 __func__, rc); in cyttsp4_irq()
1199 __func__, mode[0], rc); in cyttsp4_irq()
1200 rc = cyttsp4_handshake(cd, mode[0]); in cyttsp4_irq()
1201 if (rc < 0) in cyttsp4_irq()
1203 __func__, mode[0], rc); in cyttsp4_irq()
1312 int rc = 0; in cyttsp4_wait_bl_heartbeat() local
1321 rc = -ETIME; in cyttsp4_wait_bl_heartbeat()
1324 return rc; in cyttsp4_wait_bl_heartbeat()
1349 int rc; in cyttsp4_reset_and_wait() local
1354 rc = cyttsp4_hw_reset(cd); in cyttsp4_reset_and_wait()
1357 if (rc < 0) { in cyttsp4_reset_and_wait()
1358 dev_err(cd->dev, "%s:Fail hw reset r=%d\n", __func__, rc); in cyttsp4_reset_and_wait()
1359 return rc; in cyttsp4_reset_and_wait()
1374 int rc; in cyttsp4_set_mode() local
1398 rc = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), &mode); in cyttsp4_set_mode()
1399 if (rc < 0) { in cyttsp4_set_mode()
1402 __func__, rc); in cyttsp4_set_mode()
1411 rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(mode), &mode); in cyttsp4_set_mode()
1413 if (rc < 0) { in cyttsp4_set_mode()
1415 __func__, rc); in cyttsp4_set_mode()
1432 rc = -EINVAL; in cyttsp4_set_mode()
1436 return rc; in cyttsp4_set_mode()
1474 int rc = 0; in cyttsp4_core_sleep_() local
1493 rc = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), &mode); in cyttsp4_core_sleep_()
1494 if (rc) { in cyttsp4_core_sleep_()
1496 dev_err(cd->dev, "%s: Fail read adapter r=%d\n", __func__, rc); in cyttsp4_core_sleep_()
1503 rc = -EINVAL; in cyttsp4_core_sleep_()
1508 rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(mode[0]), &mode[0]); in cyttsp4_core_sleep_()
1510 if (rc) { in cyttsp4_core_sleep_()
1511 dev_err(cd->dev, "%s: Fail write adapter r=%d\n", __func__, rc); in cyttsp4_core_sleep_()
1518 rc = cd->cpdata->power(cd->cpdata, 0, cd->dev, &cd->ignore_irq); in cyttsp4_core_sleep_()
1521 rc = 0; in cyttsp4_core_sleep_()
1523 if (rc < 0) { in cyttsp4_core_sleep_()
1525 __func__, rc); in cyttsp4_core_sleep_()
1545 return rc; in cyttsp4_core_sleep_()
1551 int rc; in cyttsp4_startup_() local
1561 rc = cyttsp4_reset_and_wait(cd); in cyttsp4_startup_()
1562 if (rc < 0) { in cyttsp4_startup_()
1563 dev_err(cd->dev, "%s: Error on h/w reset r=%d\n", __func__, rc); in cyttsp4_startup_()
1575 rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(ldr_exit), in cyttsp4_startup_()
1578 if (rc < 0) { in cyttsp4_startup_()
1579 dev_err(cd->dev, "%s: Fail write r=%d\n", __func__, rc); in cyttsp4_startup_()
1585 rc = cyttsp4_wait_sysinfo_mode(cd); in cyttsp4_startup_()
1586 if (rc < 0) { in cyttsp4_startup_()
1615 rc = cyttsp4_get_sysinfo_regs(cd); in cyttsp4_startup_()
1616 if (rc < 0) { in cyttsp4_startup_()
1618 __func__, rc); in cyttsp4_startup_()
1624 rc = cyttsp4_set_mode(cd, CY_MODE_OPERATIONAL); in cyttsp4_startup_()
1625 if (rc < 0) { in cyttsp4_startup_()
1627 __func__, rc); in cyttsp4_startup_()
1648 return rc; in cyttsp4_startup_()
1653 int rc; in cyttsp4_startup() local
1659 rc = cyttsp4_request_exclusive(cd, cd->dev, in cyttsp4_startup()
1661 if (rc < 0) { in cyttsp4_startup()
1667 rc = cyttsp4_startup_(cd); in cyttsp4_startup()
1683 return rc; in cyttsp4_startup()
1689 int rc; in cyttsp4_startup_work_function() local
1691 rc = cyttsp4_startup(cd); in cyttsp4_startup_work_function()
1692 if (rc < 0) in cyttsp4_startup_work_function()
1694 __func__, rc); in cyttsp4_startup_work_function()
1719 int rc; in cyttsp4_core_sleep() local
1721 rc = cyttsp4_request_exclusive(cd, cd->dev, in cyttsp4_core_sleep()
1723 if (rc < 0) { in cyttsp4_core_sleep()
1729 rc = cyttsp4_core_sleep_(cd); in cyttsp4_core_sleep()
1736 return rc; in cyttsp4_core_sleep()
1742 int rc; in cyttsp4_core_wake_() local
1758 rc = cd->cpdata->power(cd->cpdata, 1, dev, &cd->ignore_irq); in cyttsp4_core_wake_()
1761 rc = -ENOSYS; in cyttsp4_core_wake_()
1763 if (rc < 0) { in cyttsp4_core_wake_()
1765 __func__, rc); in cyttsp4_core_wake_()
1797 int rc; in cyttsp4_core_wake() local
1799 rc = cyttsp4_request_exclusive(cd, cd->dev, in cyttsp4_core_wake()
1801 if (rc < 0) { in cyttsp4_core_wake()
1807 rc = cyttsp4_core_wake_(cd); in cyttsp4_core_wake()
1814 return rc; in cyttsp4_core_wake()
1821 int rc; in cyttsp4_core_suspend() local
1825 rc = cyttsp4_core_sleep(cd); in cyttsp4_core_suspend()
1826 if (rc < 0) { in cyttsp4_core_suspend()
1837 int rc; in cyttsp4_core_resume() local
1841 rc = cyttsp4_core_wake(cd); in cyttsp4_core_resume()
1842 if (rc < 0) { in cyttsp4_core_resume()
1881 int rc; in cyttsp4_setup_input_device() local
1937 rc = input_register_device(md->input); in cyttsp4_setup_input_device()
1938 if (rc < 0) in cyttsp4_setup_input_device()
1940 __func__, rc); in cyttsp4_setup_input_device()
1941 return rc; in cyttsp4_setup_input_device()
1949 int rc = 0; in cyttsp4_mt_probe() local
1960 rc = -ENOSYS; in cyttsp4_mt_probe()
1981 rc = cyttsp4_setup_input_device(cd); in cyttsp4_mt_probe()
1982 if (rc) in cyttsp4_mt_probe()
1993 return rc; in cyttsp4_mt_probe()
2002 int rc = 0; in cyttsp4_probe() local
2006 rc = -ENODEV; in cyttsp4_probe()
2013 rc = -ENOMEM; in cyttsp4_probe()
2020 rc = -ENOMEM; in cyttsp4_probe()
2044 rc = -EINVAL; in cyttsp4_probe()
2053 rc = cd->cpdata->init(cd->cpdata, 1, cd->dev); in cyttsp4_probe()
2056 rc = 0; in cyttsp4_probe()
2058 if (rc < 0) in cyttsp4_probe()
2059 dev_err(cd->dev, "%s: HW Init fail r=%d\n", __func__, rc); in cyttsp4_probe()
2069 rc = request_threaded_irq(cd->irq, NULL, cyttsp4_irq, irq_flags, in cyttsp4_probe()
2071 if (rc < 0) { in cyttsp4_probe()
2084 rc = cyttsp4_startup(cd); in cyttsp4_probe()
2087 if (rc < 0 && cd->mode == CY_MODE_UNKNOWN) { in cyttsp4_probe()
2089 __func__, rc); in cyttsp4_probe()
2093 rc = cyttsp4_mt_probe(cd); in cyttsp4_probe()
2094 if (rc < 0) { in cyttsp4_probe()
2119 return ERR_PTR(rc); in cyttsp4_probe()