From patchwork Thu Oct 15 19:03:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 11842941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D87AC4363D for ; Sat, 17 Oct 2020 19:04:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB6C92073A for ; Sat, 17 Oct 2020 19:04:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Olv9UFBw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB6C92073A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AA966E118; Sat, 17 Oct 2020 19:04:48 +0000 (UTC) Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1FF2B6E193 for ; Thu, 15 Oct 2020 19:03:40 +0000 (UTC) Received: by mail-lf1-x142.google.com with SMTP id a7so4806244lfk.9 for ; Thu, 15 Oct 2020 12:03:40 -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=bVhjbsTSxgBooF0oDEk6fnL5KJWip8RsGYfRTsIW3/o=; b=Olv9UFBwkrn4JXZrqse3ThJk1WGrsOAVxih4wTIqFOeYNByqvtbKoyV+1NSE0jvXsQ f/68ALwjPZjXMoTOR3q3GE0uZKBMSeMnup4Fu38B/rtY2WqywGtMhJQraD7NmvIvsxgR 3qEdyqGomnUvuaCmjQD0PJFFSEtGWj8PFJQz1+fSTPacAugUdoriLMbyvCHisKW/akZm rLIDV76NVuHEZsZ0DBCmEiD4olQeH0bahD9dbf7x0APQpx9r70IDdE/ciP5ZP2NsvIb5 ulsXqUYfg5QeZAv/AqsZh1UP8ksKqt6MoEuGTkLfoUMQMSLvDes7Yuphyq39gNzG/Sym q68A== 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=bVhjbsTSxgBooF0oDEk6fnL5KJWip8RsGYfRTsIW3/o=; b=Ef3MwR7OKXOXsDfIm8DQq86DEYA2KsNqDNTmxEYvVkghK4elQqgIndyMAuGsX7JTvo wbK3KU8+2cjZ8OQEPThErticTAvcDgulqWJhkscnERR2a5pmJb4H1+aOKE6HaI+N0w7S n+/8YT+gYC9AXbFMCzzrfJTE4IHJYQSLUAH4ZVjI7mUrKqlDAunHl0EvZwvAnb8eKn87 O/WiJM8V3KrEqvTblRNPdTXAvjbNiXX+s+j/R9Jw5Yzz5T8P59tcBWB4OjJPCQ2edl7q vR/VcsQoW6Ig4LAfv7Jjmkca7yTxWfJ/ysR4aD+mIMZWXXa4ZKylFJCi2GFZWGO/VVe5 nvOw== X-Gm-Message-State: AOAM532jbABf3owwRhHG4po2Y0+cuEQWg5DtwZ3hP8xXJEfECqpni8LX 6Uig9ux+uxhRtcgRFE5Rl12MDw== X-Google-Smtp-Source: ABdhPJwcxEOb1Alb/QhRoycX2zuNQNTPP5yDNI0C/j7OgnEmDwKTrP1kcNDMpS+cHNm4QXZCokk//A== X-Received: by 2002:a19:6d4:: with SMTP id 203mr8998lfg.391.1602788618497; Thu, 15 Oct 2020 12:03:38 -0700 (PDT) Received: from eriador.lan ([94.25.229.2]) by smtp.gmail.com with ESMTPSA id 71sm1309781lfm.78.2020.10.15.12.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 12:03:37 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Jonathan Marek Subject: [PATCH 2/4] drm/msm/dsi_pll_10nm: restore VCO rate during restore_state Date: Thu, 15 Oct 2020 22:03:30 +0300 Message-Id: <20201015190332.1182588-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201015190332.1182588-1-dmitry.baryshkov@linaro.org> References: <20201015190332.1182588-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 17 Oct 2020 19:04:47 +0000 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: Jeffrey Hugo , Stephen Boyd , linux-arm-msm@vger.kernel.org, Harigovindan P , dri-devel@lists.freedesktop.org, David Airlie , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" PHY disable/enable resets PLL registers to default values. Thus in addition to restoring several registers we also need to restore VCO rate settings. Signed-off-by: Dmitry Baryshkov Fixes: c6659785dfb3 ("drm/msm/dsi/pll: call vco set rate explicitly") --- drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c index 6ac04fc303f5..e4e9bf04b736 100644 --- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c +++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c @@ -559,6 +559,7 @@ static int dsi_pll_10nm_restore_state(struct msm_dsi_pll *pll) struct pll_10nm_cached_state *cached = &pll_10nm->cached_state; void __iomem *phy_base = pll_10nm->phy_cmn_mmio; u32 val; + int ret; val = pll_read(pll_10nm->mmio + REG_DSI_10nm_PHY_PLL_PLL_OUTDIV_RATE); val &= ~0x3; @@ -573,6 +574,13 @@ static int dsi_pll_10nm_restore_state(struct msm_dsi_pll *pll) val |= cached->pll_mux; pll_write(phy_base + REG_DSI_10nm_PHY_CMN_CLK_CFG1, val); + ret = dsi_pll_10nm_vco_set_rate(&pll->clk_hw, pll_10nm->vco_current_rate, pll_10nm->vco_ref_clk_rate); + if (ret) { + DRM_DEV_ERROR(&pll_10nm->pdev->dev, + "restore vco rate failed. ret=%d\n", ret); + return ret; + } + DBG("DSI PLL%d", pll_10nm->id); return 0;