All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] video: exynos_dp: check time loop for RPLY_RECEIV
@ 2012-08-08  1:10 Jingoo Han
  2012-08-23 20:42 ` Florian Tobias Schandinat
  0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2012-08-08  1:10 UTC (permalink / raw)
  To: linux-fbdev

This patch checks time loop for RPLY_RECEIV which means that
AUX channel command reply is received.

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

diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
index 2db5b9a..174c445 100644
--- a/drivers/video/exynos/exynos_dp_reg.c
+++ b/drivers/video/exynos/exynos_dp_reg.c
@@ -401,6 +401,7 @@ int exynos_dp_start_aux_transaction(struct exynos_dp_device *dp)
 {
 	int reg;
 	int retval = 0;
+	int timeout_loop = 0;
 
 	/* Enable AUX CH operation */
 	reg = readl(dp->reg_base + EXYNOS_DP_AUX_CH_CTL_2);
@@ -409,8 +410,15 @@ int exynos_dp_start_aux_transaction(struct exynos_dp_device *dp)
 
 	/* Is AUX CH command reply received? */
 	reg = readl(dp->reg_base + EXYNOS_DP_INT_STA);
-	while (!(reg & RPLY_RECEIV))
+	while (!(reg & RPLY_RECEIV)) {
+		timeout_loop++;
+		if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
+			dev_err(dp->dev, "AUX CH command reply failed!\n");
+			return -ETIMEDOUT;
+		}
 		reg = readl(dp->reg_base + EXYNOS_DP_INT_STA);
+		usleep_range(10, 11);
+	}
 
 	/* Clear interrupt source for AUX CH command reply */
 	writel(RPLY_RECEIV, dp->reg_base + EXYNOS_DP_INT_STA);
-- 
1.7.1



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

* Re: [PATCH] video: exynos_dp: check time loop for RPLY_RECEIV
  2012-08-08  1:10 [PATCH] video: exynos_dp: check time loop for RPLY_RECEIV Jingoo Han
@ 2012-08-23 20:42 ` Florian Tobias Schandinat
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Tobias Schandinat @ 2012-08-23 20:42 UTC (permalink / raw)
  To: linux-fbdev

On 08/08/2012 01:10 AM, Jingoo Han wrote:
> This patch checks time loop for RPLY_RECEIV which means that
> AUX channel command reply is received.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/exynos/exynos_dp_reg.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c
> index 2db5b9a..174c445 100644
> --- a/drivers/video/exynos/exynos_dp_reg.c
> +++ b/drivers/video/exynos/exynos_dp_reg.c
> @@ -401,6 +401,7 @@ int exynos_dp_start_aux_transaction(struct exynos_dp_device *dp)
>  {
>  	int reg;
>  	int retval = 0;
> +	int timeout_loop = 0;
>  
>  	/* Enable AUX CH operation */
>  	reg = readl(dp->reg_base + EXYNOS_DP_AUX_CH_CTL_2);
> @@ -409,8 +410,15 @@ int exynos_dp_start_aux_transaction(struct exynos_dp_device *dp)
>  
>  	/* Is AUX CH command reply received? */
>  	reg = readl(dp->reg_base + EXYNOS_DP_INT_STA);
> -	while (!(reg & RPLY_RECEIV))
> +	while (!(reg & RPLY_RECEIV)) {
> +		timeout_loop++;
> +		if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
> +			dev_err(dp->dev, "AUX CH command reply failed!\n");
> +			return -ETIMEDOUT;
> +		}
>  		reg = readl(dp->reg_base + EXYNOS_DP_INT_STA);
> +		usleep_range(10, 11);
> +	}
>  
>  	/* Clear interrupt source for AUX CH command reply */
>  	writel(RPLY_RECEIV, dp->reg_base + EXYNOS_DP_INT_STA);


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

end of thread, other threads:[~2012-08-23 20:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-08  1:10 [PATCH] video: exynos_dp: check time loop for RPLY_RECEIV Jingoo Han
2012-08-23 20:42 ` Florian Tobias Schandinat

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.