From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Wed, 07 Aug 2013 17:24:17 +0000 Subject: Re: [PATCH 3/5] ARM: shmobile: r8a7790: Add DU and LVDS support Message-Id: <520282C1.4080801@cogentembedded.com> List-Id: References: <1375892397-5822-4-git-send-email-laurent.pinchart+renesas@ideasonboard.com> In-Reply-To: <1375892397-5822-4-git-send-email-laurent.pinchart+renesas@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-sh@vger.kernel.org Hello. On 08/07/2013 08:19 PM, Laurent Pinchart wrote: > Add a function to register the DU device with board-specific platform > data. > Signed-off-by: Laurent Pinchart > --- > arch/arm/mach-shmobile/include/mach/r8a7790.h | 3 +++ > arch/arm/mach-shmobile/setup-r8a7790.c | 27 +++++++++++++++++++++++++++ > 2 files changed, 30 insertions(+) > diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h > index 788d559..5ffa8ce 100644 > --- a/arch/arm/mach-shmobile/include/mach/r8a7790.h > +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h > @@ -1,8 +1,11 @@ > #ifndef __ASM_R8A7790_H__ > #define __ASM_R8A7790_H__ > > +struct rcar_du_platform_data; > + > void r8a7790_add_standard_devices(void); > void r8a7790_add_dt_devices(void); > +void r8a7790_add_du_device(struct rcar_du_platform_data *pdata); > void r8a7790_clock_init(void); > void r8a7790_pinmux_init(void); > void r8a7790_init_delay(void); > diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c > index d0f5c9f..d1c22d2 100644 > --- a/arch/arm/mach-shmobile/setup-r8a7790.c > +++ b/arch/arm/mach-shmobile/setup-r8a7790.c > @@ -19,10 +19,12 @@ > */ > > #include > +#include > #include > #include > #include > #include > +#include It's easier to just include it into r8a7790.h. > #include > #include > #include > @@ -75,6 +77,31 @@ void __init r8a7790_pinmux_init(void) > r8a7790_register_gpio(5); > } > > +/* DU */ > +static const struct resource du_resources[] = { Should be annotated with '__initdata' as platfrom_device_register_full() will eventually kmemdup() these data anyway. > + DEFINE_RES_MEM(0xfeb00000, 0x70000), > + DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"), > + DEFINE_RES_MEM_NAMED(0xfeb94000, 0x1c, "lvds.1"), > + DEFINE_RES_IRQ(gic_spi(256)), > + DEFINE_RES_IRQ(gic_spi(268)), > + DEFINE_RES_IRQ(gic_spi(269)), > +}; > + > +void __init r8a7790_add_du_device(struct rcar_du_platform_data *pdata) > +{ > + struct platform_device_info info = { > + .name = "rcar-du-r8a7790", > + .id = -1, > + .res = du_resources, > + .num_res = ARRAY_SIZE(du_resources), > + .data = pdata, > + .size_data = sizeof(*pdata), > + .dma_mask = DMA_BIT_MASK(32), > + }; > + > + platform_device_register_full(&info); > +} > + WBR, Sergei