aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-04-04 11:08:05 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-04-06 14:21:24 -0400
commit2ce51f8b931a0e8b75dacbdff6df27d9be9da49f (patch)
tree3144eddadedc4237a6b66c11700f64aed852f975 /arch/arm
parent4a0f081d1b41cfe68df153d0bac7ad6baf226791 (diff)
ARM: arch-shmobile: only run HDMI init on respective boards
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> Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c11
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c10
2 files changed, 8 insertions, 13 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 783b66fa95fb..53c15e186edb 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 = {
947 &ap4evb_camera, 947 &ap4evb_camera,
948}; 948};
949 949
950static int __init hdmi_init_pm_clock(void) 950static void __init hdmi_init_pm_clock(void)
951{ 951{
952 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick"); 952 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
953 int ret; 953 int ret;
@@ -988,19 +988,14 @@ static int __init hdmi_init_pm_clock(void)
988 pr_debug("PLLC2 set frequency %lu\n", rate); 988 pr_debug("PLLC2 set frequency %lu\n", rate);
989 989
990 ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk); 990 ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
991 if (ret < 0) { 991 if (ret < 0)
992 pr_err("Cannot set HDMI parent: %d\n", ret); 992 pr_err("Cannot set HDMI parent: %d\n", ret);
993 goto out;
994 }
995 993
996out: 994out:
997 if (!IS_ERR(hdmi_ick)) 995 if (!IS_ERR(hdmi_ick))
998 clk_put(hdmi_ick); 996 clk_put(hdmi_ick);
999 return ret;
1000} 997}
1001 998
1002device_initcall(hdmi_init_pm_clock);
1003
1004static int __init fsi_init_pm_clock(void) 999static int __init fsi_init_pm_clock(void)
1005{ 1000{
1006 struct clk *fsia_ick; 1001 struct clk *fsia_ick;
@@ -1348,6 +1343,8 @@ static void __init ap4evb_init(void)
1348 __raw_writel(srcr4 & ~(1 << 13), SRCR4); 1343 __raw_writel(srcr4 & ~(1 << 13), SRCR4);
1349 1344
1350 platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices)); 1345 platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
1346
1347 hdmi_init_pm_clock();
1351} 1348}
1352 1349
1353static void __init ap4evb_timer_init(void) 1350static 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 8184d4d4f234..7da2ca24229d 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 = {
423 .name = "sh_fsi2_b_hdmi", 423 .name = "sh_fsi2_b_hdmi",
424}; 424};
425 425
426static int __init hdmi_init_pm_clock(void) 426static void __init hdmi_init_pm_clock(void)
427{ 427{
428 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick"); 428 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
429 int ret; 429 int ret;
@@ -467,17 +467,13 @@ static int __init hdmi_init_pm_clock(void)
467 pr_debug("PLLC2 set frequency %lu\n", rate); 467 pr_debug("PLLC2 set frequency %lu\n", rate);
468 468
469 ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk); 469 ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
470 if (ret < 0) { 470 if (ret < 0)
471 pr_err("Cannot set HDMI parent: %d\n", ret); 471 pr_err("Cannot set HDMI parent: %d\n", ret);
472 goto out;
473 }
474 472
475out: 473out:
476 if (!IS_ERR(hdmi_ick)) 474 if (!IS_ERR(hdmi_ick))
477 clk_put(hdmi_ick); 475 clk_put(hdmi_ick);
478 return ret;
479} 476}
480device_initcall(hdmi_init_pm_clock);
481 477
482/* USB1 (Host) */ 478/* USB1 (Host) */
483static void usb1_host_port_power(int port, int power) 479static void usb1_host_port_power(int port, int power)
@@ -1218,6 +1214,8 @@ static void __init mackerel_init(void)
1218 sh7372_add_standard_devices(); 1214 sh7372_add_standard_devices();
1219 1215
1220 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices)); 1216 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));
1217
1218 hdmi_init_pm_clock();
1221} 1219}
1222 1220
1223static void __init mackerel_timer_init(void) 1221static void __init mackerel_timer_init(void)