linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: exynos_dp: check DP PLL Lock status
@ 2012-04-04  6:59 Jingoo Han
  2012-04-23  6:15 ` Florian Tobias Schandinat
  0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2012-04-04  6:59 UTC (permalink / raw)
  To: linux-fbdev

DP PLL Lock status should be checked in order to  prevent unlocked PLL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/video/exynos/exynos_dp_reg.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
index d9c66fd..661d010 100644
--- a/drivers/video/exynos/exynos_dp_reg.c
+++ b/drivers/video/exynos/exynos_dp_reg.c
@@ -285,6 +285,7 @@ void exynos_dp_set_analog_power_down(struct exynos_dp_device *dp,
 void exynos_dp_init_analog_func(struct exynos_dp_device *dp)
 {
 	u32 reg;
+	int timeout_loop = 0;
 
 	exynos_dp_set_analog_power_down(dp, POWER_ALL, 0);
 
@@ -296,9 +297,19 @@ void exynos_dp_init_analog_func(struct exynos_dp_device *dp)
 	writel(reg, dp->reg_base + EXYNOS_DP_DEBUG_CTL);
 
 	/* Power up PLL */
-	if (exynos_dp_get_pll_lock_status(dp) = PLL_UNLOCKED)
+	if (exynos_dp_get_pll_lock_status(dp) = PLL_UNLOCKED) {
 		exynos_dp_set_pll_power_down(dp, 0);
 
+		while (exynos_dp_get_pll_lock_status(dp) = PLL_UNLOCKED) {
+			timeout_loop++;
+			if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
+				dev_err(dp->dev, "failed to get pll lock status\n");
+				return;
+			}
+			usleep_range(10, 20);
+		}
+	}
+
 	/* Enable Serdes FIFO function and Link symbol clock domain module */
 	reg = readl(dp->reg_base + EXYNOS_DP_FUNC_EN_2);
 	reg &= ~(SERDES_FIFO_FUNC_EN_N | LS_CLK_DOMAIN_FUNC_EN_N
-- 
1.7.1



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

* Re: [PATCH] video: exynos_dp: check DP PLL Lock status
  2012-04-04  6:59 [PATCH] video: exynos_dp: check DP PLL Lock status Jingoo Han
@ 2012-04-23  6:15 ` Florian Tobias Schandinat
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Tobias Schandinat @ 2012-04-23  6:15 UTC (permalink / raw)
  To: linux-fbdev

On 04/04/2012 06:59 AM, Jingoo Han wrote:
> DP PLL Lock status should be checked in order to  prevent unlocked PLL.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/exynos/exynos_dp_reg.c |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
> index d9c66fd..661d010 100644
> --- a/drivers/video/exynos/exynos_dp_reg.c
> +++ b/drivers/video/exynos/exynos_dp_reg.c
> @@ -285,6 +285,7 @@ void exynos_dp_set_analog_power_down(struct exynos_dp_device *dp,
>  void exynos_dp_init_analog_func(struct exynos_dp_device *dp)
>  {
>  	u32 reg;
> +	int timeout_loop = 0;
>  
>  	exynos_dp_set_analog_power_down(dp, POWER_ALL, 0);
>  
> @@ -296,9 +297,19 @@ void exynos_dp_init_analog_func(struct exynos_dp_device *dp)
>  	writel(reg, dp->reg_base + EXYNOS_DP_DEBUG_CTL);
>  
>  	/* Power up PLL */
> -	if (exynos_dp_get_pll_lock_status(dp) = PLL_UNLOCKED)
> +	if (exynos_dp_get_pll_lock_status(dp) = PLL_UNLOCKED) {
>  		exynos_dp_set_pll_power_down(dp, 0);
>  
> +		while (exynos_dp_get_pll_lock_status(dp) = PLL_UNLOCKED) {
> +			timeout_loop++;
> +			if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
> +				dev_err(dp->dev, "failed to get pll lock status\n");
> +				return;
> +			}
> +			usleep_range(10, 20);
> +		}
> +	}
> +
>  	/* Enable Serdes FIFO function and Link symbol clock domain module */
>  	reg = readl(dp->reg_base + EXYNOS_DP_FUNC_EN_2);
>  	reg &= ~(SERDES_FIFO_FUNC_EN_N | LS_CLK_DOMAIN_FUNC_EN_N


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

end of thread, other threads:[~2012-04-23  6:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04  6:59 [PATCH] video: exynos_dp: check DP PLL Lock status Jingoo Han
2012-04-23  6:15 ` Florian Tobias Schandinat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).