Lines Matching refs:ctlr

35 int spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,  in spi_controller_dma_map_mem_op_data()  argument
44 if (op->data.dir == SPI_MEM_DATA_OUT && ctlr->dma_tx) in spi_controller_dma_map_mem_op_data()
45 dmadev = ctlr->dma_tx->device->dev; in spi_controller_dma_map_mem_op_data()
46 else if (op->data.dir == SPI_MEM_DATA_IN && ctlr->dma_rx) in spi_controller_dma_map_mem_op_data()
47 dmadev = ctlr->dma_rx->device->dev; in spi_controller_dma_map_mem_op_data()
49 dmadev = ctlr->dev.parent; in spi_controller_dma_map_mem_op_data()
54 return spi_map_buf(ctlr, dmadev, sgt, op->data.buf.in, op->data.nbytes, in spi_controller_dma_map_mem_op_data()
81 void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr, in spi_controller_dma_unmap_mem_op_data() argument
90 if (op->data.dir == SPI_MEM_DATA_OUT && ctlr->dma_tx) in spi_controller_dma_unmap_mem_op_data()
91 dmadev = ctlr->dma_tx->device->dev; in spi_controller_dma_unmap_mem_op_data()
92 else if (op->data.dir == SPI_MEM_DATA_IN && ctlr->dma_rx) in spi_controller_dma_unmap_mem_op_data()
93 dmadev = ctlr->dma_rx->device->dev; in spi_controller_dma_unmap_mem_op_data()
95 dmadev = ctlr->dev.parent; in spi_controller_dma_unmap_mem_op_data()
97 spi_unmap_buf(ctlr, dmadev, sgt, in spi_controller_dma_unmap_mem_op_data()
216 struct spi_controller *ctlr = mem->spi->controller; in spi_mem_internal_supports_op() local
218 if (ctlr->mem_ops && ctlr->mem_ops->supports_op) in spi_mem_internal_supports_op()
219 return ctlr->mem_ops->supports_op(mem, op); in spi_mem_internal_supports_op()
250 struct spi_controller *ctlr = mem->spi->controller; in spi_mem_access_start() local
256 spi_flush_queue(ctlr); in spi_mem_access_start()
258 if (ctlr->auto_runtime_pm) { in spi_mem_access_start()
261 ret = pm_runtime_get_sync(ctlr->dev.parent); in spi_mem_access_start()
263 pm_runtime_put_noidle(ctlr->dev.parent); in spi_mem_access_start()
264 dev_err(&ctlr->dev, "Failed to power device: %d\n", in spi_mem_access_start()
270 mutex_lock(&ctlr->bus_lock_mutex); in spi_mem_access_start()
271 mutex_lock(&ctlr->io_mutex); in spi_mem_access_start()
278 struct spi_controller *ctlr = mem->spi->controller; in spi_mem_access_end() local
280 mutex_unlock(&ctlr->io_mutex); in spi_mem_access_end()
281 mutex_unlock(&ctlr->bus_lock_mutex); in spi_mem_access_end()
283 if (ctlr->auto_runtime_pm) in spi_mem_access_end()
284 pm_runtime_put(ctlr->dev.parent); in spi_mem_access_end()
302 struct spi_controller *ctlr = mem->spi->controller; in spi_mem_exec_op() local
315 if (ctlr->mem_ops && !mem->spi->cs_gpiod) { in spi_mem_exec_op()
320 ret = ctlr->mem_ops->exec_op(mem, op); in spi_mem_exec_op()
444 struct spi_controller *ctlr = mem->spi->controller; in spi_mem_adjust_op_size() local
447 if (ctlr->mem_ops && ctlr->mem_ops->adjust_op_size) in spi_mem_adjust_op_size()
448 return ctlr->mem_ops->adjust_op_size(mem, op); in spi_mem_adjust_op_size()
450 if (!ctlr->mem_ops || !ctlr->mem_ops->exec_op) { in spi_mem_adjust_op_size()
525 struct spi_controller *ctlr = mem->spi->controller; in spi_mem_dirmap_create() local
543 if (ctlr->mem_ops && ctlr->mem_ops->dirmap_create) in spi_mem_dirmap_create()
544 ret = ctlr->mem_ops->dirmap_create(desc); in spi_mem_dirmap_create()
572 struct spi_controller *ctlr = desc->mem->spi->controller; in spi_mem_dirmap_destroy() local
574 if (!desc->nodirmap && ctlr->mem_ops && ctlr->mem_ops->dirmap_destroy) in spi_mem_dirmap_destroy()
575 ctlr->mem_ops->dirmap_destroy(desc); in spi_mem_dirmap_destroy()
669 struct spi_controller *ctlr = desc->mem->spi->controller; in spi_mem_dirmap_read() local
680 } else if (ctlr->mem_ops && ctlr->mem_ops->dirmap_read) { in spi_mem_dirmap_read()
685 ret = ctlr->mem_ops->dirmap_read(desc, offs, len, buf); in spi_mem_dirmap_read()
715 struct spi_controller *ctlr = desc->mem->spi->controller; in spi_mem_dirmap_write() local
726 } else if (ctlr->mem_ops && ctlr->mem_ops->dirmap_write) { in spi_mem_dirmap_write()
731 ret = ctlr->mem_ops->dirmap_write(desc, offs, len, buf); in spi_mem_dirmap_write()
789 struct spi_controller *ctlr = mem->spi->controller; in spi_mem_poll_status() local
798 if (ctlr->mem_ops && ctlr->mem_ops->poll_status) { in spi_mem_poll_status()
803 ret = ctlr->mem_ops->poll_status(mem, op, mask, match, in spi_mem_poll_status()
835 struct spi_controller *ctlr = spi->controller; in spi_mem_probe() local
844 if (ctlr->mem_ops && ctlr->mem_ops->get_name) in spi_mem_probe()
845 mem->name = ctlr->mem_ops->get_name(mem); in spi_mem_probe()