diff mbox

[v1,5/6] avr32: use dw_dmac autoconfiguration

Message ID 1442481322-131820-6-git-send-email-andriy.shevchenko@linux.intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Andy Shevchenko Sept. 17, 2015, 9:15 a.m. UTC
Instead of hardconding a platform data for dw_dmac let's use it's own
autoconfiguration feature. Thus, remove hardcoded values.

Tested on ATNGW100.

Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/avr32/mach-at32ap/at32ap700x.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Comments

Hans-Christian Noren Egtvedt Sept. 17, 2015, 11 a.m. UTC | #1
Around Thu 17 Sep 2015 12:15:21 +0300 or thereabout, Andy Shevchenko wrote:
> Instead of hardconding a platform data for dw_dmac let's use it's own
>

... hardcoding ...

> autoconfiguration feature. Thus, remove hardcoded values.
>

I did not know the DMA controller within AP700x had a register containing the
configuration, but this sounds great.

> Tested on ATNGW100.
> 
> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>

> ---
>  arch/avr32/mach-at32ap/at32ap700x.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> index 1d8b147..b4cb3bd 100644
> --- a/arch/avr32/mach-at32ap/at32ap700x.c
> +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> @@ -603,18 +603,11 @@ static void __init genclk_init_parent(struct clk *clk)
>  	clk->parent = parent;
>  }
>  
> -static struct dw_dma_platform_data dw_dmac0_data = {
> -	.nr_channels	= 3,
> -	.block_size	= 4095U,
> -	.nr_masters	= 2,
> -	.data_width	= { 2, 2 },
> -};
> -
>  static struct resource dw_dmac0_resource[] = {
>  	PBMEM(0xff200000),
>  	IRQ(2),
>  };
> -DEFINE_DEV_DATA(dw_dmac, 0);
> +DEFINE_DEV(dw_dmac, 0);
>  DEV_CLK(hclk, dw_dmac0, hsb, 10);
>  
>  /* --------------------------------------------------------------------
Andy Shevchenko Sept. 17, 2015, 11:27 a.m. UTC | #2
On Thu, 2015-09-17 at 13:00 +0200, Hans-Christian Egtvedt wrote:
> Around Thu 17 Sep 2015 12:15:21 +0300 or thereabout, Andy Shevchenko 
> wrote:
> > Instead of hardconding a platform data for dw_dmac let's use it's 
> > own
> > 
> 
> ... hardcoding ...

Thanks, fixed locally. I think I'm not going to send a new version just
for this one.

> 
> > autoconfiguration feature. Thus, remove hardcoded values.
> > 
> 
> I did not know the DMA controller within AP700x had a register 
> containing the
> configuration, but this sounds great.

I didn't know either because of the bug in the code that patch 1 fixes
(once I asked someone to test it and found that return value is 0).

> 
> > Tested on ATNGW100.
> > 
> > Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>

Thanks!

> 
> > ---
> >  arch/avr32/mach-at32ap/at32ap700x.c | 9 +--------
> >  1 file changed, 1 insertion(+), 8 deletions(-)
> > 
> > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach
> > -at32ap/at32ap700x.c
> > index 1d8b147..b4cb3bd 100644
> > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > @@ -603,18 +603,11 @@ static void __init genclk_init_parent(struct 
> > clk *clk)
> >  	clk->parent = parent;
> >  }
> >  
> > -static struct dw_dma_platform_data dw_dmac0_data = {
> > -	.nr_channels	= 3,
> > -	.block_size	= 4095U,
> > -	.nr_masters	= 2,
> > -	.data_width	= { 2, 2 },
> > -};
> > -
> >  static struct resource dw_dmac0_resource[] = {
> >  	PBMEM(0xff200000),
> >  	IRQ(2),
> >  };
> > -DEFINE_DEV_DATA(dw_dmac, 0);
> > +DEFINE_DEV(dw_dmac, 0);
> >  DEV_CLK(hclk, dw_dmac0, hsb, 10);
> >  
> >  /* ---------------------------------------------------------------
> > -----
diff mbox

Patch

diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 1d8b147..b4cb3bd 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -603,18 +603,11 @@  static void __init genclk_init_parent(struct clk *clk)
 	clk->parent = parent;
 }
 
-static struct dw_dma_platform_data dw_dmac0_data = {
-	.nr_channels	= 3,
-	.block_size	= 4095U,
-	.nr_masters	= 2,
-	.data_width	= { 2, 2 },
-};
-
 static struct resource dw_dmac0_resource[] = {
 	PBMEM(0xff200000),
 	IRQ(2),
 };
-DEFINE_DEV_DATA(dw_dmac, 0);
+DEFINE_DEV(dw_dmac, 0);
 DEV_CLK(hclk, dw_dmac0, hsb, 10);
 
 /* --------------------------------------------------------------------