From patchwork Mon Jun 19 16:13:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 110104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3127995vqr; Mon, 19 Jun 2023 09:45:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79xqSv//45c6895vcnnscfDMh+yNu3SZI0Iq8eYeq2c9B7uZ9Z6DxWHYOlrCh8wE4rLqlC X-Received: by 2002:a17:902:7c92:b0:1b3:91f7:4883 with SMTP id y18-20020a1709027c9200b001b391f74883mr1054829pll.46.1687193152723; Mon, 19 Jun 2023 09:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687193152; cv=none; d=google.com; s=arc-20160816; b=sqxxTNInpeodJ8WPnMdZHlkeFS1dKv/Gpm2I/tp6dlfECbt86yxocBUyHthqy7C5fy xkOjq4IfYP70HWP86iC2bHbWgG+OrGBUpA9jSv2aymSUHqNFkP3UJTCFVW/ayZSeaWP/ ZgwrD+9aemcRBl0q/+uhuhGxZVp0yPR8Qo2bdcgvQfTLx0i325MK5Is3szqWyPm/qfM1 uRjTtf35WQBZEFe4I0tC8A9nidk1PrsBHo9ed5DRH+/tvHwGplT2HMsmSdPwGgovKNIm elcjgOUerRgvo2QCqiyJ0WDegn1xLSfdhuefvE2gvu8mPVDWkU5KnjTcR4TyQ7kpwvmB dLlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Zb5V9XwfVFSIHpQhT+fVgcE2qaopeXD6dDII5Ksk8SI=; b=ELogh939glh17IWmZla9ZZjlJY7hohyTU4iqcG/+UYTiy9Z2ZRiuUl1fkZrNaefCrS GEbtx0PlEkx4qZ1Yg88OgKE5PA2VHYsZ/97Gi1GnotRd6f9SdYN1DuP+7u8K06bW4+KB rAyS7ylI3qUEp8OrOBZ0CJ9a70VCS8iKdNvLA1GUk/13By9Zh0p+MAEToUZnWmURSO0H 65FlhTKFIc5STSmDo5geiGoBSO7repwjTpbYbiLL4AqAXK/BSNotNcK5VsTkPW2xJXlL AXLWmQ5bHZTYQL3aht14CvboDAFcNxQgQ2O+mDWciCiizLQ1T01wHaX+BskklGACD4YN 3tlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bB+j6bXK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a170902f1c200b001b668bb6ac8si105986plc.447.2023.06.19.09.45.40; Mon, 19 Jun 2023 09:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bB+j6bXK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S232186AbjFSQNa (ORCPT + 99 others); Mon, 19 Jun 2023 12:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232156AbjFSQN0 (ORCPT ); Mon, 19 Jun 2023 12:13:26 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 113861AC for ; Mon, 19 Jun 2023 09:13:25 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b45e6e1b73so42850541fa.0 for ; Mon, 19 Jun 2023 09:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687191203; x=1689783203; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Zb5V9XwfVFSIHpQhT+fVgcE2qaopeXD6dDII5Ksk8SI=; b=bB+j6bXK9bzttVUO3aefwzMtLgjoTbl5bcAV4jZtwnCEe2+zNabdgA508a+8J/V5iN 6WwrXRM6DNCHdS8upXURZenKQvT4G2G7GkrGs1LvPaNEra+8q+aTF532jXrfbIHkyFio nCuwS3Xcd+iTVWw8JQ6bnMxjsfQqJqsUn2JyfbD3aBidw/FeMKVLFl8CLSqjKfMGgGdy I7uapsi2rn1XMLJPut+m8TD3jAFDRMsIofCXBQMveozk5eEe+YOnR+H2uy+13ZGJ+Nxc zc/ZXmlHVtKkOBfIYEC5f540LKyvhx8Tb2UIzs4xex7fTpVD8oRZl5OkEaHZYLZWWvMm 10XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687191203; x=1689783203; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zb5V9XwfVFSIHpQhT+fVgcE2qaopeXD6dDII5Ksk8SI=; b=lCQRCAkS3vFGnnUW2o/5/79AQZkq1WQP1844cp0/449SYDZFLcwxBlvqFUXgFTuBSA VoSU+hXxdM9XT76ZnetXyHZ7KiYgC2mKCwKPuvMxfeWOufT8V5mSCLKWqlWpxbpXm7Ct EMdUitY+hoVfaPcYSViUQGdUonPcLDC1Ci9+Rq1teVOCt5APgQrPhr/x3GuMRmCT1NeT /mfPXkcZ7pUcQxZnZ15/7batw/8PGgsLDxKOyfhIwM0BPgAbhPpx24wcLCo72r9u20Ur hD+Dofm9wLoPqaAGu8AgPILY3a6i0BTY1CvBOStAsjKnPuwbRsCBWaL8RTKqORsY6ddI fwVg== X-Gm-Message-State: AC+VfDwN5g4CCG9xo1pjpQdx9uv4WH2IL50FHifuybUnzDqkKf9cqu13 ej8v9RJ/2G/yiwaVFTEK6XurzqzCsGdgarwc6G0= X-Received: by 2002:a2e:8842:0:b0:2b4:6b64:6855 with SMTP id z2-20020a2e8842000000b002b46b646855mr3283513ljj.24.1687191203246; Mon, 19 Jun 2023 09:13:23 -0700 (PDT) Received: from [192.168.1.101] (abyl242.neoplus.adsl.tpnet.pl. [83.9.31.242]) by smtp.gmail.com with ESMTPSA id x20-20020a2e7c14000000b002b471efb253sm1011714ljc.46.2023.06.19.09.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 09:13:22 -0700 (PDT) From: Konrad Dybcio Date: Mon, 19 Jun 2023 18:13:17 +0200 Subject: [PATCH 1/2] clk: qcom: gpucc-sc8280xp: Add runtime PM MIME-Version: 1.0 Message-Id: <20230619-topic-sc8280xp-clk-rpm-v1-1-1e5e1064cdb2@linaro.org> References: <20230619-topic-sc8280xp-clk-rpm-v1-0-1e5e1064cdb2@linaro.org> In-Reply-To: <20230619-topic-sc8280xp-clk-rpm-v1-0-1e5e1064cdb2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687191201; l=1937; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=5Q+uIon8TwEZ6cJYHo5zacahpsGk7QSU+uGdUpH/moA=; b=f3JFlxvNLVIGIfQGPanhZfCO1xDNeRNXyVkclN0YBwa4r94CwWeP7+9B5deZSpgSsP0FlNyUo T7Oirv/CVT/Cfb8Ff/akhzHaU2Dn6Ab3fgZJNA/CP8AsDl0nURfl9Ty X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769150247438110426?= X-GMAIL-MSGID: =?utf-8?q?1769150247438110426?= The GPU_CC block on SC8280XP is powered by the GFX rail. We need to ensure that it's enabled to prevent unwanted power collapse. Enable runtime PM to keep the power flowing only when necessary. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gpucc-sc8280xp.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/gpucc-sc8280xp.c b/drivers/clk/qcom/gpucc-sc8280xp.c index ea1e9505c335..8e147ee294ee 100644 --- a/drivers/clk/qcom/gpucc-sc8280xp.c +++ b/drivers/clk/qcom/gpucc-sc8280xp.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -424,10 +425,21 @@ static struct qcom_cc_desc gpu_cc_sc8280xp_desc = { static int gpu_cc_sc8280xp_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, &gpu_cc_sc8280xp_desc); - if (IS_ERR(regmap)) + if (IS_ERR(regmap)) { + pm_runtime_put(&pdev->dev); return PTR_ERR(regmap); + } clk_lucid_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config); clk_lucid_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config); @@ -439,7 +451,10 @@ static int gpu_cc_sc8280xp_probe(struct platform_device *pdev) regmap_update_bits(regmap, 0x1170, BIT(0), BIT(0)); regmap_update_bits(regmap, 0x109c, BIT(0), BIT(0)); - return qcom_cc_really_probe(pdev, &gpu_cc_sc8280xp_desc, regmap); + ret = qcom_cc_really_probe(pdev, &gpu_cc_sc8280xp_desc, regmap); + pm_runtime_put(&pdev->dev); + + return ret; } static const struct of_device_id gpu_cc_sc8280xp_match_table[] = { From patchwork Mon Jun 19 16:13:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 110098 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3115522vqr; Mon, 19 Jun 2023 09:23:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jp2nWhBqEQZtsS7HIWZfdUavUFO48Mwm8L1ZQmMi6jstkXrDiorcKLqj2k/YQwgz3VNt8 X-Received: by 2002:a05:6a00:1804:b0:667:e17e:85bc with SMTP id y4-20020a056a00180400b00667e17e85bcmr10438010pfa.0.1687191804793; Mon, 19 Jun 2023 09:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687191804; cv=none; d=google.com; s=arc-20160816; b=q21u79A69RuFjeMlvUPj36jyZk8no06o/WsXzL/YHeKT1CBmttya0UVlPSmAt3xWFw KsBFSpa29r9mGj2EQhin20JXgDle09u8sV674qJtv99CWZHfgyNNl1HYz2Dmrb4z3HmO FNcGhzI5kawFbdRqxJK/RG0noAacgqgZQuR0W/zHouIJQk/hV6JWKpYMCvrbB15u+5wH P9vVrCpbV0DaGDPaOCE5zYwEUEUfiWknmiVyrMNsi7PLw2Vtj4UFS1S3RQlC7cIM0aQm w0fNmp78qpxcw3U6JIkHCN3NRjOV6u8Qb6OKzvV5GLwIvd59w6bxfdMDhxTeioymIMoh Avww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=hmgYvNinjU/fT+erZeLft1aKLnZsg+oPmLA3CULSbeM=; b=eec+bT4cMk3fiBgyNwz6brHKue1IMUJYHlrKZ/JOWEhTkjXGX+32FeEgsSdpgazYJu SGHl3OMPMCwQKMg3OWjCdMneMnIYlqSMJjkKu7AOAhbjIaeSsK5jEotHswPZbx7DOlZu PzgAGVvM3ZAb74h2axBFnz+cdIwmQbWfWum0mNywTQUWsy+wIY/fdrk+c8ojF8dhmgII Hoor4drN+NECyX6kK0X6bHZbPsRcN2ftX5RKC9y5AWTwc8INTaZAqTRpS9mn6CjIiyVH IJX9fwjH86iIxp0MgCFkXGEQT0sscqYc8Jo8S4li6+IBBCDW9fiq9DsItpS7YAbHBuUl tx9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PTEHzxVj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p123-20020a625b81000000b006668f12b055si9553753pfb.74.2023.06.19.09.23.09; Mon, 19 Jun 2023 09:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PTEHzxVj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S232204AbjFSQNc (ORCPT + 99 others); Mon, 19 Jun 2023 12:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232055AbjFSQN1 (ORCPT ); Mon, 19 Jun 2023 12:13:27 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED22B1B0 for ; Mon, 19 Jun 2023 09:13:25 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2b46bfa66d2so29012601fa.2 for ; Mon, 19 Jun 2023 09:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687191204; x=1689783204; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hmgYvNinjU/fT+erZeLft1aKLnZsg+oPmLA3CULSbeM=; b=PTEHzxVjoT1bF8b5NSp4p68xB+MVPrSsJJUY0khQid3MBOQ+0J/+/PjP5ztIJnoEte wnFd+gMhlzHN05KizStYKFgY0/J+neM+FabraUyIE4grK0b2Xy36NcJEcfAiw/eidaTL lBbCMzwMCHodFXALMzlUfFHUad8nkzCyoihpPCx6ZhelQM7cijXatQVr4/BNAib/4/zt EVBHsyAyofZh9OiQNOounIyW6aW5CrPCYY1bdmTzYy2IrpZSC51i0Todnq/bli6Xw9mS 6D3ZYv9axSfxuK0o7pZQ2IxZZBVV5cteCUXqmOSQPNYe7B847ZjptQGNcfhNtWYSarSo LpcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687191204; x=1689783204; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hmgYvNinjU/fT+erZeLft1aKLnZsg+oPmLA3CULSbeM=; b=SfJRERLihdq3awOF2bthYcu1bGVt3pThkPHQhcZ8BN1UCOJ3GqLpNpXWmUxkkAFGFa wqYQ4odankmkQglq7ZM6vzrXGC1n/RYDdETV2p0DLU3JjAset083+4cDKH2yCfNquO+b Ee/hwSM8wwFqlsv+TE7q7vFGkQqpty+ZcahwQeWvSo+6Nm38Lc5z6Ag+ee/Sy/eVUw0J k7y5l3OT6n5IJbkTEfF8O5XSBcREAGWuqe1iqyrqqK289YGQjtfLcmDbDQ8yhKqS7NA/ 00Tzd4tYkIHWPe13h6cvXeSOF6KdufqwCtIo/Au2MdRUB3SEy27i3ro3CcBXe2KDATaR sv9g== X-Gm-Message-State: AC+VfDxvgjHu10Ig12jT1+jTn0Rwi8qCwvX6GYmTm1AKGyUl2YcmhJpb jMIy0WtW3E4yYBfPKf6JrL7LOPcKAU1FeyyPKak= X-Received: by 2002:a2e:960d:0:b0:2ad:d291:72e1 with SMTP id v13-20020a2e960d000000b002add29172e1mr6611945ljh.18.1687191204336; Mon, 19 Jun 2023 09:13:24 -0700 (PDT) Received: from [192.168.1.101] (abyl242.neoplus.adsl.tpnet.pl. [83.9.31.242]) by smtp.gmail.com with ESMTPSA id x20-20020a2e7c14000000b002b471efb253sm1011714ljc.46.2023.06.19.09.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 09:13:24 -0700 (PDT) From: Konrad Dybcio Date: Mon, 19 Jun 2023 18:13:18 +0200 Subject: [PATCH 2/2] clk: qcom: gcc-sc8280xp: Add runtime PM MIME-Version: 1.0 Message-Id: <20230619-topic-sc8280xp-clk-rpm-v1-2-1e5e1064cdb2@linaro.org> References: <20230619-topic-sc8280xp-clk-rpm-v1-0-1e5e1064cdb2@linaro.org> In-Reply-To: <20230619-topic-sc8280xp-clk-rpm-v1-0-1e5e1064cdb2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687191201; l=1628; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=iLOsinGTJtv8sPDkEM7a2zWDxDnO0K1p+yOFG6UU878=; b=7gTXtpfYHcJ+0pwGRH82J2GexETpGG26Gyb/o04zQKY9qD5wnd1s78SdNgclCurw05CB4RlMi lEdx/i0XRbsDjfQmEAqtdOzVf3WwIQRHifziP649VUBKp7lkQLL5FK5 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769148833507682507?= X-GMAIL-MSGID: =?utf-8?q?1769148833507682507?= The GCC block on SC8280XP is powered by the CX rail. We need to ensure that it's enabled to prevent unwanted power collapse. Enable runtime PM to keep the power flowing only when necessary. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gcc-sc8280xp.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c index 04a99dbaa57e..b90c71637814 100644 --- a/drivers/clk/qcom/gcc-sc8280xp.c +++ b/drivers/clk/qcom/gcc-sc8280xp.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -7421,9 +7422,19 @@ static int gcc_sc8280xp_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, &gcc_sc8280xp_desc); - if (IS_ERR(regmap)) + if (IS_ERR(regmap)) { + pm_runtime_put(&pdev->dev); return PTR_ERR(regmap); + } /* * Keep the clocks always-ON @@ -7445,7 +7456,10 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev) if (ret) return ret; - return qcom_cc_really_probe(pdev, &gcc_sc8280xp_desc, regmap); + ret = qcom_cc_really_probe(pdev, &gcc_sc8280xp_desc, regmap); + pm_runtime_put(&pdev->dev); + + return ret; } static const struct of_device_id gcc_sc8280xp_match_table[] = {