Lines Matching refs:rc
166 int rc; in fsi_i2c_read_reg() local
169 rc = fsi_device_read(fsi, reg, &data_be, sizeof(data_be)); in fsi_i2c_read_reg()
170 if (rc) in fsi_i2c_read_reg()
171 return rc; in fsi_i2c_read_reg()
188 int rc; in fsi_i2c_dev_init() local
193 rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_INT_MASK, &interrupt); in fsi_i2c_dev_init()
194 if (rc) in fsi_i2c_dev_init()
195 return rc; in fsi_i2c_dev_init()
198 rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_MODE, &mode); in fsi_i2c_dev_init()
199 if (rc) in fsi_i2c_dev_init()
200 return rc; in fsi_i2c_dev_init()
202 rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_ESTAT, &extended_status); in fsi_i2c_dev_init()
203 if (rc) in fsi_i2c_dev_init()
204 return rc; in fsi_i2c_dev_init()
216 int rc; in fsi_i2c_set_port() local
220 rc = fsi_i2c_read_reg(fsi, I2C_FSI_MODE, &mode); in fsi_i2c_set_port()
221 if (rc) in fsi_i2c_set_port()
222 return rc; in fsi_i2c_set_port()
228 rc = fsi_i2c_write_reg(fsi, I2C_FSI_MODE, &mode); in fsi_i2c_set_port()
229 if (rc) in fsi_i2c_set_port()
230 return rc; in fsi_i2c_set_port()
270 int rc; in fsi_i2c_write_fifo() local
280 rc = fsi_device_write(i2c->fsi, I2C_FSI_FIFO, in fsi_i2c_write_fifo()
282 if (rc) in fsi_i2c_write_fifo()
283 return rc; in fsi_i2c_write_fifo()
296 int rc; in fsi_i2c_read_fifo() local
308 rc = fsi_device_read(i2c->fsi, I2C_FSI_FIFO, in fsi_i2c_read_fifo()
310 if (rc) in fsi_i2c_read_fifo()
311 return rc; in fsi_i2c_read_fifo()
317 rc = fsi_device_read(i2c->fsi, I2C_FSI_FIFO, &dummy, in fsi_i2c_read_fifo()
319 if (rc) in fsi_i2c_read_fifo()
320 return rc; in fsi_i2c_read_fifo()
377 int rc; in fsi_i2c_prepare_recovery() local
382 rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_MODE, &mode); in fsi_i2c_prepare_recovery()
383 if (rc) in fsi_i2c_prepare_recovery()
392 int rc; in fsi_i2c_unprepare_recovery() local
397 rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_MODE, &mode); in fsi_i2c_unprepare_recovery()
398 if (rc) in fsi_i2c_unprepare_recovery()
408 int rc; in fsi_i2c_reset_bus() local
415 rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_RESET_ERR, &dummy); in fsi_i2c_reset_bus()
416 if (rc) in fsi_i2c_reset_bus()
417 return rc; in fsi_i2c_reset_bus()
422 rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_STAT, &stat); in fsi_i2c_reset_bus()
423 if (rc) in fsi_i2c_reset_bus()
424 return rc; in fsi_i2c_reset_bus()
430 rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_RESET_I2C, &dummy); in fsi_i2c_reset_bus()
431 if (rc) in fsi_i2c_reset_bus()
432 return rc; in fsi_i2c_reset_bus()
440 int rc; in fsi_i2c_reset_engine() local
444 rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_RESET_I2C, &dummy); in fsi_i2c_reset_engine()
445 if (rc) in fsi_i2c_reset_engine()
446 return rc; in fsi_i2c_reset_engine()
449 rc = fsi_i2c_dev_init(i2c); in fsi_i2c_reset_engine()
450 if (rc) in fsi_i2c_reset_engine()
451 return rc; in fsi_i2c_reset_engine()
453 rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_MODE, &mode); in fsi_i2c_reset_engine()
454 if (rc) in fsi_i2c_reset_engine()
455 return rc; in fsi_i2c_reset_engine()
461 rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_MODE, &mode); in fsi_i2c_reset_engine()
462 if (rc) in fsi_i2c_reset_engine()
463 return rc; in fsi_i2c_reset_engine()
468 rc = fsi_i2c_write_reg(i2c->fsi, I2C_FSI_PORT_BUSY, &dummy); in fsi_i2c_reset_engine()
469 if (rc) in fsi_i2c_reset_engine()
470 return rc; in fsi_i2c_reset_engine()
477 int rc; in fsi_i2c_abort() local
484 rc = fsi_i2c_reset_engine(i2c, port->port); in fsi_i2c_abort()
485 if (rc) in fsi_i2c_abort()
486 return rc; in fsi_i2c_abort()
488 rc = fsi_i2c_read_reg(fsi, I2C_FSI_STAT, &stat); in fsi_i2c_abort()
489 if (rc) in fsi_i2c_abort()
490 return rc; in fsi_i2c_abort()
494 rc = fsi_i2c_reset_bus(i2c, port); in fsi_i2c_abort()
495 if (rc) in fsi_i2c_abort()
496 return rc; in fsi_i2c_abort()
504 rc = fsi_i2c_write_reg(fsi, I2C_FSI_CMD, &cmd); in fsi_i2c_abort()
505 if (rc) in fsi_i2c_abort()
506 return rc; in fsi_i2c_abort()
512 rc = fsi_i2c_read_reg(fsi, I2C_FSI_STAT, &status); in fsi_i2c_abort()
513 if (rc) in fsi_i2c_abort()
514 return rc; in fsi_i2c_abort()
528 int rc; in fsi_i2c_handle_status() local
532 rc = fsi_i2c_abort(port, status); in fsi_i2c_handle_status()
533 if (rc) in fsi_i2c_handle_status()
534 return rc; in fsi_i2c_handle_status()
578 int rc; in fsi_i2c_wait() local
582 rc = fsi_i2c_read_reg(port->master->fsi, I2C_FSI_STAT, in fsi_i2c_wait()
584 if (rc) in fsi_i2c_wait()
585 return rc; in fsi_i2c_wait()
588 rc = fsi_i2c_handle_status(port, msg, status); in fsi_i2c_wait()
589 if (rc < 0) in fsi_i2c_wait()
590 return rc; in fsi_i2c_wait()
593 if (rc == msg->len) in fsi_i2c_wait()
609 int i, rc; in fsi_i2c_xfer() local
617 rc = fsi_i2c_set_port(port); in fsi_i2c_xfer()
618 if (rc) in fsi_i2c_xfer()
625 rc = fsi_i2c_start(port, msg, i == num - 1); in fsi_i2c_xfer()
626 if (rc) in fsi_i2c_xfer()
629 rc = fsi_i2c_wait(port, msg, in fsi_i2c_xfer()
631 if (rc) in fsi_i2c_xfer()
637 return rc ? : num; in fsi_i2c_xfer()
666 int rc; in fsi_i2c_find_port_of_node() local
669 rc = of_property_read_u32(np, "reg", &port_no); in fsi_i2c_find_port_of_node()
670 if (!rc && port_no == port) in fsi_i2c_find_port_of_node()
683 int rc; in fsi_i2c_probe() local
693 rc = fsi_i2c_dev_init(i2c); in fsi_i2c_probe()
694 if (rc) in fsi_i2c_probe()
695 return rc; in fsi_i2c_probe()
697 rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_STAT, &stat); in fsi_i2c_probe()
698 if (rc) in fsi_i2c_probe()
699 return rc; in fsi_i2c_probe()
728 rc = i2c_add_adapter(&port->adapter); in fsi_i2c_probe()
729 if (rc < 0) { in fsi_i2c_probe()
730 dev_err(dev, "Failed to register adapter: %d\n", rc); in fsi_i2c_probe()