aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/setup-r8a7779.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2013-06-01 17:55:04 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-06-11 03:10:48 -0400
commit2437b27c3a016b15183a720c06b23de2bf3f6a10 (patch)
tree9e5d656c43d665ae1edaf36e26b5d6cecee04cc5 /arch/arm/mach-shmobile/setup-r8a7779.c
parent6a82e2a83e568dc121326b4bab24035ce7a2f50e (diff)
ARM: shmobile: Marzen: pass platform data to USB PHY device
Since we're now going to setup the USBPCTRL0 register using the USB PHY device's platform data, we now need a way to pass those platform data from the board file to the device which is situated in setup-r8a7779.c -- and what I'm suggesting is r8a7779_add_usb_phy_device() that will register USB PHY platform device with the passed platform data using platform_device_register_resndata() call; creating this function involves deletion of 'usb_phy_device' from r8a7779_devices_dt[], so that it will no longer be registered for the generic R8A7779 machine (where we can't provide the platform data anyway), hence EHCI/OHCI drivers will fail to load as well. For the Marzen board, this new function will be called from marzen_init() to register the USB PHY device early enough. Note that the board and the SoC code have to be in one patch to keep the code bisectable... The patch has been tested on the Marzen board. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> [horms+renesas@verge.net.au: manually applied] Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7779.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index a00283fe528c..06804a1eb1eb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -389,7 +389,7 @@ static struct platform_device sata_device = {
389}; 389};
390 390
391/* USB PHY */ 391/* USB PHY */
392static struct resource usb_phy_resources[] = { 392static struct resource usb_phy_resources[] __initdata = {
393 [0] = { 393 [0] = {
394 .start = 0xffe70800, 394 .start = 0xffe70800,
395 .end = 0xffe70900 - 1, 395 .end = 0xffe70900 - 1,
@@ -397,13 +397,6 @@ static struct resource usb_phy_resources[] = {
397 }, 397 },
398}; 398};
399 399
400static struct platform_device usb_phy_device = {
401 .name = "rcar_usb_phy",
402 .id = -1,
403 .resource = usb_phy_resources,
404 .num_resources = ARRAY_SIZE(usb_phy_resources),
405};
406
407/* USB */ 400/* USB */
408static struct usb_phy *phy; 401static struct usb_phy *phy;
409 402
@@ -575,7 +568,6 @@ static struct platform_device *r8a7779_devices_dt[] __initdata = {
575 &scif5_device, 568 &scif5_device,
576 &tmu00_device, 569 &tmu00_device,
577 &tmu01_device, 570 &tmu01_device,
578 &usb_phy_device,
579}; 571};
580 572
581static struct platform_device *r8a7779_standard_devices[] __initdata = { 573static struct platform_device *r8a7779_standard_devices[] __initdata = {
@@ -610,6 +602,14 @@ void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
610 pdata, sizeof(*pdata)); 602 pdata, sizeof(*pdata));
611} 603}
612 604
605void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
606{
607 platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
608 usb_phy_resources,
609 ARRAY_SIZE(usb_phy_resources),
610 pdata, sizeof(*pdata));
611}
612
613/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 613/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
614void __init __weak r8a7779_register_twd(void) { } 614void __init __weak r8a7779_register_twd(void) { }
615 615