Lines Matching refs:drv_data

20 static void pxa2xx_spi_dma_transfer_complete(struct driver_data *drv_data,  in pxa2xx_spi_dma_transfer_complete()  argument
23 struct spi_message *msg = drv_data->controller->cur_msg; in pxa2xx_spi_dma_transfer_complete()
31 if (atomic_dec_and_test(&drv_data->dma_running)) { in pxa2xx_spi_dma_transfer_complete()
38 error = read_SSSR_bits(drv_data, drv_data->mask_sr) & SSSR_ROR; in pxa2xx_spi_dma_transfer_complete()
41 clear_SSCR1_bits(drv_data, drv_data->dma_cr1); in pxa2xx_spi_dma_transfer_complete()
42 write_SSSR_CS(drv_data, drv_data->clear_sr); in pxa2xx_spi_dma_transfer_complete()
43 if (!pxa25x_ssp_comp(drv_data)) in pxa2xx_spi_dma_transfer_complete()
44 pxa2xx_spi_write(drv_data, SSTO, 0); in pxa2xx_spi_dma_transfer_complete()
48 pxa_ssp_disable(drv_data->ssp); in pxa2xx_spi_dma_transfer_complete()
52 spi_finalize_current_transfer(drv_data->controller); in pxa2xx_spi_dma_transfer_complete()
62 pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data, in pxa2xx_spi_dma_prepare_one() argument
67 spi_get_ctldata(drv_data->controller->cur_msg->spi); in pxa2xx_spi_dma_prepare_one()
74 switch (drv_data->n_bytes) { in pxa2xx_spi_dma_prepare_one()
90 cfg.dst_addr = drv_data->ssp->phys_base + SSDR; in pxa2xx_spi_dma_prepare_one()
95 chan = drv_data->controller->dma_tx; in pxa2xx_spi_dma_prepare_one()
97 cfg.src_addr = drv_data->ssp->phys_base + SSDR; in pxa2xx_spi_dma_prepare_one()
102 chan = drv_data->controller->dma_rx; in pxa2xx_spi_dma_prepare_one()
107 dev_warn(drv_data->ssp->dev, "DMA slave config failed\n"); in pxa2xx_spi_dma_prepare_one()
115 irqreturn_t pxa2xx_spi_dma_transfer(struct driver_data *drv_data) in pxa2xx_spi_dma_transfer() argument
119 status = read_SSSR_bits(drv_data, drv_data->mask_sr); in pxa2xx_spi_dma_transfer()
121 dev_err(drv_data->ssp->dev, "FIFO overrun\n"); in pxa2xx_spi_dma_transfer()
123 dmaengine_terminate_async(drv_data->controller->dma_rx); in pxa2xx_spi_dma_transfer()
124 dmaengine_terminate_async(drv_data->controller->dma_tx); in pxa2xx_spi_dma_transfer()
126 pxa2xx_spi_dma_transfer_complete(drv_data, true); in pxa2xx_spi_dma_transfer()
133 int pxa2xx_spi_dma_prepare(struct driver_data *drv_data, in pxa2xx_spi_dma_prepare() argument
139 tx_desc = pxa2xx_spi_dma_prepare_one(drv_data, DMA_MEM_TO_DEV, xfer); in pxa2xx_spi_dma_prepare()
141 dev_err(drv_data->ssp->dev, "failed to get DMA TX descriptor\n"); in pxa2xx_spi_dma_prepare()
146 rx_desc = pxa2xx_spi_dma_prepare_one(drv_data, DMA_DEV_TO_MEM, xfer); in pxa2xx_spi_dma_prepare()
148 dev_err(drv_data->ssp->dev, "failed to get DMA RX descriptor\n"); in pxa2xx_spi_dma_prepare()
155 rx_desc->callback_param = drv_data; in pxa2xx_spi_dma_prepare()
162 dmaengine_terminate_async(drv_data->controller->dma_tx); in pxa2xx_spi_dma_prepare()
167 void pxa2xx_spi_dma_start(struct driver_data *drv_data) in pxa2xx_spi_dma_start() argument
169 dma_async_issue_pending(drv_data->controller->dma_rx); in pxa2xx_spi_dma_start()
170 dma_async_issue_pending(drv_data->controller->dma_tx); in pxa2xx_spi_dma_start()
172 atomic_set(&drv_data->dma_running, 1); in pxa2xx_spi_dma_start()
175 void pxa2xx_spi_dma_stop(struct driver_data *drv_data) in pxa2xx_spi_dma_stop() argument
177 atomic_set(&drv_data->dma_running, 0); in pxa2xx_spi_dma_stop()
178 dmaengine_terminate_sync(drv_data->controller->dma_rx); in pxa2xx_spi_dma_stop()
179 dmaengine_terminate_sync(drv_data->controller->dma_tx); in pxa2xx_spi_dma_stop()
182 int pxa2xx_spi_dma_setup(struct driver_data *drv_data) in pxa2xx_spi_dma_setup() argument
184 struct pxa2xx_spi_controller *pdata = drv_data->controller_info; in pxa2xx_spi_dma_setup()
185 struct spi_controller *controller = drv_data->controller; in pxa2xx_spi_dma_setup()
186 struct device *dev = drv_data->ssp->dev; in pxa2xx_spi_dma_setup()
208 void pxa2xx_spi_dma_release(struct driver_data *drv_data) in pxa2xx_spi_dma_release() argument
210 struct spi_controller *controller = drv_data->controller; in pxa2xx_spi_dma_release()
230 struct driver_data *drv_data = spi_controller_get_devdata(spi->controller); in pxa2xx_spi_set_dma_burst_and_threshold() local
231 u32 dma_burst_size = drv_data->controller_info->dma_burst_size; in pxa2xx_spi_set_dma_burst_and_threshold()