Lines Matching refs:ret
307 int ret; in rockchip_cs_setup() local
310 ret = gpio_request_list_by_name(bus, "sfc-cs-gpios", sfc->cs_gpios, in rockchip_cs_setup()
312 if (ret < 0) { in rockchip_cs_setup()
313 pr_err("Can't get %s gpios! Error: %d\n", bus->name, ret); in rockchip_cs_setup()
314 return ret; in rockchip_cs_setup()
321 ret = dm_gpio_set_dir_flags(&sfc->cs_gpios[i], in rockchip_cs_setup()
323 if (ret) { in rockchip_cs_setup()
324 dev_err(bus, "Setting cs %d error, ret=%d\n", i, ret); in rockchip_cs_setup()
325 return ret; in rockchip_cs_setup()
346 int ret; in rockchip_sfc_ofdata_to_platdata() local
348 ret = clk_get_by_index(bus, 0, &sfc->clk); in rockchip_sfc_ofdata_to_platdata()
349 if (ret < 0) { in rockchip_sfc_ofdata_to_platdata()
350 printf("Could not get clock for %s: %d\n", bus->name, ret); in rockchip_sfc_ofdata_to_platdata()
351 return ret; in rockchip_sfc_ofdata_to_platdata()
354 ret = clk_get_by_index(bus, 1, &sfc->hclk); in rockchip_sfc_ofdata_to_platdata()
355 if (ret < 0) { in rockchip_sfc_ofdata_to_platdata()
356 printf("Could not get ahb clock for %s: %d\n", bus->name, ret); in rockchip_sfc_ofdata_to_platdata()
357 return ret; in rockchip_sfc_ofdata_to_platdata()
369 int ret; in rockchip_sfc_probe() local
372 ret = clk_enable(&sfc->hclk); in rockchip_sfc_probe()
373 if (ret) in rockchip_sfc_probe()
374 dev_dbg(sfc->dev, "sfc Enable ahb clock fail %s: %d\n", bus->name, ret); in rockchip_sfc_probe()
376 ret = clk_enable(&sfc->clk); in rockchip_sfc_probe()
377 if (ret) in rockchip_sfc_probe()
378 dev_dbg(sfc->dev, "sfc Enable clock fail for %s: %d\n", bus->name, ret); in rockchip_sfc_probe()
385 ret = rockchip_sfc_init(sfc); in rockchip_sfc_probe()
386 if (ret) in rockchip_sfc_probe()
401 return ret; in rockchip_sfc_probe()
406 int ret = 0; in rockchip_sfc_wait_txfifo_ready() local
409 ret = readl_poll_timeout(sfc->regbase + SFC_FSR, status, in rockchip_sfc_wait_txfifo_ready()
412 if (ret) { in rockchip_sfc_wait_txfifo_ready()
423 int ret = 0; in rockchip_sfc_wait_rxfifo_ready() local
426 ret = readl_poll_timeout(sfc->regbase + SFC_FSR, status, in rockchip_sfc_wait_rxfifo_ready()
429 if (ret) { in rockchip_sfc_wait_rxfifo_ready()
632 int ret; in rockchip_sfc_xfer_data_dma() local
644 ret = bounce_buffer_start(&bb, dma_buf, len, bb_flags); in rockchip_sfc_xfer_data_dma()
645 if (ret) in rockchip_sfc_xfer_data_dma()
646 return ret; in rockchip_sfc_xfer_data_dma()
648 ret = rockchip_sfc_fifo_transfer_dma(sfc, (dma_addr_t)bb.bounce_buffer, len); in rockchip_sfc_xfer_data_dma()
652 return ret; in rockchip_sfc_xfer_data_dma()
678 int ret = 0; in rockchip_sfc_xfer_done() local
681 ret = readl_poll_timeout(sfc->regbase + SFC_SR, status, in rockchip_sfc_xfer_done()
684 if (ret) { in rockchip_sfc_xfer_done()
688 ret = -EIO; in rockchip_sfc_xfer_done()
691 return ret; in rockchip_sfc_xfer_done()
715 u32 ret; in rockchip_sfc_exec_op_bypass() local
720 ret = rockchip_sfc_xfer_data_poll(sfc, op, len); in rockchip_sfc_exec_op_bypass()
721 if (ret != len) { in rockchip_sfc_exec_op_bypass()
722 dev_err(sfc->dev, "xfer data failed ret %d\n", ret); in rockchip_sfc_exec_op_bypass()
727 ret = rockchip_sfc_xfer_done(sfc, 100000); in rockchip_sfc_exec_op_bypass()
730 return ret; in rockchip_sfc_exec_op_bypass()
762 int ret; in rockchip_sfc_delay_lines_tuning() local
769 ret = memcmp(&id, &id_temp, 3); in rockchip_sfc_delay_lines_tuning()
770 if (dll_valid && ret) { in rockchip_sfc_delay_lines_tuning()
775 if (!dll_valid && !ret) in rockchip_sfc_delay_lines_tuning()
778 if (!ret) in rockchip_sfc_delay_lines_tuning()
826 int ret; in rockchip_sfc_exec_op() local
855 ret = rockchip_sfc_xfer_data_dma(sfc, op, len); in rockchip_sfc_exec_op()
857 ret = rockchip_sfc_xfer_data_poll(sfc, op, len); in rockchip_sfc_exec_op()
860 if (ret != len) { in rockchip_sfc_exec_op()
861 dev_err(sfc->dev, "xfer data failed ret %d dir %d\n", ret, op->data.dir); in rockchip_sfc_exec_op()
867 ret = rockchip_sfc_xfer_done(sfc, 100000); in rockchip_sfc_exec_op()
870 return ret; in rockchip_sfc_exec_op()
893 int ret = rockchip_sfc_clk_set_rate(sfc, speed); in rockchip_sfc_set_speed() local
895 if (ret < 0) { in rockchip_sfc_set_speed()
898 return ret; in rockchip_sfc_set_speed()