Skip to contentSkip to conversation

drm/exynos: do not disable hdmi clocks for exynos5420

PATCH In review Gustavo Padovan 2 participants 2 messages Feb 2, 2015 – Feb 3, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/exynos: do not disable hdmi clocks for exynos5420

From: Prathyush K <[email protected]>

When VPLL clock of less than 140 MHz was used and all the three clocks - hdmiphy, hdmi, sclk_hdmi are disabled, the system hangs during S2R when HDMI is connected. Since we want to use a vpll clock of 70.5 MHz, we cannot disable these 3 clocks before suspending. This patch add an extra clk enable/disable of hdmi and sclk_hdmi outside of the pm ops so these clocks are always enabled. Now system suspends and resumes with HDMI connected with VPLL set at 70.5 MHz.

This is not the best solution, but it inhibits a crash while we figure out what is the correct solution for this issue.

---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/exynos/exynos_hdmi.c +20 -0
index 6aa0d65..c6baf64 100644
@@ -2254,6 +2254,20 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
 	} else
 		res->reg_hdmi_en = NULL;
 
+	/*
+	 * For these two clocks exynos5420 fails to suspend if VPLL clock of
+	 * 70.5 MHz is used and these clocks are disabled before suspend. So
+	 * enable them here.
+	 * Note that this will keep the clocks enabled for the entire
+	 * lifetime of the driver and waste energy when it is suspended.
+	 * However it prevents the system crash until a better solution is
+	 * found
+	 */
+	if (of_device_is_compatible(dev->of_node, "samsung,exynos5420-hdmi")) {
+		clk_prepare_enable(res->sclk_hdmi);
+		clk_prepare_enable(res->hdmi);
+	}
+
 	return ret;
 fail:
 	DRM_ERROR("HDMI resource init - failed\n");
@@ -2516,6 +2530,12 @@ static int hdmi_remove(struct platform_device *pdev)
 	if (hdata->res.reg_hdmi_en)
 		regulator_disable(hdata->res.reg_hdmi_en);
 
+	if (of_device_is_compatible(hdata->dev->of_node,
+				    "samsung,exynos5420-hdmi")) {
+		clk_disable_unprepare(hdata->res.sclk_hdmi);
+		clk_disable_unprepare(hdata->res.hdmi);
+	}
+
 	if (hdata->hdmiphy_port)
 		put_device(&hdata->hdmiphy_port->dev);
 	put_device(&hdata->ddc_adpt->dev);
Signature · 6 lines
1.9.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 49 lines · Gustavo Padovan

From: Prathyush K <[email protected]>

When VPLL clock of less than 140 MHz was used and all the three clocks - hdmiphy, hdmi, sclk_hdmi are disabled, the system hangs during S2R when HDMI is connected. Since we want to use a vpll clock of 70.5 MHz, we cannot disable these 3 clocks before suspending. This patch add an extra clk enable/disable of hdmi and sclk_hdmi outside of the pm ops so these clocks are always enabled. Now system suspends and resumes with HDMI connected with VPLL set at 70.5 MHz.

This is not the best solution, but it inhibits a crash while we figure out what is the correct solution for this issue.

---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/gpu/drm/exynos/exynos_hdmi.c +14 -0
index 6aa0d65..c6baf64 100644
@@ -2254,6 +2254,20 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
 	} else
 		res->reg_hdmi_en = NULL;
 
+	/*
+	 * For these two clocks exynos5420 fails to suspend if VPLL clock of
+	 * 70.5 MHz is used and these clocks are disabled before suspend. So
+	 * enable them here.
+	 * Note that this will keep the clocks enabled for the entire
+	 * lifetime of the driver and waste energy when it is suspended.
+	 * However it prevents the system crash until a better solution is
+	 * found
+	 */
+	if (of_device_is_compatible(dev->of_node, "samsung,exynos5420-hdmi")) {
+		clk_prepare_enable(res->sclk_hdmi);
+		clk_prepare_enable(res->hdmi);
+	}
+
 	return ret;
 fail:
 	DRM_ERROR("HDMI resource init - failed\n");
@@ -2516,6 +2530,12 @@ static int hdmi_remove(struct platform_device *pdev)
 	if (hdata->res.reg_hdmi_en)
 		regulator_disable(hdata->res.reg_hdmi_en);

drivers/gpu/drm/exynos/exynos_hdmi.c static int hdmi_remove(struct platform_device *pdev) · line 2541

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +6 -0
 
+	if (of_device_is_compatible(hdata->dev->of_node,
+				    "samsung,exynos5420-hdmi")) {
+		clk_disable_unprepare(hdata->res.sclk_hdmi);
+		clk_disable_unprepare(hdata->res.hdmi);
+	}
+
 	if (hdata->hdmiphy_port)
 		put_device(&hdata->hdmiphy_port->dev);
 	put_device(&hdata->ddc_adpt->dev);

Looks fine to me but i'm not sure any there are any side effects to change parent clock of mout_hdmi clock.

Thanks.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel