Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ce51f8b authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Paul Mundt
Browse files

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Magnus Damm <damm@opensource.se>
Tested-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 4a0f081d
Loading
Loading
Loading
Loading
+4 −7
Original line number Original line Diff line number Diff line
@@ -947,7 +947,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
	&ap4evb_camera,
	&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");
	struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
	int ret;
	int ret;
@@ -988,19 +988,14 @@ static int __init hdmi_init_pm_clock(void)
	pr_debug("PLLC2 set frequency %lu\n", rate);
	pr_debug("PLLC2 set frequency %lu\n", rate);


	ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
	ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
	if (ret < 0) {
	if (ret < 0)
		pr_err("Cannot set HDMI parent: %d\n", ret);
		pr_err("Cannot set HDMI parent: %d\n", ret);
		goto out;
	}


out:
out:
	if (!IS_ERR(hdmi_ick))
	if (!IS_ERR(hdmi_ick))
		clk_put(hdmi_ick);
		clk_put(hdmi_ick);
	return ret;
}
}


device_initcall(hdmi_init_pm_clock);

static int __init fsi_init_pm_clock(void)
static int __init fsi_init_pm_clock(void)
{
{
	struct clk *fsia_ick;
	struct clk *fsia_ick;
@@ -1348,6 +1343,8 @@ static void __init ap4evb_init(void)
	__raw_writel(srcr4 & ~(1 << 13), SRCR4);
	__raw_writel(srcr4 & ~(1 << 13), SRCR4);


	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));

	hdmi_init_pm_clock();
}
}


static void __init ap4evb_timer_init(void)
static void __init ap4evb_timer_init(void)
+4 −6
Original line number Original line Diff line number Diff line
@@ -423,7 +423,7 @@ static struct platform_device fsi_hdmi_device = {
	.name		= "sh_fsi2_b_hdmi",
	.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");
	struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
	int ret;
	int ret;
@@ -467,17 +467,13 @@ static int __init hdmi_init_pm_clock(void)
	pr_debug("PLLC2 set frequency %lu\n", rate);
	pr_debug("PLLC2 set frequency %lu\n", rate);


	ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
	ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
	if (ret < 0) {
	if (ret < 0)
		pr_err("Cannot set HDMI parent: %d\n", ret);
		pr_err("Cannot set HDMI parent: %d\n", ret);
		goto out;
	}


out:
out:
	if (!IS_ERR(hdmi_ick))
	if (!IS_ERR(hdmi_ick))
		clk_put(hdmi_ick);
		clk_put(hdmi_ick);
	return ret;
}
}
device_initcall(hdmi_init_pm_clock);


/* USB1 (Host) */
/* USB1 (Host) */
static void usb1_host_port_power(int port, int power)
static void usb1_host_port_power(int port, int power)
@@ -1218,6 +1214,8 @@ static void __init mackerel_init(void)
	sh7372_add_standard_devices();
	sh7372_add_standard_devices();


	platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));
	platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));

	hdmi_init_pm_clock();
}
}


static void __init mackerel_timer_init(void)
static void __init mackerel_timer_init(void)