From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH 1/5] dmaengine: dw_dmac: move to generic DMA binding Date: Tue, 29 Jan 2013 13:14:24 +0200 Message-ID: <1359458064.31148.38.camel@smile> References: <1359395857-1235-1-git-send-email-arnd@arndb.de> <1359410300-26113-2-git-send-email-arnd@arndb.de> <201301291035.30265.arnd@arndb.de> <1359456886.31148.37.camel@smile> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Viresh Kumar Cc: Vinod Koul , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, spear-devel , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Tue, 2013-01-29 at 16:27 +0530, Viresh Kumar wrote: > On 29 January 2013 16:24, Andy Shevchenko > wrote: > > On Tue, 2013-01-29 at 16:19 +0530, Viresh Kumar wrote: > >> 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 Intel Finland Oy