aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-07-26 02:54:44 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-08-06 05:07:09 -0400
commit044e2121466a2bf528aeb91099df7e37723fb36b (patch)
tree5e36eceb0be832ae7dfddf2f140f6aca0a378548
parenta66c9744574c0e7b5c935c7c1ec84e0e741fb725 (diff)
ARM: shmobile: r8a7778: cleanup registration of usb phy
usb phy 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>
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c15
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7778.h2
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c14
3 files changed, 14 insertions, 17 deletions
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index 58e686d1cad6..c94622a06be0 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -23,6 +23,7 @@
23#include <linux/mmc/sh_mmcif.h> 23#include <linux/mmc/sh_mmcif.h>
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/pinctrl/machine.h> 25#include <linux/pinctrl/machine.h>
26#include <linux/platform_data/usb-rcar-phy.h>
26#include <linux/platform_device.h> 27#include <linux/platform_device.h>
27#include <linux/regulator/fixed.h> 28#include <linux/regulator/fixed.h>
28#include <linux/regulator/machine.h> 29#include <linux/regulator/machine.h>
@@ -78,6 +79,11 @@ static struct resource smsc911x_resources[] = {
78}; 79};
79 80
80/* USB */ 81/* USB */
82static struct resource usb_phy_resources[] __initdata = {
83 DEFINE_RES_MEM(0xffe70800, 0x100),
84 DEFINE_RES_MEM(0xffe76000, 0x100),
85};
86
81static struct rcar_phy_platform_data usb_phy_platform_data __initdata; 87static struct rcar_phy_platform_data usb_phy_platform_data __initdata;
82 88
83/* SDHI */ 89/* SDHI */
@@ -187,7 +193,6 @@ static void __init bockw_init(void)
187 r8a7778_clock_init(); 193 r8a7778_clock_init();
188 r8a7778_init_irq_extpin(1); 194 r8a7778_init_irq_extpin(1);
189 r8a7778_add_standard_devices(); 195 r8a7778_add_standard_devices();
190 r8a7778_add_usb_phy_device(&usb_phy_platform_data);
191 r8a7778_add_ether_device(&ether_platform_data); 196 r8a7778_add_ether_device(&ether_platform_data);
192 r8a7778_add_i2c_device(0); 197 r8a7778_add_i2c_device(0);
193 r8a7778_add_hspi_device(0); 198 r8a7778_add_hspi_device(0);
@@ -205,6 +210,14 @@ static void __init bockw_init(void)
205 mmc_resources, ARRAY_SIZE(mmc_resources), 210 mmc_resources, ARRAY_SIZE(mmc_resources),
206 &sh_mmcif_plat, sizeof(struct sh_mmcif_plat_data)); 211 &sh_mmcif_plat, sizeof(struct sh_mmcif_plat_data));
207 212
213 platform_device_register_resndata(
214 &platform_bus, "rcar_usb_phy", -1,
215 usb_phy_resources,
216 ARRAY_SIZE(usb_phy_resources),
217 &usb_phy_platform_data,
218 sizeof(struct rcar_phy_platform_data));
219
220
208 /* for SMSC */ 221 /* for SMSC */
209 base = ioremap_nocache(FPGA, SZ_1M); 222 base = ioremap_nocache(FPGA, SZ_1M);
210 if (base) { 223 if (base) {
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
index 2f456071732b..a184a13357b6 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7778.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -20,12 +20,10 @@
20 20
21#include <linux/mmc/sh_mobile_sdhi.h> 21#include <linux/mmc/sh_mobile_sdhi.h>
22#include <linux/sh_eth.h> 22#include <linux/sh_eth.h>
23#include <linux/platform_data/usb-rcar-phy.h>
24 23
25extern void r8a7778_add_standard_devices(void); 24extern void r8a7778_add_standard_devices(void);
26extern void r8a7778_add_standard_devices_dt(void); 25extern void r8a7778_add_standard_devices_dt(void);
27extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata); 26extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
28extern void r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
29extern void r8a7778_add_i2c_device(int id); 27extern void r8a7778_add_i2c_device(int id);
30extern void r8a7778_add_hspi_device(int id); 28extern void r8a7778_add_hspi_device(int id);
31extern void r8a7778_add_dt_devices(void); 29extern void r8a7778_add_dt_devices(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 960084626f8b..8947507922ff 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -95,20 +95,6 @@ static struct sh_timer_config sh_tmu1_platform_data __initdata = {
95 &sh_tmu##idx##_platform_data, \ 95 &sh_tmu##idx##_platform_data, \
96 sizeof(sh_tmu##idx##_platform_data)) 96 sizeof(sh_tmu##idx##_platform_data))
97 97
98/* USB PHY */
99static struct resource usb_phy_resources[] __initdata = {
100 DEFINE_RES_MEM(0xffe70800, 0x100),
101 DEFINE_RES_MEM(0xffe76000, 0x100),
102};
103
104void __init r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
105{
106 platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
107 usb_phy_resources,
108 ARRAY_SIZE(usb_phy_resources),
109 pdata, sizeof(*pdata));
110}
111
112/* USB */ 98/* USB */
113static struct usb_phy *phy; 99static struct usb_phy *phy;
114 100