All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: linux-samsung-soc@vger.kernel.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Tobias Jakobi <liquid.acid@gmx.net>,
	inki.dae@samsung.com, Prathyush K <prathyush.k@samsung.com>
Subject: [RFC] drm/exynos: move hdmi clk disable out of pm ops
Date: Thu, 29 Jan 2015 11:31:13 -0200	[thread overview]
Message-ID: <1422538273-3097-1-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <CABxcv=nNKrF45TL3_1BZHMzfKj1xPm6TzUGRSZ3WgJxzyUSmxQ@mail.gmail.com>

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 moves the clk enable/disable of hdmi and sclk_hdmi
outside of the pm ops. Now system suspends and resumes with HDMI
connected with VPLL set at 70.5 MHz.

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>

---
This work depends on the HDMI support patches from Javier:
https://lkml.org/lkml/2015/1/20/235

This patch comes from a downstream tree (Google chormeOS) and it is
authored by a Samsung employee, but we still think this may not fix
the real cause of the bug, there might be something else that we
haven't found that could be the cause of this issue. Anyone has some
comment to add here?
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 6aa0d65..7a473cb 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2064,9 +2064,6 @@ static void hdmi_poweron(struct exynos_drm_display *display)
 	regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL,
 			PMU_HDMI_PHY_ENABLE_BIT, 1);
 
-	clk_prepare_enable(res->hdmi);
-	clk_prepare_enable(res->sclk_hdmi);
-
 	hdmiphy_poweron(hdata);
 	hdmi_commit(display);
 }
@@ -2088,9 +2085,6 @@ static void hdmi_poweroff(struct exynos_drm_display *display)
 
 	cancel_delayed_work(&hdata->hotplug_work);
 
-	clk_disable_unprepare(res->sclk_hdmi);
-	clk_disable_unprepare(res->hdmi);
-
 	/* reset pmu hdmiphy control bit to disable hdmiphy */
 	regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL,
 			PMU_HDMI_PHY_ENABLE_BIT, 0);
@@ -2254,6 +2248,14 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
 	} else
 		res->reg_hdmi_en = NULL;
 
+	/*
+	 * These two clocks are not moved into hdmi_poweron/off since system
+	 * fails to suspend if VPLL clock of 70.5 MHz is used and these
+	 * clocks are disabled before suspend. So enable them here.
+	 */
+	clk_prepare_enable(res->sclk_hdmi);
+	clk_prepare_enable(res->hdmi);
+
 	return ret;
 fail:
 	DRM_ERROR("HDMI resource init - failed\n");
@@ -2516,6 +2518,9 @@ static int hdmi_remove(struct platform_device *pdev)
 	if (hdata->res.reg_hdmi_en)
 		regulator_disable(hdata->res.reg_hdmi_en);
 
+	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

  reply	other threads:[~2015-01-29 13:33 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  9:39 [PATCH v2 0/6] Enable HDMI support on Exynos platforms Marek Szyprowski
2015-01-13  9:39 ` [PATCH v2 1/6] ARM: Exynos: add support for sub-power domains Marek Szyprowski
2015-01-13 10:44   ` Ulf Hansson
2015-01-13 10:53     ` Marek Szyprowski
2015-01-13 14:44       ` Ulf Hansson
2015-01-13  9:39 ` [PATCH v2 2/6] ARM: dts: exynos4: add hdmi related nodes Marek Szyprowski
2015-01-13  9:39 ` [PATCH v2 3/6] ARM: dts: exynos4: add dependency between TV and LCD0 power domains Marek Szyprowski
2015-01-13  9:39 ` [PATCH v2 4/6] ARM: dts: exynos4412-odroid: enable hdmi support Marek Szyprowski
2015-01-13  9:41 ` [PATCH v2 5/6] ARM: dts: exynos4210-universal_c210: " Marek Szyprowski
2015-01-13  9:41 ` [PATCH v2 6/6] ARM: dts: exynos5250: add display power domain Marek Szyprowski
2015-01-14 15:25 ` [PATCH v2 0/6] Enable HDMI support on Exynos platforms Tobias Jakobi
2015-01-15 10:06   ` Marek Szyprowski
2015-01-15 10:10     ` Tobias Jakobi
2015-01-15 10:26       ` Marek Szyprowski
2015-01-15 10:41         ` Joonyoung Shim
2015-01-15 13:57           ` Tobias Jakobi
2015-01-15 13:59     ` Tobias Jakobi
2015-01-15 23:54     ` Tobias Jakobi
2015-01-16 22:32       ` Tobias Jakobi
2015-01-16 22:44         ` Tobias Jakobi
2015-01-19  6:04           ` Joonyoung Shim
2015-01-19 16:30         ` Marek Szyprowski
2015-01-19 23:03           ` Tobias Jakobi
2015-01-20  7:54             ` Marek Szyprowski
2015-01-19 23:33           ` Tobias Jakobi
2015-01-20 11:25           ` Javier Martinez Canillas
2015-01-29 13:31             ` Gustavo Padovan [this message]
2015-01-30  2:02               ` [RFC] drm/exynos: move hdmi clk disable out of pm ops Joonyoung Shim
2015-01-30  8:03                 ` Javier Martinez Canillas
2015-01-30  8:05                   ` Javier Martinez Canillas
2015-01-30  8:27                   ` Joonyoung Shim
2015-01-30 21:45                     ` [PATCH] drm/exynos: don' disable hdmi clocks for exynos5420 Gustavo Padovan
2015-02-02  5:34                       ` Joonyoung Shim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422538273-3097-1-git-send-email-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=a.hajda@samsung.com \
    --cc=inki.dae@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=liquid.acid@gmx.net \
    --cc=m.szyprowski@samsung.com \
    --cc=prathyush.k@samsung.com \
    --cc=s.nawrocki@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.