From patchwork Fri Oct 31 22:54:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5207211 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D29469F318 for ; Fri, 31 Oct 2014 23:56:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E9A120176 for ; Fri, 31 Oct 2014 23:56:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D8BD82014A for ; Fri, 31 Oct 2014 23:56:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D02556E847; Fri, 31 Oct 2014 16:56:32 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 81B9F6E850 for ; Fri, 31 Oct 2014 15:57:20 -0700 (PDT) Received: by mail-pa0-f50.google.com with SMTP id eu11so8661040pac.9 for ; Fri, 31 Oct 2014 15:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DMe7qMMSe5wPK5F2A4n/D6o3EPsG7Tuxt2OQ+IB96mg=; b=Sxp5DyIseJh6wiZKtgJHXeUtZGigW+rLgthxmYpGbpIMttLgTW4//asZYKhNPDP7mk b3zNb7xCodxAM4/q/LiQHHHi4N/BYRAkg7GQRme5khBtBq69+yljn/pp929T03b3pCpj PfVn+blqhlwZX0QEzhPeDm29cLPgfyHq9qKzCbilNVKQk4EyFuWtV+8wUfa9lV9NqyKj YDOcHifRv3qbR/deEF+wG9S4pNaoqt8wVMF2hIpsBFSJnjbSZz1M5roPpHjqcr7aNEJK qrFALFeUc9WIFlVM43pwCPhzNOzuYZICdVuQRA039YYNADGkEhkmwP11MF2aBDlwFfe4 WYPw== X-Received: by 10.69.26.133 with SMTP id iy5mr27890168pbd.114.1414796240409; Fri, 31 Oct 2014 15:57:20 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id ev8sm10870656pdb.28.2014.10.31.15.57.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 15:57:20 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org Subject: [PATCH 39/72] imx-drm: hdmi: optimize i2c write wait Date: Fri, 31 Oct 2014 15:54:22 -0700 Message-Id: <1414796095-10107-40-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> References: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 31 Oct 2014 16:56:31 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A wait of around 50 ~ 100 micro seconds seems to be enough to allow I2C Master PHY done, so instead of wait 1000 usec at each time of register check, wait 100 usec is more appropriate. Signed-off-by: Jiada Wang Signed-off-by: Steve Longerbeam --- drivers/staging/imx-drm/imx-hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index aaec6b2..801a3eb 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -655,12 +655,12 @@ static inline void hdmi_phy_test_dout(struct imx_hdmi *hdmi, hdmi_writeb(hdmi, bit, HDMI_PHY_TST2); } -static bool hdmi_phy_wait_i2c_done(struct imx_hdmi *hdmi, int msec) +static bool hdmi_phy_wait_i2c_done(struct imx_hdmi *hdmi, int husec) { while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) { - if (msec-- == 0) + if (husec-- == 0) return false; - udelay(1000); + udelay(100); } return true; }