linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective
@ 2011-04-04 15:08 Guennadi Liakhovetski
  2011-04-05  1:22 ` [PATCH/RFC] ARM: arch-shmobile: only run FSI init on respective boards Kuninori Morimoto
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guennadi Liakhovetski @ 2011-04-04 15:08 UTC (permalink / raw)
  To: linux-sh

If several boards are enabled in the kernel configuration, 
hdmi_init_pm_clock() functions from board-ap4evb.c and board-mackerel.c 
will run on any of them. Prevent this by calling these functions from the 
.init_machine() callback instead of using device_initcall().

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Magnus Damm <damm@opensource.se>
---

Marked as RFC, until tested on mackerel

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index a94f29d..fee4f6b 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -947,7 +947,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
 	&ap4evb_camera,
 };
 
-static int __init hdmi_init_pm_clock(void)
+static void __init hdmi_init_pm_clock(void)
 {
 	struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
 	int ret;
@@ -988,19 +988,14 @@ static int __init hdmi_init_pm_clock(void)
 	pr_debug("PLLC2 set frequency %lu\n", rate);
 
 	ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
-	if (ret < 0) {
+	if (ret < 0)
 		pr_err("Cannot set HDMI parent: %d\n", ret);
-		goto out;
-	}
 
 out:
 	if (!IS_ERR(hdmi_ick))
 		clk_put(hdmi_ick);
-	return ret;
 }
 
-device_initcall(hdmi_init_pm_clock);
-
 static int __init fsi_init_pm_clock(void)
 {
 	struct clk *fsia_ick;
@@ -1348,6 +1343,8 @@ static void __init ap4evb_init(void)
 	__raw_writel(srcr4 & ~(1 << 13), SRCR4);
 
 	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
+
+	hdmi_init_pm_clock();
 }
 
 static void __init ap4evb_timer_init(void)
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 49bc074..e70dd57 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -423,7 +423,7 @@ static struct platform_device fsi_hdmi_device = {
 	.name		= "sh_fsi2_b_hdmi",
 };
 
-static int __init hdmi_init_pm_clock(void)
+static void __init hdmi_init_pm_clock(void)
 {
 	struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
 	int ret;
@@ -467,17 +467,13 @@ static int __init hdmi_init_pm_clock(void)
 	pr_debug("PLLC2 set frequency %lu\n", rate);
 
 	ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
-	if (ret < 0) {
+	if (ret < 0)
 		pr_err("Cannot set HDMI parent: %d\n", ret);
-		goto out;
-	}
 
 out:
 	if (!IS_ERR(hdmi_ick))
 		clk_put(hdmi_ick);
-	return ret;
 }
-device_initcall(hdmi_init_pm_clock);
 
 /* USB1 (Host) */
 static void usb1_host_port_power(int port, int power)
@@ -1218,6 +1214,8 @@ static void __init mackerel_init(void)
 	sh7372_add_standard_devices();
 
 	platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));
+
+	hdmi_init_pm_clock();
 }
 
 static void __init mackerel_timer_init(void)

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

* [PATCH/RFC] ARM: arch-shmobile: only run FSI init on respective boards
  2011-04-04 15:08 [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective Guennadi Liakhovetski
@ 2011-04-05  1:22 ` Kuninori Morimoto
  2011-04-06  1:52 ` [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective Kuninori Morimoto
  2011-04-06 18:22 ` [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective boards Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2011-04-05  1:22 UTC (permalink / raw)
  To: linux-sh

If several boards are enabled in the kernel configuration,
fsi_init_pm_clock() functions from board-ap4evb.c
will run on any of them. Prevent this by calling these functions from the
.init_machine() callback instead of using device_initcall().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Magnus Damm <damm@opensource.se>
---
This patch is depend on Guennadi's
[PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective boards

 arch/arm/mach-shmobile/board-ap4evb.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 53c15e1..1e35fa9 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -996,7 +996,7 @@ out:
 		clk_put(hdmi_ick);
 }
 
-static int __init fsi_init_pm_clock(void)
+static void __init fsi_init_pm_clock(void)
 {
 	struct clk *fsia_ick;
 	int ret;
@@ -1005,7 +1005,7 @@ static int __init fsi_init_pm_clock(void)
 	if (IS_ERR(fsia_ick)) {
 		ret = PTR_ERR(fsia_ick);
 		pr_err("Cannot get FSI ICK: %d\n", ret);
-		return ret;
+		return;
 	}
 
 	ret = clk_set_parent(fsia_ick, &sh7372_fsiack_clk);
@@ -1013,10 +1013,7 @@ static int __init fsi_init_pm_clock(void)
 		pr_err("Cannot set FSI-A parent: %d\n", ret);
 
 	clk_put(fsia_ick);
-
-	return ret;
 }
-device_initcall(fsi_init_pm_clock);
 
 /*
  * FIXME !!
@@ -1345,6 +1342,7 @@ static void __init ap4evb_init(void)
 	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
 
 	hdmi_init_pm_clock();
+	fsi_init_pm_clock();
 }
 
 static void __init ap4evb_timer_init(void)
-- 
1.7.1


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

* Re: [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective
  2011-04-04 15:08 [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective Guennadi Liakhovetski
  2011-04-05  1:22 ` [PATCH/RFC] ARM: arch-shmobile: only run FSI init on respective boards Kuninori Morimoto
@ 2011-04-06  1:52 ` Kuninori Morimoto
  2011-04-06 18:22 ` [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective boards Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2011-04-06  1:52 UTC (permalink / raw)
  To: linux-sh

At Mon, 04 Apr 2011 17:08:05 +0200 (CEST),
Guennadi wrote:
> 
> If several boards are enabled in the kernel configuration, 
> hdmi_init_pm_clock() functions from board-ap4evb.c and board-mackerel.c 
> will run on any of them. Prevent this by calling these functions from the 
> .init_machine() callback instead of using device_initcall().
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Magnus Damm <damm@opensource.se>
> ---
> 
> Marked as RFC, until tested on mackerel

I tested this patch on mackerel with v2.6.39-rc1
And it works

Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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

* Re: [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective boards
  2011-04-04 15:08 [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective Guennadi Liakhovetski
  2011-04-05  1:22 ` [PATCH/RFC] ARM: arch-shmobile: only run FSI init on respective boards Kuninori Morimoto
  2011-04-06  1:52 ` [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective Kuninori Morimoto
@ 2011-04-06 18:22 ` Paul Mundt
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2011-04-06 18:22 UTC (permalink / raw)
  To: linux-sh

On Mon, Apr 04, 2011 at 05:08:05PM +0200, Guennadi Liakhovetski wrote:
> If several boards are enabled in the kernel configuration, 
> hdmi_init_pm_clock() functions from board-ap4evb.c and board-mackerel.c 
> will run on any of them. Prevent this by calling these functions from the 
> .init_machine() callback instead of using device_initcall().
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Magnus Damm <damm@opensource.se>

On Tue, Apr 05, 2011 at 10:22:33AM +0900, Kuninori Morimoto wrote:
> If several boards are enabled in the kernel configuration,
> fsi_init_pm_clock() functions from board-ap4evb.c
> will run on any of them. Prevent this by calling these functions from the
> .init_machine() callback instead of using device_initcall().
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Cc: Magnus Damm <damm@opensource.se>

Both applied, thanks.

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

end of thread, other threads:[~2011-04-06 18:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-04 15:08 [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective Guennadi Liakhovetski
2011-04-05  1:22 ` [PATCH/RFC] ARM: arch-shmobile: only run FSI init on respective boards Kuninori Morimoto
2011-04-06  1:52 ` [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective Kuninori Morimoto
2011-04-06 18:22 ` [PATCH/RFC] ARM: arch-shmobile: only run HDMI init on respective boards Paul Mundt

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