From patchwork Wed Jul 18 09:50: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: 1209621 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 AA033DFFFD for ; Wed, 18 Jul 2012 09:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752076Ab2GRJvH (ORCPT ); Wed, 18 Jul 2012 05:51:07 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:36728 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507Ab2GRJvG (ORCPT ); Wed, 18 Jul 2012 05:51:06 -0400 Received: from epcpsbgm1.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7C00FF5ON363F0@mailout3.samsung.com> for linux-fbdev@vger.kernel.org; Wed, 18 Jul 2012 18:50:59 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-a9-50068703d803 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 6F.22.19326.30786005; Wed, 18 Jul 2012 18:50:59 +0900 (KST) Received: from DOJG1HAN02 ([12.23.119.56]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7C00FKOOOZ4F30@mmp2.samsung.com> for linux-fbdev@vger.kernel.org; Wed, 18 Jul 2012 18:50:59 +0900 (KST) From: Jingoo Han To: 'Florian Tobias Schandinat' Cc: linux-fbdev@vger.kernel.org, 'Jingoo Han' Subject: [PATCH] video: exynos_dp: use usleep_range instead of delay Date: Wed, 18 Jul 2012 18:50:59 +0900 Message-id: <002201cd64ca$d5bbabb0$81330310$%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: Ac1kytVqwcr/tiZXR7qQiinHcg1brQ== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMLMWRmVeSWpSXmKPExsVy+t9jQV3mdrYAg451ehYn+j6wOjB6fN4k F8AYxWWTkpqTWZZapG+XwJXxqnUxc8EWsYrzV7czNTAuFepi5OSQEDCReHDoEzOELSZx4d56 ti5GLg4hgemMEj92b2CCcGYxSSw98wisik1ATeLLl8PsXYwcHCICVhKbtmqChJkFnCUm3DjB BhIWFnCReL/MESTMIqAq8X79HEYQm1fAVmLbjCZmCFtQ4sfkeywQrVoS63ceZ4Kw5SU2r3nL DDJGQkBd4tFfXZCwiICexMF/s1ghSkQk9r14xziBUWAWkkmzkEyahWTSLCQtCxhZVjGKphYk FxQnpeca6hUn5haX5qXrJefnbmIEB+UzqR2MKxssDjEKcDAq8fAeqGcLEGJNLCuuzD3EKMHB rCTCey0OKMSbklhZlVqUH19UmpNafIhRmoNFSZzX2Purv5BAemJJanZqakFqEUyWiYNTqoFx 29lpZw+uNlDNbj+o83/Cn10Ri5XuxXb8rRPlzDNVVgssvBLxx+HzfJ5j7/ds+PB8yaaNff23 vz+Mtsjq9kj5dn1HpUnZPnX9q7and+onZsek587blFCyS1tG7aSt6cyOWgUF9osNn2TW9FWH BTu1sq/1n5i44Zh529HCL875q82s5vlNPuKtxFKckWioxVxUnAgAmGixNEYCAAA= 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 replaces udelay and mdelay with usleep_range to remove the busy loop waiting. Signed-off-by: Jingoo Han --- drivers/video/exynos/exynos_dp_core.c | 14 +++++++------- drivers/video/exynos/exynos_dp_reg.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c index 9db7b9f..25907f4 100644 --- a/drivers/video/exynos/exynos_dp_core.c +++ b/drivers/video/exynos/exynos_dp_core.c @@ -47,7 +47,7 @@ static int exynos_dp_detect_hpd(struct exynos_dp_device *dp) exynos_dp_init_hpd(dp); - udelay(200); + usleep_range(200, 210); while (exynos_dp_get_plug_in_status(dp) != 0) { timeout_loop++; @@ -55,7 +55,7 @@ static int exynos_dp_detect_hpd(struct exynos_dp_device *dp) dev_err(dp->dev, "failed to get hpd plug status\n"); return -ETIMEDOUT; } - udelay(10); + usleep_range(10, 11); } return 0; @@ -486,7 +486,7 @@ static int exynos_dp_process_clock_recovery(struct exynos_dp_device *dp) u8 pre_emphasis; u8 training_lane; - udelay(100); + usleep_range(100, 101); exynos_dp_read_bytes_from_dpcd(dp, DPCD_ADDR_LANE0_1_STATUS, 6, link_status); @@ -571,7 +571,7 @@ static int exynos_dp_process_equalizer_training(struct exynos_dp_device *dp) u8 adjust_request[2]; - udelay(400); + usleep_range(400, 401); exynos_dp_read_bytes_from_dpcd(dp, DPCD_ADDR_LANE0_1_STATUS, 6, link_status); @@ -739,7 +739,7 @@ static int exynos_dp_set_link_train(struct exynos_dp_device *dp, if (retval == 0) break; - udelay(100); + usleep_range(100, 110); } return retval; @@ -773,7 +773,7 @@ static int exynos_dp_config_video(struct exynos_dp_device *dp, return -ETIMEDOUT; } - udelay(1); + usleep_range(1, 2); } /* Set to use the register calculated M/N video */ @@ -807,7 +807,7 @@ static int exynos_dp_config_video(struct exynos_dp_device *dp, return -ETIMEDOUT; } - mdelay(1); + usleep_range(1000, 1001); } if (retval != 0) diff --git a/drivers/video/exynos/exynos_dp_reg.c b/drivers/video/exynos/exynos_dp_reg.c index 6ce76d5..ce401c8 100644 --- a/drivers/video/exynos/exynos_dp_reg.c +++ b/drivers/video/exynos/exynos_dp_reg.c @@ -122,7 +122,7 @@ void exynos_dp_reset(struct exynos_dp_device *dp) LS_CLK_DOMAIN_FUNC_EN_N; writel(reg, dp->reg_base + EXYNOS_DP_FUNC_EN_2); - udelay(20); + usleep_range(20, 30); exynos_dp_lane_swap(dp, 0); @@ -988,7 +988,7 @@ void exynos_dp_reset_macro(struct exynos_dp_device *dp) writel(reg, dp->reg_base + EXYNOS_DP_PHY_TEST); /* 10 us is the minimum reset time. */ - udelay(10); + usleep_range(10, 20); reg &= ~MACRO_RST; writel(reg, dp->reg_base + EXYNOS_DP_PHY_TEST);