* [PATCH] ARM: shmobile: r8a7779: cleanup registration of VIN
@ 2013-10-15 2:45 Kuninori Morimoto
2013-10-15 3:12 ` Magnus Damm
2013-10-16 7:08 ` Simon Horman
0 siblings, 2 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2013-10-15 2:45 UTC (permalink / raw)
To: linux-sh
VIN driver which needs platform data at the time of
registration is used from Marzen only.
Now, ARM/shmobile aims to support DT,
and the C code base board support will be removed
if DT support is completed.
Current driver registration method which needs platform data
and which is not shared complicates codes.
This means legacy C code cleanup after DT supporting
will be more complicated
This patch registers it on board code as cleanup C code
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
This patch is based on renesas-devel-20131011 tag
arch/arm/mach-shmobile/board-marzen.c | 24 ++++++++++++++--
arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 --
arch/arm/mach-shmobile/setup-r8a7779.c | 37 -------------------------
3 files changed, 22 insertions(+), 41 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index da1352f..fa102f7 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -259,10 +259,30 @@ static struct platform_device leds_device = {
},
};
+/* VIN */
static struct rcar_vin_platform_data vin_platform_data __initdata = {
.flags = RCAR_VIN_BT656,
};
+#define MARZEN_VIN(idx) \
+static struct resource vin##idx##_resources[] __initdata = { \
+ DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \
+ DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \
+}; \
+ \
+static struct platform_device_info vin##idx##_info __initdata = { \
+ .parent = &platform_bus, \
+ .name = "r8a7779-vin", \
+ .id = idx, \
+ .res = vin##idx##_resources, \
+ .num_res = ARRAY_SIZE(vin##idx##_resources), \
+ .dma_mask = DMA_BIT_MASK(32), \
+ .data = &vin_platform_data, \
+ .size_data = sizeof(vin_platform_data), \
+}
+MARZEN_VIN(1);
+MARZEN_VIN(3);
+
#define MARZEN_CAMERA(idx) \
static struct i2c_board_info camera##idx##_info = { \
I2C_BOARD_INFO("adv7180", 0x20 + (idx)), \
@@ -367,8 +387,8 @@ static void __init marzen_init(void)
r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
r8a7779_add_standard_devices();
- r8a7779_add_vin_device(1, &vin_platform_data);
- r8a7779_add_vin_device(3, &vin_platform_data);
+ platform_device_register_full(&vin1_info);
+ platform_device_register_full(&vin3_info);
platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
marzen_add_du_device();
}
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index 17af34e..905420a 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -41,8 +41,6 @@ extern void r8a7779_add_early_devices(void);
extern void r8a7779_add_standard_devices(void);
extern void r8a7779_add_standard_devices_dt(void);
extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata);
-extern void r8a7779_add_vin_device(int idx,
- struct rcar_vin_platform_data *pdata);
extern void r8a7779_init_late(void);
extern void r8a7779_clock_init(void);
extern void r8a7779_pinmux_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 13049e9..51a43c5 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -610,33 +610,6 @@ static struct resource ether_resources[] __initdata = {
},
};
-#define R8A7779_VIN(idx) \
-static struct resource vin##idx##_resources[] __initdata = { \
- DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \
- DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \
-}; \
- \
-static struct platform_device_info vin##idx##_info __initdata = { \
- .parent = &platform_bus, \
- .name = "r8a7779-vin", \
- .id = idx, \
- .res = vin##idx##_resources, \
- .num_res = ARRAY_SIZE(vin##idx##_resources), \
- .dma_mask = DMA_BIT_MASK(32), \
-}
-
-R8A7779_VIN(0);
-R8A7779_VIN(1);
-R8A7779_VIN(2);
-R8A7779_VIN(3);
-
-static struct platform_device_info *vin_info_table[] __initdata = {
- &vin0_info,
- &vin1_info,
- &vin2_info,
- &vin3_info,
-};
-
/* HPB-DMA */
/* Asynchronous mode register bits */
@@ -833,16 +806,6 @@ void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
pdata, sizeof(*pdata));
}
-void __init r8a7779_add_vin_device(int id, struct rcar_vin_platform_data *pdata)
-{
- BUG_ON(id < 0 || id > 3);
-
- vin_info_table[id]->data = pdata;
- vin_info_table[id]->size_data = sizeof(*pdata);
-
- platform_device_register_full(vin_info_table[id]);
-}
-
/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
void __init __weak r8a7779_register_twd(void) { }
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: shmobile: r8a7779: cleanup registration of VIN
2013-10-15 2:45 [PATCH] ARM: shmobile: r8a7779: cleanup registration of VIN Kuninori Morimoto
@ 2013-10-15 3:12 ` Magnus Damm
2013-10-16 7:08 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Magnus Damm @ 2013-10-15 3:12 UTC (permalink / raw)
To: linux-sh
Hi Morimoto-san,
On Tue, Oct 15, 2013 at 11:45 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> VIN driver which needs platform data at the time of
> registration is used from Marzen only.
> Now, ARM/shmobile aims to support DT,
> and the C code base board support will be removed
> if DT support is completed.
> Current driver registration method which needs platform data
> and which is not shared complicates codes.
> This means legacy C code cleanup after DT supporting
> will be more complicated
> This patch registers it on board code as cleanup C code
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> This patch is based on renesas-devel-20131011 tag
>
> arch/arm/mach-shmobile/board-marzen.c | 24 ++++++++++++++--
> arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 --
> arch/arm/mach-shmobile/setup-r8a7779.c | 37 -------------------------
> 3 files changed, 22 insertions(+), 41 deletions(-)
Thanks for cleaning up the code, Morimoto-san. Fewer lines and also
device registration in same style as other mach-shmobile SoCs and
boards, I like that.
Acked-by: Magnus Damm <damm@opensource.se>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: shmobile: r8a7779: cleanup registration of VIN
2013-10-15 2:45 [PATCH] ARM: shmobile: r8a7779: cleanup registration of VIN Kuninori Morimoto
2013-10-15 3:12 ` Magnus Damm
@ 2013-10-16 7:08 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2013-10-16 7:08 UTC (permalink / raw)
To: linux-sh
On Tue, Oct 15, 2013 at 12:12:05PM +0900, Magnus Damm wrote:
> Hi Morimoto-san,
>
> On Tue, Oct 15, 2013 at 11:45 AM, Kuninori Morimoto
> <kuninori.morimoto.gx@renesas.com> wrote:
> > VIN driver which needs platform data at the time of
> > registration is used from Marzen only.
> > Now, ARM/shmobile aims to support DT,
> > and the C code base board support will be removed
> > if DT support is completed.
> > Current driver registration method which needs platform data
> > and which is not shared complicates codes.
> > This means legacy C code cleanup after DT supporting
> > will be more complicated
> > This patch registers it on board code as cleanup C code
> >
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> > This patch is based on renesas-devel-20131011 tag
> >
> > arch/arm/mach-shmobile/board-marzen.c | 24 ++++++++++++++--
> > arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 --
> > arch/arm/mach-shmobile/setup-r8a7779.c | 37 -------------------------
> > 3 files changed, 22 insertions(+), 41 deletions(-)
>
> Thanks for cleaning up the code, Morimoto-san. Fewer lines and also
> device registration in same style as other mach-shmobile SoCs and
> boards, I like that.
>
> Acked-by: Magnus Damm <damm@opensource.se>
Thanks, I have queued this up.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-16 7:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-15 2:45 [PATCH] ARM: shmobile: r8a7779: cleanup registration of VIN Kuninori Morimoto
2013-10-15 3:12 ` Magnus Damm
2013-10-16 7:08 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).