* [PATCH 7/8] ARM: shmobile: Marzen: pass platform data to USB PHY device
@ 2013-04-04 23:10 Sergei Shtylyov
2013-04-05 0:44 ` Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2013-04-04 23:10 UTC (permalink / raw)
To: linux-arm-kernel
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.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
arch/arm/mach-shmobile/board-marzen.c | 5 +++++
arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 ++
arch/arm/mach-shmobile/setup-r8a7779.c | 16 ++++++++--------
3 files changed, 15 insertions(+), 8 deletions(-)
Index: renesas/arch/arm/mach-shmobile/board-marzen.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/board-marzen.c
+++ renesas/arch/arm/mach-shmobile/board-marzen.c
@@ -56,6 +56,10 @@ static struct regulator_consumer_supply
REGULATOR_SUPPLY("vdd33a", "smsc911x"),
};
+static struct rcar_phy_platform_data usb_phy_platform_data = {
+ .usbpctrl0 = 0,
+};
+
/* SMSC LAN89218 */
static struct resource smsc911x_resources[] = {
[0] = {
@@ -230,6 +234,7 @@ static void __init marzen_init(void)
r8a7779_pinmux_init();
r8a7779_add_standard_devices();
+ r8a7779_add_usb_phy_device(&usb_phy_platform_data);
platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
}
Index: renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -4,6 +4,7 @@
#include <linux/sh_clk.h>
#include <linux/pm_domain.h>
#include <linux/sh_eth.h>
+#include <linux/usb/rcar-phy.h>
struct platform_device;
@@ -33,6 +34,7 @@ extern void r8a7779_add_early_devices(vo
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_usb_phy_device(struct rcar_phy_platform_data *pdata);
extern void r8a7779_init_late(void);
extern void r8a7779_clock_init(void);
extern void r8a7779_pinmux_init(void);
Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c
+++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -407,13 +407,6 @@ static struct resource usb_phy_resources
},
};
-static struct platform_device usb_phy_device = {
- .name = "rcar_usb_phy",
- .id = -1,
- .resource = usb_phy_resources,
- .num_resources = ARRAY_SIZE(usb_phy_resources),
-};
-
/* USB */
static struct usb_phy *phy;
@@ -586,7 +579,6 @@ static struct platform_device *r8a7779_d
&scif5_device,
&tmu00_device,
&tmu01_device,
- &usb_phy_device,
};
static struct platform_device *r8a7779_standard_devices[] __initdata = {
@@ -621,6 +613,14 @@ void __init r8a7779_add_ether_device(str
pdata, sizeof(*pdata));
}
+void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
+{
+ platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
+ usb_phy_resources,
+ ARRAY_SIZE(usb_phy_resources),
+ pdata, sizeof(*pdata));
+}
+
/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
void __init __weak r8a7779_register_twd(void) { }
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 7/8] ARM: shmobile: Marzen: pass platform data to USB PHY device
2013-04-04 23:10 [PATCH 7/8] ARM: shmobile: Marzen: pass platform data to USB PHY device Sergei Shtylyov
@ 2013-04-05 0:44 ` Simon Horman
2013-04-05 16:33 ` Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2013-04-05 0:44 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Apr 05, 2013 at 03:10:38AM +0400, Sergei Shtylyov wrote:
> 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.
As per my comment regarding patch 1, I wonder if this could
be split into an SoC patch and a board patch.
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> arch/arm/mach-shmobile/board-marzen.c | 5 +++++
> arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 ++
> arch/arm/mach-shmobile/setup-r8a7779.c | 16 ++++++++--------
> 3 files changed, 15 insertions(+), 8 deletions(-)
>
> Index: renesas/arch/arm/mach-shmobile/board-marzen.c
> ===================================================================
> --- renesas.orig/arch/arm/mach-shmobile/board-marzen.c
> +++ renesas/arch/arm/mach-shmobile/board-marzen.c
> @@ -56,6 +56,10 @@ static struct regulator_consumer_supply
> REGULATOR_SUPPLY("vdd33a", "smsc911x"),
> };
>
> +static struct rcar_phy_platform_data usb_phy_platform_data = {
> + .usbpctrl0 = 0,
> +};
> +
> /* SMSC LAN89218 */
> static struct resource smsc911x_resources[] = {
> [0] = {
> @@ -230,6 +234,7 @@ static void __init marzen_init(void)
> r8a7779_pinmux_init();
>
> r8a7779_add_standard_devices();
> + r8a7779_add_usb_phy_device(&usb_phy_platform_data);
> platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
> }
>
> Index: renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h
> ===================================================================
> --- renesas.orig/arch/arm/mach-shmobile/include/mach/r8a7779.h
> +++ renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h
> @@ -4,6 +4,7 @@
> #include <linux/sh_clk.h>
> #include <linux/pm_domain.h>
> #include <linux/sh_eth.h>
> +#include <linux/usb/rcar-phy.h>
>
> struct platform_device;
>
> @@ -33,6 +34,7 @@ extern void r8a7779_add_early_devices(vo
> 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_usb_phy_device(struct rcar_phy_platform_data *pdata);
> extern void r8a7779_init_late(void);
> extern void r8a7779_clock_init(void);
> extern void r8a7779_pinmux_init(void);
> Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c
> ===================================================================
> --- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c
> +++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c
> @@ -407,13 +407,6 @@ static struct resource usb_phy_resources
> },
> };
>
> -static struct platform_device usb_phy_device = {
> - .name = "rcar_usb_phy",
> - .id = -1,
> - .resource = usb_phy_resources,
> - .num_resources = ARRAY_SIZE(usb_phy_resources),
> -};
> -
> /* USB */
> static struct usb_phy *phy;
>
> @@ -586,7 +579,6 @@ static struct platform_device *r8a7779_d
> &scif5_device,
> &tmu00_device,
> &tmu01_device,
> - &usb_phy_device,
> };
>
> static struct platform_device *r8a7779_standard_devices[] __initdata = {
> @@ -621,6 +613,14 @@ void __init r8a7779_add_ether_device(str
> pdata, sizeof(*pdata));
> }
>
> +void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
> +{
> + platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
> + usb_phy_resources,
> + ARRAY_SIZE(usb_phy_resources),
> + pdata, sizeof(*pdata));
> +}
> +
> /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
> void __init __weak r8a7779_register_twd(void) { }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 7/8] ARM: shmobile: Marzen: pass platform data to USB PHY device
2013-04-05 0:44 ` Simon Horman
@ 2013-04-05 16:33 ` Sergei Shtylyov
0 siblings, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2013-04-05 16:33 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 05-04-2013 4:44, Simon Horman wrote:
>> 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.
> As per my comment regarding patch 1, I wonder if this could
> be split into an SoC patch and a board patch.
No, that'll break bisection as it will cause the PHY driver to not be
registered after the SoC patch, and hence EHCI/OHCI drivers won't load too.
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
WBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-05 16:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 23:10 [PATCH 7/8] ARM: shmobile: Marzen: pass platform data to USB PHY device Sergei Shtylyov
2013-04-05 0:44 ` Simon Horman
2013-04-05 16:33 ` Sergei Shtylyov
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).