Re: [PATCH 2/7] dw_dmac: fill optional encoded parameters in register structure

Andy Shevchenko
2012-09-20T09:30:12Z

On Tue, 2012-09-18 at 13:29 +0530, viresh kumar wrote:
> On Tue, Sep 18, 2012 at 12:25 PM, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >> > +#define dma_raw_readl(addr, name) \
> >> > + readl((addr) + offsetof(struct dw_dma_regs, name))
> >> > +
> >> > +#define dma_raw_writel(addr, name, val) \
> >> > + writel((val), (addr) + offsetof(struct dw_dma_regs, name))
> >> > +
> >>
> >> But why don't you use earlier defined readl/writel macros:
> >> dma_readl and dma_writel?
>
> > If you look at further patches, namely 3rd, the access to the register
> > is needed before we allocate memory for the dw_dma structure.
>
> Ok. If i am not wrong, such calls are only required once for below line:
Actually twice...
> dw_params = dma_raw_readl(regs, DW_PARAMS
...here and for channel parameters.

> dma_raw_writel() is not used and shouldn't be required in future too.
> So remove it.
Ok

> dma_raw_readl() is required but the name is a bit confusing... this
> raw type is different
> from raw_readl...
>
> Can we name it dma_read_byaddr()?
> to make it more explicit.
Ok.

--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy