aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-07-26 03:35:29 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-07-29 22:41:11 -0400
commitfee529df76ffb95ede5020266820f2a0e1f64adc (patch)
tree155adf17e1d11684765c9dd0d1b7aa89dd0a8f62
parentd2ef0b9a5192e921490d2f66f4467f26235412bd (diff)
ARM: shmobile: r8a7779: cleanup registration of usb phy
usb phy 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> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c24
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h2
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c17
3 files changed, 22 insertions, 21 deletions
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 1f57865a07be..7474a60f98ae 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -29,6 +29,7 @@
29#include <linux/dma-mapping.h> 29#include <linux/dma-mapping.h>
30#include <linux/pinctrl/machine.h> 30#include <linux/pinctrl/machine.h>
31#include <linux/platform_data/gpio-rcar.h> 31#include <linux/platform_data/gpio-rcar.h>
32#include <linux/platform_data/usb-rcar-phy.h>
32#include <linux/regulator/fixed.h> 33#include <linux/regulator/fixed.h>
33#include <linux/regulator/machine.h> 34#include <linux/regulator/machine.h>
34#include <linux/smsc911x.h> 35#include <linux/smsc911x.h>
@@ -56,7 +57,26 @@ static struct regulator_consumer_supply dummy_supplies[] = {
56 REGULATOR_SUPPLY("vdd33a", "smsc911x"), 57 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
57}; 58};
58 59
59static struct rcar_phy_platform_data usb_phy_platform_data __initdata; 60/* USB PHY */
61static struct resource usb_phy_resources[] = {
62 [0] = {
63 .start = 0xffe70800,
64 .end = 0xffe70900 - 1,
65 .flags = IORESOURCE_MEM,
66 },
67};
68
69static struct rcar_phy_platform_data usb_phy_platform_data;
70
71static struct platform_device usb_phy = {
72 .name = "rcar_usb_phy",
73 .id = -1,
74 .dev = {
75 .platform_data = &usb_phy_platform_data,
76 },
77 .resource = usb_phy_resources,
78 .num_resources = ARRAY_SIZE(usb_phy_resources),
79};
60 80
61/* SMSC LAN89218 */ 81/* SMSC LAN89218 */
62static struct resource smsc911x_resources[] = { 82static struct resource smsc911x_resources[] = {
@@ -183,6 +203,7 @@ static struct platform_device *marzen_devices[] __initdata = {
183 &thermal_device, 203 &thermal_device,
184 &hspi_device, 204 &hspi_device,
185 &leds_device, 205 &leds_device,
206 &usb_phy,
186}; 207};
187 208
188static const struct pinctrl_map marzen_pinctrl_map[] = { 209static const struct pinctrl_map marzen_pinctrl_map[] = {
@@ -233,7 +254,6 @@ static void __init marzen_init(void)
233 r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */ 254 r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
234 255
235 r8a7779_add_standard_devices(); 256 r8a7779_add_standard_devices();
236 r8a7779_add_usb_phy_device(&usb_phy_platform_data);
237 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 257 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
238} 258}
239 259
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index fc47073c7ba9..f10727f77b11 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -4,7 +4,6 @@
4#include <linux/sh_clk.h> 4#include <linux/sh_clk.h>
5#include <linux/pm_domain.h> 5#include <linux/pm_domain.h>
6#include <linux/sh_eth.h> 6#include <linux/sh_eth.h>
7#include <linux/platform_data/usb-rcar-phy.h>
8 7
9struct platform_device; 8struct platform_device;
10 9
@@ -34,7 +33,6 @@ extern void r8a7779_add_early_devices(void);
34extern void r8a7779_add_standard_devices(void); 33extern void r8a7779_add_standard_devices(void);
35extern void r8a7779_add_standard_devices_dt(void); 34extern void r8a7779_add_standard_devices_dt(void);
36extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata); 35extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata);
37extern void r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
38extern void r8a7779_init_late(void); 36extern void r8a7779_init_late(void);
39extern void r8a7779_clock_init(void); 37extern void r8a7779_clock_init(void);
40extern void r8a7779_pinmux_init(void); 38extern void r8a7779_pinmux_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index bb8b9678d203..ddee4aa8e669 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -386,15 +386,6 @@ static struct platform_device sata_device = {
386 }, 386 },
387}; 387};
388 388
389/* USB PHY */
390static struct resource usb_phy_resources[] __initdata = {
391 [0] = {
392 .start = 0xffe70800,
393 .end = 0xffe70900 - 1,
394 .flags = IORESOURCE_MEM,
395 },
396};
397
398/* USB */ 389/* USB */
399static struct usb_phy *phy; 390static struct usb_phy *phy;
400 391
@@ -600,14 +591,6 @@ void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
600 pdata, sizeof(*pdata)); 591 pdata, sizeof(*pdata));
601} 592}
602 593
603void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
604{
605 platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
606 usb_phy_resources,
607 ARRAY_SIZE(usb_phy_resources),
608 pdata, sizeof(*pdata));
609}
610
611/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 594/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
612void __init __weak r8a7779_register_twd(void) { } 595void __init __weak r8a7779_register_twd(void) { }
613 596