Lines Matching refs:rc
88 int rc; in fsi_spi_check_mux() local
92 rc = fsi_slave_read(fsi->slave, FSI_MBOX_ROOT_CTRL_8, &root_ctrl_8_be, in fsi_spi_check_mux()
94 if (rc) in fsi_spi_check_mux()
95 return rc; in fsi_spi_check_mux()
108 int rc; in fsi_spi_check_status() local
112 rc = fsi_device_read(ctx->bridge->fsi, FSI2SPI_STATUS, &sts_be, in fsi_spi_check_status()
114 if (rc) in fsi_spi_check_status()
115 return rc; in fsi_spi_check_status()
128 int rc = 0; in fsi_spi_read_reg() local
139 rc = mutex_lock_interruptible(&bridge->lock); in fsi_spi_read_reg()
140 if (rc) in fsi_spi_read_reg()
141 return rc; in fsi_spi_read_reg()
144 rc = fsi_device_write(bridge->fsi, FSI2SPI_CMD, &cmd_be, in fsi_spi_read_reg()
146 if (rc) in fsi_spi_read_reg()
149 rc = fsi_spi_check_status(ctx); in fsi_spi_read_reg()
150 if (rc) in fsi_spi_read_reg()
153 rc = fsi_device_read(bridge->fsi, FSI2SPI_DATA0, &data_be, in fsi_spi_read_reg()
155 if (rc) in fsi_spi_read_reg()
160 rc = fsi_device_read(bridge->fsi, FSI2SPI_DATA1, &data_be, in fsi_spi_read_reg()
162 if (rc) in fsi_spi_read_reg()
170 return rc; in fsi_spi_read_reg()
175 int rc = 0; in fsi_spi_write_reg() local
184 rc = mutex_lock_interruptible(&bridge->lock); in fsi_spi_write_reg()
185 if (rc) in fsi_spi_write_reg()
186 return rc; in fsi_spi_write_reg()
191 rc = fsi_device_write(bridge->fsi, FSI2SPI_DATA0, &data_be, in fsi_spi_write_reg()
193 if (rc) in fsi_spi_write_reg()
197 rc = fsi_device_write(bridge->fsi, FSI2SPI_DATA1, &data_be, in fsi_spi_write_reg()
199 if (rc) in fsi_spi_write_reg()
203 rc = fsi_device_write(bridge->fsi, FSI2SPI_CMD, &cmd_be, in fsi_spi_write_reg()
205 if (rc) in fsi_spi_write_reg()
208 rc = fsi_spi_check_status(ctx); in fsi_spi_write_reg()
212 return rc; in fsi_spi_write_reg()
243 int rc; in fsi_spi_reset() local
247 rc = fsi_spi_write_reg(ctx, SPI_FSI_CLOCK_CFG, in fsi_spi_reset()
249 if (rc) in fsi_spi_reset()
250 return rc; in fsi_spi_reset()
252 rc = fsi_spi_write_reg(ctx, SPI_FSI_CLOCK_CFG, in fsi_spi_reset()
254 if (rc) in fsi_spi_reset()
255 return rc; in fsi_spi_reset()
262 int rc = fsi_spi_read_reg(ctx, SPI_FSI_STATUS, status); in fsi_spi_status() local
264 if (rc) in fsi_spi_status()
265 return rc; in fsi_spi_status()
270 rc = fsi_spi_reset(ctx); in fsi_spi_status()
271 if (rc) in fsi_spi_status()
272 return rc; in fsi_spi_status()
302 int rc = 0; in fsi_spi_transfer_data() local
316 rc = fsi_spi_write_reg(ctx, SPI_FSI_DATA_TX, out); in fsi_spi_transfer_data()
317 if (rc) in fsi_spi_transfer_data()
318 return rc; in fsi_spi_transfer_data()
326 rc = fsi_spi_status(ctx, &status, "TX"); in fsi_spi_transfer_data()
327 if (rc) in fsi_spi_transfer_data()
328 return rc; in fsi_spi_transfer_data()
345 rc = fsi_spi_status(ctx, &status, "RX"); in fsi_spi_transfer_data()
346 if (rc) in fsi_spi_transfer_data()
347 return rc; in fsi_spi_transfer_data()
350 rc = fsi_spi_read_reg(ctx, SPI_FSI_DATA_RX, &in); in fsi_spi_transfer_data()
351 if (rc) in fsi_spi_transfer_data()
352 return rc; in fsi_spi_transfer_data()
365 int rc; in fsi_spi_transfer_init() local
380 rc = fsi_spi_read_reg(ctx, SPI_FSI_STATUS, &status); in fsi_spi_transfer_init()
381 if (rc) in fsi_spi_transfer_init()
382 return rc; in fsi_spi_transfer_init()
396 rc = fsi_spi_reset(ctx); in fsi_spi_transfer_init()
397 if (rc) in fsi_spi_transfer_init()
398 return rc; in fsi_spi_transfer_init()
405 rc = fsi_spi_write_reg(ctx, SPI_FSI_COUNTER_CFG, 0ULL); in fsi_spi_transfer_init()
406 if (rc) in fsi_spi_transfer_init()
407 return rc; in fsi_spi_transfer_init()
409 rc = fsi_spi_read_reg(ctx, SPI_FSI_CLOCK_CFG, &clock_cfg); in fsi_spi_transfer_init()
410 if (rc) in fsi_spi_transfer_init()
411 return rc; in fsi_spi_transfer_init()
418 rc = fsi_spi_write_reg(ctx, SPI_FSI_CLOCK_CFG, in fsi_spi_transfer_init()
421 return rc; in fsi_spi_transfer_init()
427 int rc; in fsi_spi_transfer_one_message() local
433 rc = fsi_spi_check_mux(ctx->bridge->fsi, ctx->dev); in fsi_spi_transfer_one_message()
434 if (rc) in fsi_spi_transfer_one_message()
443 rc = -EINVAL; in fsi_spi_transfer_one_message()
449 rc = fsi_spi_transfer_init(ctx); in fsi_spi_transfer_one_message()
450 if (rc < 0) in fsi_spi_transfer_one_message()
473 rc = -EINVAL; in fsi_spi_transfer_one_message()
489 rc = fsi_spi_write_reg(ctx, SPI_FSI_SEQUENCE, seq.data); in fsi_spi_transfer_one_message()
490 if (rc) in fsi_spi_transfer_one_message()
493 rc = fsi_spi_transfer_data(ctx, transfer); in fsi_spi_transfer_one_message()
494 if (rc) in fsi_spi_transfer_one_message()
498 rc = fsi_spi_transfer_data(ctx, next); in fsi_spi_transfer_one_message()
499 if (rc) in fsi_spi_transfer_one_message()
507 mesg->status = rc; in fsi_spi_transfer_one_message()
510 return rc; in fsi_spi_transfer_one_message()
520 int rc; in fsi_spi_probe() local
526 rc = fsi_spi_check_mux(fsi, dev); in fsi_spi_probe()
527 if (rc) in fsi_spi_probe()
562 rc = devm_spi_register_controller(dev, ctlr); in fsi_spi_probe()
563 if (rc) in fsi_spi_probe()