lkml.org 
[lkml]   [2012]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/7] dw_dmac: autoconfigure block_size or use platform data
From
Date
On Tue, 2012-09-18 at 12:27 +0530, viresh kumar wrote:

[snip]

> > @@ -1420,6 +1411,9 @@ static int __devinit dw_probe(struct platform_device *pdev)
> >
> > dw->regs = regs;
> >
> > + /* get hardware configuration parameters */
> > + max_blk_size = dma_readl(dw, MAX_BLK_SIZE);
> > +
>
> Do this only for autocfg case.
Ok.

> > @@ -1465,6 +1459,14 @@ static int __devinit dw_probe(struct platform_device *pdev)
> > INIT_LIST_HEAD(&dwc->free_list);
> >
> > channel_clear_bit(dw, CH_EN, dwc->mask);
> > +
> > + /* hardware configuration */
> > + if (autocfg) {
> > + dwc->block_size =
> > + (4 << ((max_blk_size >> 4 * i) & 0xf)) - 1;
>
> Put a comment on what are you doing here.
Ok.

>
> > + } else {
> > + dwc->block_size = pdata->block_size;
> > + }
>
> Don't need {} for single line statements.
Ok. By the way it comes by next patch anyway.

> > --- a/drivers/dma/dw_dmac_regs.h
> > +++ b/drivers/dma/dw_dmac_regs.h
> > @@ -186,6 +186,9 @@ struct dw_dma_chan {
> >
> > unsigned int descs_allocated;
> >
> > + /* hardware configuration */
> > + unsigned short block_size;
> > +
>
> You actually don't save any memory here with short and actually makes access
> to block_size more complex. keeping it int would be better i believe.
I rather agree with you. I'll change it.

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


\
 
 \ /
  Last update: 2012-09-20 12:41    [W:0.229 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site