lkml.org 
[lkml]   [2011]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] dmaengine: add CSR SiRFprimaII DMAC driver
    On Fri, Sep 16, 2011 at 02:56:00AM -0700, Barry Song wrote:
    > +static int sirfsoc_dma_slave_config(struct sirfsoc_dma_chan *schan,
    > + struct dma_slave_config *config)
    > +{
    > + u32 addr, direction;
    > + unsigned long flags;
    > +
    > + switch (config->direction) {

    config->direction is deprecated, please don't use it.

    > + case DMA_FROM_DEVICE:
    > + direction = 0;
    > + addr = config->dst_addr;
    > + break;
    > +
    > + case DMA_TO_DEVICE:
    > + direction = 1;
    > + addr = config->src_addr;
    > + break;
    > +
    > + default:
    > + return -EINVAL;
    > + }
    > +
    > + if ((config->src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) ||
    > + (config->dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES))
    > + return -EINVAL;
    > +
    > + spin_lock_irqsave(&schan->lock, flags);
    > + schan->addr = addr;
    > + schan->direction = direction;
    > + schan->mode = (config->src_maxburst == 4 ? 1 : 0);

    Please store the source address, destination address, and mode separately
    for each direction. You should then select from that at prepare time.


    \
     
     \ /
      Last update: 2011-09-17 17:05    [W:0.019 / U:67.080 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site