linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy
@ 2013-07-26  7:35 Kuninori Morimoto
  2013-07-26 13:14 ` Sergei Shtylyov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2013-07-26  7:35 UTC (permalink / raw)
  To: linux-sh

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>
---
v1 -> v2
 - based on renesas-devel-20130726
 - update git log

 arch/arm/mach-shmobile/board-marzen.c         |   24 ++++++++++++++++++++++--
 arch/arm/mach-shmobile/include/mach/r8a7779.h |    2 --
 arch/arm/mach-shmobile/setup-r8a7779.c        |   17 -----------------
 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 1f57865..7474a60 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -29,6 +29,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/gpio-rcar.h>
+#include <linux/platform_data/usb-rcar-phy.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/smsc911x.h>
@@ -56,7 +57,26 @@ static struct regulator_consumer_supply dummy_supplies[] = {
 	REGULATOR_SUPPLY("vdd33a", "smsc911x"),
 };
 
-static struct rcar_phy_platform_data usb_phy_platform_data __initdata;
+/* USB PHY */
+static struct resource usb_phy_resources[] = {
+	[0] = {
+		.start		= 0xffe70800,
+		.end		= 0xffe70900 - 1,
+		.flags		= IORESOURCE_MEM,
+	},
+};
+
+static struct rcar_phy_platform_data usb_phy_platform_data;
+
+static struct platform_device usb_phy = {
+	.name		= "rcar_usb_phy",
+	.id		= -1,
+	.dev  = {
+		.platform_data = &usb_phy_platform_data,
+	},
+	.resource	= usb_phy_resources,
+	.num_resources	= ARRAY_SIZE(usb_phy_resources),
+};
 
 /* SMSC LAN89218 */
 static struct resource smsc911x_resources[] = {
@@ -183,6 +203,7 @@ static struct platform_device *marzen_devices[] __initdata = {
 	&thermal_device,
 	&hspi_device,
 	&leds_device,
+	&usb_phy,
 };
 
 static const struct pinctrl_map marzen_pinctrl_map[] = {
@@ -233,7 +254,6 @@ static void __init marzen_init(void)
 	r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
 
 	r8a7779_add_standard_devices();
-	r8a7779_add_usb_phy_device(&usb_phy_platform_data);
 	platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
 }
 
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index fc47073..f10727f7 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -4,7 +4,6 @@
 #include <linux/sh_clk.h>
 #include <linux/pm_domain.h>
 #include <linux/sh_eth.h>
-#include <linux/platform_data/usb-rcar-phy.h>
 
 struct platform_device;
 
@@ -34,7 +33,6 @@ extern void r8a7779_add_early_devices(void);
 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);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index bb8b967..ddee4aa 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 = {
 	},
 };
 
-/* USB PHY */
-static struct resource usb_phy_resources[] __initdata = {
-	[0] = {
-		.start		= 0xffe70800,
-		.end		= 0xffe70900 - 1,
-		.flags		= IORESOURCE_MEM,
-	},
-};
-
 /* USB */
 static struct usb_phy *phy;
 
@@ -600,14 +591,6 @@ void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
 					  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) { }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy
  2013-07-26  7:35 [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy Kuninori Morimoto
@ 2013-07-26 13:14 ` Sergei Shtylyov
  2013-07-30  2:39 ` Simon Horman
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2013-07-26 13:14 UTC (permalink / raw)
  To: linux-sh

Hello.

On 26-07-2013 11:35, Kuninori Morimoto wrote:

    The subject hardly matches what's being done in the patch.

> usb phy driver which needs platform data at the time of
> registration is used from BockW only.

    s/BockW/Marzen/.

> 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>

    I cannot approve this patch. I see it as nothing other as pointless churn.
My opinion probably doesn't matter in the light of Magnus' desire to get it 
merged but I'm still clinging to it.

WBR, Sergei


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy
  2013-07-26  7:35 [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy Kuninori Morimoto
  2013-07-26 13:14 ` Sergei Shtylyov
