From patchwork Wed Aug 8 01:10:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 1291591 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 68E2D3FCC5 for ; Wed, 8 Aug 2012 01:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754477Ab2HHBLC (ORCPT ); Tue, 7 Aug 2012 21:11:02 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:11279 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753076Ab2HHBLB (ORCPT ); Tue, 7 Aug 2012 21:11:01 -0400 Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M8E00AC4WLDT160@mailout2.samsung.com> for linux-fbdev@vger.kernel.org; Wed, 08 Aug 2012 10:10:59 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-9e-5021bca3f365 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 13.C9.19326.3ACB1205; Wed, 08 Aug 2012 10:10:59 +0900 (KST) Received: from DOJG1HAN02 ([12.23.119.56]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M8E001QVWMBHBA0@mmp1.samsung.com> for linux-fbdev@vger.kernel.org; Wed, 08 Aug 2012 10:10:59 +0900 (KST) From: Jingoo Han To: 'Florian Tobias Schandinat' Cc: linux-fbdev@vger.kernel.org, 'Jingoo Han' Subject: [PATCH] video: exynos_dp: check time loop for RPLY_RECEIV Date: Wed, 08 Aug 2012 10:10:59 +0900 Message-id: <003901cd7502$abac1ba0$030452e0$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac11AquEzpsHfjqYQ/2RRCwfB5dmqQ== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCLMWRmVeSWpSXmKPExsVy+t9jAd3FexQDDNp/KFuc6PvA6sDo8XmT XABjFJdNSmpOZllqkb5dAlfGgdMHWAu2cVV0fFnO1MB4iqOLkZNDQsBEoulqNzOELSZx4d56 ti5GLg4hgUWMEid+b4dyZjFJ/D+9ggmkik1ATeLLl8PsXYwcHCICVhKbtmqChJkFnCUm3DjB BmILCzhJnHr9CWwoi4CqRGf7cxYQm1fAVmJPbz8jhC0o8WPyPRaIXi2J9TuPM0HY8hKb17xl BhkvIaAu8eivLkhYREBP4sayU8wQJSIS+168Y5zAKDALyaRZSCbNQjJpFpKWBYwsqxhFUwuS C4qT0nMN9YoTc4tL89L1kvNzNzGCw/KZ1A7GlQ0WhxgFOBiVeHijkhUDhFgTy4orcw8xSnAw K4nwtrUChXhTEiurUovy44tKc1KLDzFKc7AoifMae3/1FxJITyxJzU5NLUgtgskycXBKNTAm Lf3D2PWv8Fl2SUpLiD2HyHHj0CDFS1ul7n3XzNhfZaMr0nxt+n1OFwu2CZrzj1aG1cxq+Pkg SltT++YMhqoKd/b7i3mf2ydOSMi4UbXx+4z9L0sy7molfUvNvn73THnsh/3L9s+MT853859f UpJ16ten071y90vn/WThbFHo7ErlWzzvYawSS3FGoqEWc1FxIgAa1CrmRwIAAA== X-TM-AS-MML: No Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org This patch checks time loop for RPLY_RECEIV which means that AUX channel command reply is received. Signed-off-by: Jingoo Han --- 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);