diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-07-26 03:34:58 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-08-06 05:07:09 -0400 |
commit | fc55190835e02ba5ae23dff40c92ea96db8ec8b6 (patch) | |
tree | 1e68cb943af9fc9729bf27d2b091edd0e80932bb /arch | |
parent | 044e2121466a2bf528aeb91099df7e37723fb36b (diff) |
ARM: shmobile: r8a7778: cleanup registration of sdhi
sdhi driver which needs platform data at the time of
registration is used from BockW 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>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-shmobile/board-bockw.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a7778.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7778.c | 24 |
3 files changed, 10 insertions, 27 deletions
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index c94622a06be0..1c876abdf317 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/mfd/tmio.h> | 21 | #include <linux/mfd/tmio.h> |
22 | #include <linux/mmc/host.h> | 22 | #include <linux/mmc/host.h> |
23 | #include <linux/mmc/sh_mobile_sdhi.h> | ||
23 | #include <linux/mmc/sh_mmcif.h> | 24 | #include <linux/mmc/sh_mmcif.h> |
24 | #include <linux/mtd/partitions.h> | 25 | #include <linux/mtd/partitions.h> |
25 | #include <linux/pinctrl/machine.h> | 26 | #include <linux/pinctrl/machine.h> |
@@ -93,6 +94,11 @@ static struct sh_mobile_sdhi_info sdhi0_info = { | |||
93 | .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, | 94 | .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, |
94 | }; | 95 | }; |
95 | 96 | ||
97 | static struct resource sdhi0_resources[] __initdata = { | ||
98 | DEFINE_RES_MEM(0xFFE4C000, 0x100), | ||
99 | DEFINE_RES_IRQ(gic_iid(0x77)), | ||
100 | }; | ||
101 | |||
96 | static struct sh_eth_plat_data ether_platform_data __initdata = { | 102 | static struct sh_eth_plat_data ether_platform_data __initdata = { |
97 | .phy = 0x01, | 103 | .phy = 0x01, |
98 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | 104 | .edmac_endian = EDMAC_LITTLE_ENDIAN, |
@@ -253,7 +259,10 @@ static void __init bockw_init(void) | |||
253 | iowrite32(ioread32(base + PUPR4) | (3 << 26), base + PUPR4); | 259 | iowrite32(ioread32(base + PUPR4) | (3 << 26), base + PUPR4); |
254 | iounmap(base); | 260 | iounmap(base); |
255 | 261 | ||
256 | r8a7778_sdhi_init(0, &sdhi0_info); | 262 | platform_device_register_resndata( |
263 | &platform_bus, "sh_mobile_sdhi", 0, | ||
264 | sdhi0_resources, ARRAY_SIZE(sdhi0_resources), | ||
265 | &sdhi0_info, sizeof(struct sh_mobile_sdhi_info)); | ||
257 | } | 266 | } |
258 | } | 267 | } |
259 | 268 | ||
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index a184a13357b6..aaa054497e96 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #ifndef __ASM_R8A7778_H__ | 18 | #ifndef __ASM_R8A7778_H__ |
19 | #define __ASM_R8A7778_H__ | 19 | #define __ASM_R8A7778_H__ |
20 | 20 | ||
21 | #include <linux/mmc/sh_mobile_sdhi.h> | ||
22 | #include <linux/sh_eth.h> | 21 | #include <linux/sh_eth.h> |
23 | 22 | ||
24 | extern void r8a7778_add_standard_devices(void); | 23 | extern void r8a7778_add_standard_devices(void); |
@@ -34,6 +33,5 @@ extern void r8a7778_init_irq_dt(void); | |||
34 | extern void r8a7778_clock_init(void); | 33 | extern void r8a7778_clock_init(void); |
35 | extern void r8a7778_init_irq_extpin(int irlm); | 34 | extern void r8a7778_init_irq_extpin(int irlm); |
36 | extern void r8a7778_pinmux_init(void); | 35 | extern void r8a7778_pinmux_init(void); |
37 | extern void r8a7778_sdhi_init(int id, struct sh_mobile_sdhi_info *info); | ||
38 | 36 | ||
39 | #endif /* __ASM_R8A7778_H__ */ | 37 | #endif /* __ASM_R8A7778_H__ */ |
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 8947507922ff..c585ee0ec006 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c | |||
@@ -234,30 +234,6 @@ void __init r8a7778_pinmux_init(void) | |||
234 | r8a7778_register_gpio(4); | 234 | r8a7778_register_gpio(4); |
235 | }; | 235 | }; |
236 | 236 | ||
237 | /* SDHI */ | ||
238 | static struct resource sdhi_resources[] __initdata = { | ||
239 | /* SDHI0 */ | ||
240 | DEFINE_RES_MEM(0xFFE4C000, 0x100), | ||
241 | DEFINE_RES_IRQ(gic_iid(0x77)), | ||
242 | /* SDHI1 */ | ||
243 | DEFINE_RES_MEM(0xFFE4D000, 0x100), | ||
244 | DEFINE_RES_IRQ(gic_iid(0x78)), | ||
245 | /* SDHI2 */ | ||
246 | DEFINE_RES_MEM(0xFFE4F000, 0x100), | ||
247 | DEFINE_RES_IRQ(gic_iid(0x76)), | ||
248 | }; | ||
249 | |||
250 | void __init r8a7778_sdhi_init(int id, | ||
251 | struct sh_mobile_sdhi_info *info) | ||
252 | { | ||
253 | BUG_ON(id < 0 || id > 2); | ||
254 | |||
255 | platform_device_register_resndata( | ||
256 | &platform_bus, "sh_mobile_sdhi", id, | ||
257 | sdhi_resources + (2 * id), 2, | ||
258 | info, sizeof(*info)); | ||
259 | } | ||
260 | |||
261 | /* I2C */ | 237 | /* I2C */ |
262 | static struct resource i2c_resources[] __initdata = { | 238 | static struct resource i2c_resources[] __initdata = { |
263 | /* I2C0 */ | 239 | /* I2C0 */ |