@ 2013-07-30  2:39 ` Simon Horman
  2013-07-30  2:44 ` Simon Horman
  2013-07-30  2:47 ` Simon Horman
  3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2013-07-30  2:39 UTC (permalink / raw)
  To: linux-sh

On Fri, Jul 26, 2013 at 05:14:48PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 26-07-2013 11:35, Kuninori Morimoto wrote:
> 
>    The subject hardly matches what's being done in the patch.
> 
> >usb phy driver which needs platform data at the time of
> >registration is used from BockW only.
> 
>    s/BockW/Marzen/.
> 
> >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>
> 
>    I cannot approve this patch. I see it as nothing other as pointless churn.
> My opinion probably doesn't matter in the light of Magnus' desire to
> get it merged but I'm still clinging to it.

Magnus has explained quite clearly the reasons for this change,
which are to make this board consistent with other boards which
are written in this way for historical reasons.

I understand that you have a different opinion but
the place for cleanly separating SoC and board code is
in DT not in the legacy C code.

Both Magnus and now I are in agreement on this.

I plan to fix up s/BockW/Marzen/ and queue up this patch for v3.12
in the cleanup3 branch.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy
  2013-07-26  7:35 [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy Kuninori Morimoto
  2013-07-26 13:14 ` Sergei Shtylyov
  2013-07-30  2:39 ` Simon Horman
@ 2013-07-30  2:44 ` Simon Horman
  2013-07-30  2:47 ` Simon Horman
  3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2013-07-30  2:44 UTC (permalink / raw)
  To: linux-sh

On Tue, Jul 30, 2013 at 11:39:18AM +0900, Simon Horman wrote:
> On Fri, Jul 26, 2013 at 05:14:48PM +0400, Sergei Shtylyov wrote:
> > Hello.
> > 
> > On 26-07-2013 11:35, Kuninori Morimoto wrote:
> > 
> >    The subject hardly matches what's being done in the patch.
> > 
> > >usb phy driver which needs platform data at the time of
> > >registration is used from BockW only.
> > 
> >    s/BockW/Marzen/.
> > 
> > >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>
> > 
> >    I cannot approve this patch. I see it as nothing other as pointless churn.
> > My opinion probably doesn't matter in the light of Magnus' desire to
> > get it merged but I'm still clinging to it.
> 
> Magnus has explained quite clearly the reasons for this change,
> which are to make this board consistent with other boards which
> are written in this way for historical reasons.
> 
> I understand that you have a different opinion but
> the place for cleanly separating SoC and board code is
> in DT not in the legacy C code.
> 
> Both Magnus and now I are in agreement on this.
> 
> I plan to fix up s/BockW/Marzen/ and queue up this patch for v3.12
> in the cleanup3 branch.

As this is a r8a7779 patch it turns out that the cleanup2
branch has all the dependencies so I have queued-up this patch there.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy
  2013-07-26  7:35 [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2013-07-30  2:44 ` Simon Horman
@ 2013-07-30  2:47 ` Simon Horman
  3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2013-07-30  2:47 UTC (permalink / raw)
  To: linux-sh

On Tue, Jul 30, 2013 at 11:44:08AM +0900, Simon Horman wrote:
> On Tue, Jul 30, 2013 at 11:39:18AM +0900, Simon Horman wrote:
> > On Fri, Jul 26, 2013 at 05:14:48PM +0400, Sergei Shtylyov wrote:
> > > Hello.
> > > 
> > > On 26-07-2013 11:35, Kuninori Morimoto wrote:
> > > 
> > >    The subject hardly matches what's being done in the patch.
> > > 
> > > >usb phy driver which needs platform data at the time of
> > > >registration is used from BockW only.
> > > 
> > >    s/BockW/Marzen/.
> > > 
> > > >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>
> > > 
> > >    I cannot approve this patch. I see it as nothing other as pointless churn.
> > > My opinion probably doesn't matter in the light of Magnus' desire to
> > > get it merged but I'm still clinging to it.
> > 
> > Magnus has explained quite clearly the reasons for this change,
> > which are to make this board consistent with other boards which
> > are written in this way for historical reasons.
> > 
> > I understand that you have a different opinion but
> > the place for cleanly separating SoC and board code is
> > in DT not in the legacy C code.
> > 
> > Both Magnus and now I are in agreement on this.
> > 
> > I plan to fix up s/BockW/Marzen/ and queue up this patch for v3.12
> > in the cleanup3 branch.
> 
> As this is a r8a7779 patch it turns out that the cleanup2
> branch has all the dependencies so I have queued-up this patch there.

Incidently, I am going to lunch now, so I will not be pushing
anything I have queued-up this morning until this afternoon.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-30  2:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-26  7:35 [PATCH 6/6 v2] ARM: shmobile: r8a7779: cleanup registration of usb phy Kuninori Morimoto
2013-07-26 13:14 ` Sergei Shtylyov
2013-07-30  2:39 ` Simon Horman
2013-07-30  2:44 ` Simon Horman
2013-07-30  2:47 ` Simon Horman

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).