From patchwork Fri Nov 9 05:49:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 1718741 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6D4B4DF264 for ; Fri, 9 Nov 2012 05:49:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750810Ab2KIFt6 (ORCPT ); Fri, 9 Nov 2012 00:49:58 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:31572 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750699Ab2KIFt6 (ORCPT ); Fri, 9 Nov 2012 00:49:58 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MD700GXDHJ7BXA0@mailout1.samsung.com> for linux-fbdev@vger.kernel.org; Fri, 09 Nov 2012 14:49:57 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.50]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C2.76.12699.4899C905; Fri, 09 Nov 2012 14:49:56 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-ce-509c9984adb6 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 82.76.12699.4899C905; Fri, 09 Nov 2012 14:49:56 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MD700A13HJ8SGA0@mmp2.samsung.com> for linux-fbdev@vger.kernel.org; Fri, 09 Nov 2012 14:49:56 +0900 (KST) From: Jingoo Han To: 'Florian Tobias Schandinat' Cc: linux-fbdev@vger.kernel.org, 'Sean Paul' , 'Jingoo Han' References: In-reply-to: Subject: [PATCH v4 3/8] video: exynos_dp: Get pll lock before pattern set Date: Fri, 09 Nov 2012 14:49:56 +0900 Message-id: <001b01cdbe3e$0c49def0$24dd9cd0$%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: Ac2+Pd0+5OZ6ri/CQOacII/BjUUEfAAABmdQ Content-language: ko DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsVy+t8zI92WmXMCDDo3WFuc6PvA6sDo8XmT XABjFJdNSmpOZllqkb5dAldG+95jzAVPuSsWXXvJ3sD4lrOLkYNDQsBEYvZjuy5GTiBTTOLC vfVsXYxcHEICyxglJk+eygKRMJFoPfSUDcQWEpjOKPG/MwKiaBaTxP/fV5hBEmwCahJfvhxm BxkqImAlsWmrJojJLJAlcfqYAogpJMAtsbo5CKSYU4BHYt2fTrBGYQFPiQ9/TzCB2CwCqhJ3 X29nBLF5BWwlNjxcxgZhC0r8mHwP7BpmAS2J9TuPM0HY8hKb17xlhvhEXeLRX12QsIiAkcTR k/OhykUk9r14xwgxXkDi2+RDLBDlshKbDjCD/CEhsIxdYtKCe+wQz0pKHFxxg2UCo8QsJJtn Idk8C8nmWUhWLGBkWcUomlqQXFCclJ5rpFecmFtcmpeul5yfu4kRElHSOxhXNVgcYhTgYFTi 4U18MDtAiDWxrLgy9xCjBAezkgjv3Mw5AUK8KYmVValF+fFFpTmpxYcYfYAun8gsJZqcD4z2 vJJ4Q2NjEzMTUxNzS1NzUxzCSuK8zR4pAUIC6YklqdmpqQWpRTDjmDg4pRoYI361Lj3tPcNA U+v2+aisLepxc1VWvHPkjTP58/jirbP1FbIX5xsv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bdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Sean Paul According to the exynos datasheet (Figure 49-10), we should wait for PLL lock before programming the training pattern when doing software eDP link training. Signed-off-by: Sean Paul Signed-off-by: Jingoo Han --- drivers/video/exynos/exynos_dp_core.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c index 8c9bcb9..6e54a18 100644 --- a/drivers/video/exynos/exynos_dp_core.c +++ b/drivers/video/exynos/exynos_dp_core.c @@ -264,7 +264,7 @@ static void exynos_dp_set_lane_lane_pre_emphasis(struct exynos_dp_device *dp, static int exynos_dp_link_start(struct exynos_dp_device *dp) { u8 buf[4]; - int lane, lane_count, retval; + int lane, lane_count, pll_tries, retval; lane_count = dp->link_train.lane_count; @@ -297,6 +297,18 @@ static int exynos_dp_link_start(struct exynos_dp_device *dp) exynos_dp_set_lane_lane_pre_emphasis(dp, PRE_EMPHASIS_LEVEL_0, lane); + /* Wait for PLL lock */ + pll_tries = 0; + while (exynos_dp_get_pll_lock_status(dp) == PLL_UNLOCKED) { + if (pll_tries == DP_TIMEOUT_LOOP_COUNT) { + dev_err(dp->dev, "Wait for PLL lock timed out\n"); + return -ETIMEDOUT; + } + + pll_tries++; + usleep_range(90, 120); + } + /* Set training pattern 1 */ exynos_dp_set_training_pattern(dp, TRAINING_PTN1);