[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJe_Zhcq4SS0pbQ2ZoUGfRFX90WVs=7HzwaOVv880XQPz27zfg@mail.gmail.com>
Date: Sat, 17 Sep 2011 21:21:27 +0530
From: Jassi Brar <jaswinder.singh@...aro.org>
To: Barry Song <21cnbao@...il.com>
Cc: Jassi Brar <jassisinghbrar@...il.com>,
Barry Song <Baohua.Song@....com>,
Arnd Bergmann <arnd@...db.de>,
Rongjun Ying <rongjun.ying@....com>, vinod.koul@...el.com,
Linus Walleij <linus.walleij@...aro.org>,
linux-kernel@...r.kernel.org, workgroup.linux@....com,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2] dmaengine: add CSR SiRFprimaII DMAC driver
On 17 September 2011 20:27, Barry Song <21cnbao@...il.com> 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) {
>>> + 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);
>>> + spin_unlock_irqrestore(&schan->lock, flags);
>>> +
>>> + return 0;
>>> +}
>> You don't need to pass as much info via dma_slave_config as you do here.
>>
>> dmaxfer_template.src_inc && !dmaxfer_template.dst_inc => DMA_TO_DEVICE
>> !dmaxfer_template.src_inc && dmaxfer_template.dst_inc => DMA_FROM_DEVICE
>
> it seems direct DMA_TO_DEVICE/DMA_FROM_DEVICE is more feasible and
> explict to me.
> "dmaxfer_template.src_inc && !dmaxfer_template.dst_inc" is probably
> DMA_TO_DEVICE, but it is not always true for all scenerios to all kinds of devices.
For which scenarios do you think it won't hold (remember that dmac already
knows if the channel is SLAVE or not) ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists