All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -v2] drm/exynos: do not disable hdmi clocks for exynos5420
@ 2015-02-02 14:26 Gustavo Padovan
  2015-02-03  5:28 ` Joonyoung Shim
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo Padovan @ 2015-02-02 14:26 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Prathyush K, dri-devel, liquid.acid, kgene, m.szyprowski

From: Prathyush K <prathyush.k@samsung.com>

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.

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 6aa0d65..c6baf64 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -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);
-- 
1.9.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH -v2] drm/exynos: do not disable hdmi clocks for exynos5420
  2015-02-02 14:26 [PATCH -v2] drm/exynos: do not disable hdmi clocks for exynos5420 Gustavo Padovan
@ 2015-02-03  5:28 ` Joonyoung Shim
  0 siblings, 0 replies; 2+ messages in thread
From: Joonyoung Shim @ 2015-02-03  5:28 UTC (permalink / raw)
  To: Gustavo Padovan, linux-samsung-soc
  Cc: Prathyush K, dri-devel, liquid.acid, kgene, m.szyprowski

Hi,

On 02/02/2015 11:26 PM, Gustavo Padovan wrote:
> From: Prathyush K <prathyush.k@samsung.com>
> 
> 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.
> 
> Signed-off-by: Prathyush K <prathyush.k@samsung.com>
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  drivers/gpu/drm/exynos/exynos_hdmi.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 6aa0d65..c6baf64 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -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);
> 

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

Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>

Thanks.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-02-03  5:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-02 14:26 [PATCH -v2] drm/exynos: do not disable hdmi clocks for exynos5420 Gustavo Padovan
2015-02-03  5:28 ` Joonyoung Shim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.