[PATCH 3/5] ARM: mxs: dynamically allocate dma device for mx23/28

Shawn Guo shawn.guo at freescale.com
Tue Feb 8 19:22:12 EST 2011


On Mon, Feb 07, 2011 at 09:09:45AM +0100, Sascha Hauer wrote:
> On Sat, Feb 05, 2011 at 10:08:14AM +0800, Shawn Guo wrote:
> > Signed-off-by: Shawn Guo <shawn.guo at freescale.com>
> > ---
> >  arch/arm/mach-mxs/clock-mx23.c                  |    3 +-
> >  arch/arm/mach-mxs/clock-mx28.c                  |    4 +-
> >  arch/arm/mach-mxs/devices-mx23.h                |    6 +++
> >  arch/arm/mach-mxs/devices-mx28.h                |    6 +++
> >  arch/arm/mach-mxs/devices/Kconfig               |    3 +
> >  arch/arm/mach-mxs/devices/Makefile              |    1 +
> >  arch/arm/mach-mxs/devices/platform-dma.c        |   50 +++++++++++++++++++++++
> >  arch/arm/mach-mxs/include/mach/devices-common.h |    7 +++
> >  8 files changed, 77 insertions(+), 3 deletions(-)
> >  create mode 100644 arch/arm/mach-mxs/devices/platform-dma.c
> > 
> > diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h
> > index 1256788..d5595ce 100644
> > --- a/arch/arm/mach-mxs/devices-mx23.h
> > +++ b/arch/arm/mach-mxs/devices-mx23.h
> > @@ -14,3 +14,9 @@
> >  extern const struct amba_device mx23_duart_device __initconst;
> >  #define mx23_add_duart() \
> >  	mxs_add_duart(&mx23_duart_device)
> > +
> > +extern const struct mxs_dma_data mx23_dma_data[] __initconst;
> > +#define mx23_add_apbh_dma() \
> > +	mxs_add_dma(&mx23_dma_data[0])
> > +#define mx23_add_apbx_dma() \
> > +	mxs_add_dma(&mx23_dma_data[1])
> > diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h
> > index 3b18304..e3a3bbc 100644
> > --- a/arch/arm/mach-mxs/devices-mx28.h
> > +++ b/arch/arm/mach-mxs/devices-mx28.h
> > @@ -23,6 +23,12 @@ extern const struct mxs_auart_data mx28_auart_data[] __initconst;
> >  #define mx28_add_auart3()		mx28_add_auart(3)
> >  #define mx28_add_auart4()		mx28_add_auart(4)
> >  
> > +extern const struct mxs_dma_data mx28_dma_data[] __initconst;
> > +#define mx28_add_apbh_dma() \
> > +	mxs_add_dma(&mx28_dma_data[0])
> > +#define mx28_add_apbx_dma() \
> > +	mxs_add_dma(&mx28_dma_data[1])
> > +
> 
> Given that the DMA device is fully internal to the SoC and always
> present, does it make sense to add it dynamically and to leave
> registration to the boards?
> 
OK.  Will make it in initcall.  Correct me if this is not what you
expect.

Regards,
Shawn




More information about the linux-arm-kernel mailing list