-----Original Message----- From: linux-omap-owner@xxxxxxxxxxxxxxx [mailto:linux-omap-owner@xxxxxxxxxxxxxxx] On Behalf Of Shilimkar, Santosh Sent: Thursday, October 15, 2009 1:01 PM To: Peter Ujfalusi Cc: Varadarajan, Charu Latha; linux-omap@xxxxxxxxxxxxxxx; Syed, Rafiuddin Subject: RE: [PATCH] OMAP3: Fix McBSP poll read and write for 32bit reg access Peter/ Santosh, > > -----Original Message----- > > From: Peter Ujfalusi [mailto:peter.ujfalusi@xxxxxxxxx] > > Sent: Thursday, October 15, 2009 12:56 PM > > To: Shilimkar, Santosh > > Cc: Varadarajan, Charu Latha; linux-omap@xxxxxxxxxxxxxxx; Syed, Rafiuddin > > Subject: Re: [PATCH] OMAP3: Fix McBSP poll read and write for 32bit reg > > access > > > > On Thursday 15 October 2009 09:10:54 ext Shilimkar, Santosh wrote: > > > > > > > > - writew(buf, base + OMAP_MCBSP_REG_DXR1); > > > > > > > > + OMAP_MCBSP_WRITE(base, DXR, buf); > > > > > > > > > > > > > > Why do you need this? Is writew()/readw() not doing 16 bit > > > > > > > operations ? > > > > > > > > > > > > The intension is to use 32 bit access and not 16 bit access > > > > > > > > > > Use readl() / writel() then. > > > > > > > > Yes, OMAP_MCBSP_WRITE macro makes use of readl() / writel() for OMAP3 > > > > > > Good!! Then get rid of this macro and directly use kernel standard > > > API- readl() / writel() -- > > > Well, OMAP1 and OMAP2 still has 16 bit registers in McBSP. > Please look at this comment from Peter. So please reconsider your patch and decision of changing the signature of the API since it breaks OMAP1 and OMAP2. OMAP_MCBSP_READ and OMAP_MCBSP_WRITE macros takes care of the same. Please find below the code snippet from mcbsp kernel code. It checks for the cpu version and accordingly calls raw_writew/raw_writel. ------------- Code snippet from arch/arm/plat-omap/mcbsp.c------------------------------- void omap_mcbsp_write(void __iomem *io_base, u16 reg, u32 val) { if (cpu_class_is_omap1() || cpu_is_omap2420()) __raw_writew((u16)val, io_base + reg); else __raw_writel(val, io_base + reg); } int omap_mcbsp_read(void __iomem *io_base, u16 reg) { if (cpu_class_is_omap1() || cpu_is_omap2420()) return __raw_readw(io_base + reg); else return __raw_readl(io_base + reg); } #define OMAP_MCBSP_READ(base, reg) \ omap_mcbsp_read(base, OMAP_MCBSP_REG_##reg) #define OMAP_MCBSP_WRITE(base, reg, val) \ omap_mcbsp_write(base, OMAP_MCBSP_REG_##reg, val) ---------------- End of Code snippet from arch/arm/plat-omap/mcbsp.c------------------------- -Charulatha-- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html