> 
> Use dma_slave_config to dynamically set dma channel for each dma transaction,
> also use the dma device's device_prep_slave_sg() callback instead of the
> device_prep_dma_memcpy().
I don't think the DMA controller you are using supports sg operation, 
you will still need to call memcpy for single transfer.

Was this patch tested?
 
> +     rxs = &dw_dma->dmas_rx;
> +     rxs->hs_mode = LNW_DMA_HW_HS;
> +     rxs->cfg_mode = LNW_DMA_PER_TO_MEM;
>       dws->rxchan->private = rxs;
Is this based on upstream bits, if so then you shouldn't be using private 
variable.
Calling device_control with DMA_SLAVE_CONFIG should be enough

> +     /* 2. Prepare the TX dma transfer */
> +     txconf.direction = DMA_TO_DEVICE;
> +     txconf.dst_addr = dws->dma_addr;
> +     txconf.dst_maxburst = LNW_DMA_MSIZE_16;
Burst size of 16 for HW handshaking, a definite no from me.
This can't work :(

> +     txchan->device->device_control(txchan, DMA_SLAVE_CONFIG,
> +                                    (unsigned long) &txconf);
Okay, this is based on upstream bits, so please remove private.

> +     txdesc = txchan->device->device_prep_slave_sg(txchan,
> +                                   &dws->tx_sgl,
> +                                   1,
> +                                   DMA_TO_DEVICE,
> +                                   DMA_PREP_INTERRUPT | 
> DMA_COMPL_SKIP_DEST_UNMAP);
> +     txdesc->callback = dw_spi_dma_done;
> +     txdesc->callback_param = dws;
txdesc can be NULL here... You should handle that.

> +     /* 3. Prepare the RX dma transfer */
> +     rxconf.direction = DMA_FROM_DEVICE;
> +     rxconf.src_addr = dws->dma_addr;
> +     rxconf.src_maxburst = LNW_DMA_MSIZE_16;
This will not work

> -     if (rxdesc)
> -             rxdesc->tx_submit(rxdesc);
> -     if (txdesc)
> -             txdesc->tx_submit(txdesc);
> -
> +     rxdesc->tx_submit(rxdesc);
> +     txdesc->tx_submit(txdesc);
Would prefer here the if ().... is not removed

~Vinod

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to