From patchwork Wed Mar 24 15:18:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 407878 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp502274jai; Wed, 24 Mar 2021 08:19:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnzn3SPhKk2A5u4h8wc6Ve/Tw+NX7oH13ivUzyG1iAfvSUZnuD9bqrURsDm6DX1KihAHqz X-Received: by 2002:a17:90b:1213:: with SMTP id gl19mr3951662pjb.55.1616599192515; Wed, 24 Mar 2021 08:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616599192; cv=none; d=google.com; s=arc-20160816; b=jHAX+PPmWufRrDtldD4zTHjSQyz0XeLJ0fBO+x7rGZ1T36q4fbqKo5TIc0/mOliknz SXrJObX/e73gj6mY7sIoB6P1g+YU++tAzNTxPYzrr3znzIiTpNGvHFyFQGxskVXFyM9W 3nKhcaHgP/bmZWyLp5H8O4XvCHVeD4ObX/xLNcLbKW5L2xnAhm+D0fZRg66MbJbAXB9z oQVvH1XwuN4B+opiZjydgT0srBKQUoyd1e4wrjnArhzSBbCTcV+GZVYqX7sK8yM27eB+ Z896czqV2jzrFtYFzuqVZPCfhutWbJhNmi3lHe4BPefEJmh0QHcLQ62UxOL0a3HiLikf CUwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=9ZMHBfFyf4QR2ydfjlI74TSe1K+0+7WzI2lfAk3Qd+A=; b=d1wceS72BNnbGI1pEQoCcCFcGG4DDe3UzTABmdpAj+W+Swf0bTHdVRdLnXMuF9Fe9B c2+jvi9y9zJSVvYfiasKJk/C/Ug31PKLSOCbZcHS5pJFPLbs9iEcZz0ozryRCd8ovLJz M3os63Ngp1PdI1gdp2vsxQWN4KE0UcsN5irUIyYYtlsd2l0xcHJMC6PX8lLPqRuJS7kQ KqCvMVbRw+iU3bjUctDqgDAI8ILc4f+aI1z7828sThuB/lgktFTd890HmYzribl+/lcU sNTn5klSKKKhB2x1reCLWOWDElaZsyeCfnU9NnRHwaEtgqXRc7ed6WU1KL3w8U9Pd4X7 fKNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=znoqwLJm; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id z18si2452266plb.188.2021.03.24.08.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 08:19:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=znoqwLJm; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C7BB6EC93; Wed, 24 Mar 2021 15:19:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by gabe.freedesktop.org (Postfix) with ESMTPS id B723A6EC91 for ; Wed, 24 Mar 2021 15:19:33 +0000 (UTC) Received: by mail-lf1-x12d.google.com with SMTP id b14so19285302lfv.8 for ; Wed, 24 Mar 2021 08:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RFHW0LdlrmaF7YDk0vokBt8XF/nut54+Ls9k+Au93LE=; b=znoqwLJm7izb5lBmvfQwSvrc7kAZkwlBIOkIwe1r2FpSKUwHYcNd2RvOtQBv6rjHes idvTjUKowrFuKSzrhG6PTGe55Ftzt/KlSBbbsAYEhSNYfYL7DuGeV3Co1ak+2rlZtuGq u/53FicoWS8BniYtKaiPTNj1qvuO2hjzj5iNJVqxelDgGT7KwWMZWAP9biyyWEkjPYl1 XsCOz0nQfNaBe3oN0/wI5tYgkyu/k0RO+07V4WOT3Dpa79QLxUG2cNuPIMpBSSfljBdQ 7/doPKIxu+z//vNI/5vVkaYIi5RmBhggCZzSscdDEJ6pv3SXyHuxko/n4wuKffA2fePS t/iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RFHW0LdlrmaF7YDk0vokBt8XF/nut54+Ls9k+Au93LE=; b=FebGKTdixqpRhScBCYKvIU6mwHJ2Qcy7H/hGYe54fPKEtdQBxXwf81VnJL7i0tdGOV ZWRBRolhnmlk1242r2Ho+j5do0G/S0cyoO+spJTWku8D+1v54CHkWmqDN/Bt3kMp3v5C ZXyWC5sDf16q7PeKI5XmKreOlYtDw9pLFfrv21ekEh4I92azoej/col5DNjXXtRPDASm ZKlGWYiVenCBOr1st9P8RNU3QdX1PSeRU6DJGxVK8mBaXUw1FLwFbNYHKzm8ufaDK0Fd g8+8o1N5O1+k1x9Xcrs0MchEAtsLO9G8Kb0fGSMZ0kDljSRtY4pN14C9QdbcRuu5qOlS xspg== X-Gm-Message-State: AOAM533cfjaPRMkzguWkCpDAm6cm4DybFTAmJqGC+vMgzds6IpxBg7NK i9aAlAB8EgvFs8nhJ99syUJeqvQfvGho3w== X-Received: by 2002:ac2:5146:: with SMTP id q6mr2347257lfd.441.1616599172213; Wed, 24 Mar 2021 08:19:32 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id d22sm255199lfm.267.2021.03.24.08.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 08:19:31 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Jonathan Marek , Michael Turquette Subject: [PATCH v2 19/28] drm/msm/dpu: simplify vco_delay handling in dsi_phy_28nm driver Date: Wed, 24 Mar 2021 18:18:37 +0300 Message-Id: <20210324151846.2774204-20-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210324151846.2774204-1-dmitry.baryshkov@linaro.org> References: <20210324151846.2774204-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , freedreno@lists.freedesktop.org, linux-clk@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of setting the variable and then using it just in the one place, determine vco_delay directly at the PLL configuration time. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.30.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c index 3e9b7949b038..87d1aa4114e4 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c @@ -72,8 +72,6 @@ struct dsi_pll_28nm { struct platform_device *pdev; void __iomem *mmio; - int vco_delay; - struct pll_28nm_cached_state cached_state; }; @@ -212,8 +210,10 @@ static int dsi_pll_28nm_clk_set_rate(struct clk_hw *hw, unsigned long rate, pll_write(base + REG_DSI_28nm_PHY_PLL_SDM_CFG4, 0x00); /* Add hardware recommended delay for correct PLL configuration */ - if (pll_28nm->vco_delay) - udelay(pll_28nm->vco_delay); + if (pll->cfg->type == MSM_DSI_PHY_28NM_HPM) + udelay(1); + else /* LP */ + udelay(1000); pll_write(base + REG_DSI_28nm_PHY_PLL_REFCLK_CFG, refclk_cfg); pll_write(base + REG_DSI_28nm_PHY_PLL_PWRGEN_CFG, 0x00); @@ -580,10 +580,6 @@ static int dsi_pll_28nm_init(struct msm_dsi_phy *phy) pll = &pll_28nm->base; pll->cfg = phy->cfg; - if (phy->cfg->quirks & DSI_PHY_28NM_QUIRK_PHY_LP) - pll_28nm->vco_delay = 1000; - else - pll_28nm->vco_delay = 1; ret = pll_28nm_register(pll_28nm, phy->provided_clocks->hws); if (ret) {