From patchwork Sun Jul 18 10:48:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 479607 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3167761jao; Sun, 18 Jul 2021 03:49:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc75v3apZSs3/pJZ8xNb4xWmiPZYMe7VyrQF0cNbuOOi+fsYHfYRAla7wIp2/SAZI+mCxy X-Received: by 2002:a5d:9585:: with SMTP id a5mr15133943ioo.28.1626605359083; Sun, 18 Jul 2021 03:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626605359; cv=none; d=google.com; s=arc-20160816; b=soVzCOXZDaAIOEEhWxAR4HyCf62Rvugc5sebo+9OXyd2aZzXVUedWGAFChjKkLr0Q2 sV9zNpqyXWHlETpNqi5kktBWYle1DtQD3Yl0jrg82oAVjwC9KA0RgpyzMmlNcZITHQ/S Fge9t/Kwj2lNexydsyaMny65YlTaBlnHG6gbNR2ERxgq5IEIhAsB5FiBhfkk5lQVK1YB UvB8Ey5MtUhMAO/JzOJTNELGmHsXHGthE1Kzg3pQgA4FqvLcKguGunXnTrT42ZTnxQy4 DDTR+pe2nAX0HdvuJy0DQBehKKM2H2Levi9Y/xYbPeC9/K3aE71mK7H/B8v60CJzFP1+ NUIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JPnE4vurU9PkRVowEC7li0cxdIi4nYwl+uw77ku/+po=; b=SnusIx38Pmhu4GQZo2M8dlgcRlvEkQWJ7sxl5DQaK5NuUOeHUMbN3N6DP3snuiFoJz TTcSXt8KuWNSTcLAOX9TGdbtmN08euyerdTlY5QXiSW6Z69bhANu/DgK4YOBxDkjmSxA gw2KG2rbZScEGiMfP8K9wtT7U2Rn6Fvr3b4Ogf2yvCKwFAWxvoYNT9DMwc8KGabqsxwd ajvvL3IJaAnBTzhOwttpeY+NA9+TiMLGyu1vnRplJVAXCXr4dnKF4jAOQWE35uNYJRZ0 Ihdayu8wdHt9m8pX0AaD8jhOopOD4724XmVbOAc01WsN+i09OfJob8Qs9WoZdO2+rjPL h9VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=djJXp5zR; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si18586418iot.89.2021.07.18.03.49.18; Sun, 18 Jul 2021 03:49:19 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=djJXp5zR; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233122AbhGRKwN (ORCPT + 7 others); Sun, 18 Jul 2021 06:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232898AbhGRKwL (ORCPT ); Sun, 18 Jul 2021 06:52:11 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BD8CC061768 for ; Sun, 18 Jul 2021 03:49:13 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id t20so5446010ljd.2 for ; Sun, 18 Jul 2021 03:49:13 -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=JPnE4vurU9PkRVowEC7li0cxdIi4nYwl+uw77ku/+po=; b=djJXp5zRLDPGCdVtBXwbxLa9g+CRF8URjpJzVuHrCeN0dDkCiZoSerJVx6FFNQciyW VAMeVfkWR7+Yo5N5gu+go18RQAVzfzmfT1/RZDRTO2rr/BPrisQxjP8BXE/bHahdfdC0 jfwy7LpLRmKF1NyPv7iGM5LyQ9d2BCwF0rtcpi2/SVkx60BAkLC//MHal2yPNSouAr4C 02G5O1X+JBtxvwhE8aKYS/SvqVU/d9yP6gSm9klJtugOItiYZP106lGSKFcUW1mMMn3c Yt2dxCfEUQPTr08ofETmLVwAP+98wsSBJOAFbb4Js/JsSoa/U6r4Z5y3FgNneGsZQ25f dLvQ== 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=JPnE4vurU9PkRVowEC7li0cxdIi4nYwl+uw77ku/+po=; b=Hrn11tUMboFFF2m4xWPa//GDIv+m2f/mXDVtVqQKQJxZoi7jQ+zUXucPRxu3Z/tn5X UkQnJQZOUI9XCfbGgodmdCnkSw31PsIQi9PXGqxo8mYyT6LG0xwp0OIJc2qc6K3VL1wW BmrL17Qne0g01ERVCBe2FuvcRNZ0ylwtWq8XDPaqHlWmqTgmtGFZRTH28VIiVx7zAbL6 hiCybMeb1siEc2AicKmx19qA1l04Yhwde167ZBy53lusgrBu1wLKuOfO99sqg6VBr5nR eHjMHrhMyZK84N4F06gTTiAely6DTX2SPB5SC+iyezvOBzZqYqbrVAXS8uFvmLxQ5TDm ps2g== X-Gm-Message-State: AOAM531jVp3noEnZdXIMHz51w4DiIPH7/TMN39tB7de5Jsfd31/rxh2v BC1CMsUN8sTFH57seF71Gn3kEA== X-Received: by 2002:a05:651c:3d0:: with SMTP id f16mr18057204ljp.169.1626605351527; Sun, 18 Jul 2021 03:49:11 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id y22sm1039528lfh.154.2021.07.18.03.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jul 2021 03:49:11 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Rob Herring , Stephen Boyd , Taniya Das , Jonathan Marek , Michael Turquette Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Bryan O'Donoghue , Mark Brown , Ulf Hansson , linux-kernel@vger.kernel.org Subject: [PATCH v5 5/9] clk: qcom: videocc-sm8250: use runtime PM for the clock controller Date: Sun, 18 Jul 2021 13:48:57 +0300 Message-Id: <20210718104901.454843-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210718104901.454843-1-dmitry.baryshkov@linaro.org> References: <20210718104901.454843-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On sm8250 dispcc and videocc registers are powered up by the MMCX power domain. Use runtime PM calls to make sure that required power domain is powered on while we access clock controller's registers. Signed-off-by: Dmitry Baryshkov --- drivers/clk/qcom/videocc-sm8250.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/drivers/clk/qcom/videocc-sm8250.c b/drivers/clk/qcom/videocc-sm8250.c index 7b435a1c2c4b..d996b76f4e30 100644 --- a/drivers/clk/qcom/videocc-sm8250.c +++ b/drivers/clk/qcom/videocc-sm8250.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -367,10 +368,21 @@ MODULE_DEVICE_TABLE(of, video_cc_sm8250_match_table); static int video_cc_sm8250_probe(struct platform_device *pdev) { struct regmap *regmap; + int ret; + + ret = devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; + + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret) + return ret; regmap = qcom_cc_map(pdev, &video_cc_sm8250_desc); - if (IS_ERR(regmap)) + if (IS_ERR(regmap)) { + pm_runtime_put(&pdev->dev); return PTR_ERR(regmap); + } clk_lucid_pll_configure(&video_pll0, regmap, &video_pll0_config); clk_lucid_pll_configure(&video_pll1, regmap, &video_pll1_config); @@ -379,7 +391,11 @@ static int video_cc_sm8250_probe(struct platform_device *pdev) regmap_update_bits(regmap, 0xe58, BIT(0), BIT(0)); regmap_update_bits(regmap, 0xeec, BIT(0), BIT(0)); - return qcom_cc_really_probe(pdev, &video_cc_sm8250_desc, regmap); + ret = qcom_cc_really_probe(pdev, &video_cc_sm8250_desc, regmap); + + pm_runtime_put(&pdev->dev); + + return ret; } static struct platform_driver video_cc_sm8250_driver = {