Hi Laurent, On Sun, Mar 08, 2015 at 11:37:55PM +0200, Laurent Pinchart wrote: ... > @@ -198,24 +177,58 @@ static void hist_dma_cb(int lch, u16 ch_status, void *data) > static int hist_buf_dma(struct ispstat *hist) > { > dma_addr_t dma_addr = hist->active_buf->dma_addr; > + struct dma_async_tx_descriptor *tx; > + struct dma_slave_config cfg; > + dma_cookie_t cookie; > + int ret; > > if (unlikely(!dma_addr)) { > dev_dbg(hist->isp->dev, "hist: invalid DMA buffer address\n"); > - hist_reset_mem(hist); > - return STAT_NO_BUF; > + goto error; > } > > isp_reg_writel(hist->isp, 0, OMAP3_ISP_IOMEM_HIST, ISPHIST_ADDR); > isp_reg_set(hist->isp, OMAP3_ISP_IOMEM_HIST, ISPHIST_CNT, > ISPHIST_CNT_CLEAR); > omap3isp_flush(hist->isp); > - hist->dma_config.dst_start = dma_addr; > - hist->dma_config.elem_count = hist->buf_size / sizeof(u32); > - omap_set_dma_params(hist->dma_ch, &hist->dma_config); > > - omap_start_dma(hist->dma_ch); > + memset(&cfg, 0, sizeof(cfg)); > + cfg.src_addr = hist->isp->mmio_base_phys[OMAP3_ISP_IOMEM_HIST] > + + ISPHIST_DATA; > + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; > + cfg.src_maxburst = hist->buf_size / 4; How about initialising the struct when you declare it instead? That might be a matter of opinion though, but I think I prefer that. Up to you. Acked-by: Sakari Ailus <sakari.ailus@xxxxxx> > + ret = dmaengine_slave_config(hist->dma_ch, &cfg); > + if (ret < 0) { > + dev_dbg(hist->isp->dev, > + "hist: DMA slave configuration failed\n"); > + goto error; > + } > + > + tx = dmaengine_prep_slave_single(hist->dma_ch, dma_addr, > + hist->buf_size, DMA_DEV_TO_MEM, > + DMA_CTRL_ACK); > + if (tx == NULL) { > + dev_dbg(hist->isp->dev, > + "hist: DMA slave preparation failed\n"); > + goto error; > + } > + > + tx->callback = hist_dma_cb; > + tx->callback_param = hist; > + cookie = tx->tx_submit(tx); > + if (dma_submit_error(cookie)) { > + dev_dbg(hist->isp->dev, "hist: DMA submission failed\n"); > + goto error; > + } > + > + dma_async_issue_pending(hist->dma_ch); > > return STAT_BUF_WAITING_DMA; > + > +error: > + hist_reset_mem(hist); > + return STAT_NO_BUF; > } > > static int hist_buf_pio(struct ispstat *hist) -- Kind regards, Sakari Ailus e-mail: sakari.ailus@xxxxxx XMPP: sailus@xxxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html