On Tue, 2013-01-29 at 16:27 +0530, Viresh Kumar wrote:
On 29 January 2013 16:24, Andy Shevchenko
[off-list ref] wrote:
quoted
On Tue, 2013-01-29 at 16:19 +0530, Viresh Kumar wrote:
quoted
if (DMA_TO_DEV)
// dest is periph
fargs.cfg_hi = be32_to_cpup(dma_spec->args+0) << 11;
else if (DEV_TO_DMA)
// src is periph
fargs.cfg_hi = be32_to_cpup(dma_spec->args+0) << 7;
We have macros for such shifts.
drivers/dma/dw_dmac.c:187: cfghi = DWC_CFGH_DST_PER(...
drivers/dma/dw_dmac.c:189: cfghi = DWC_CFGH_SRC_PER(...
I am getting older now, bad memory :)
I grepped into drivers/dma/dw_dmac_regs.h and left include/linux/dw_dmac.h :(
Moreover the excerpt I showed from dw_dmac.c is the same piece of code
you wrote above as a sample.
--
Andy Shevchenko [off-list ref]
Intel Finland Oy