Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2906697rdd; Sat, 13 Jan 2024 06:52:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFu+4Z4RiJqfODyO/YBGdiS5jBiHiclQwUthZ2xU5se0oCkAw0brA2jhd/EIIBkJIYt8W98 X-Received: by 2002:a17:902:c155:b0:1d5:7248:4e2f with SMTP id 21-20020a170902c15500b001d572484e2fmr3845536plj.7.1705157561642; Sat, 13 Jan 2024 06:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705157561; cv=none; d=google.com; s=arc-20160816; b=pfFSB+EJvrhgl2grk+7QoG+n9YbLBNdf7MkwBMniIB6yJJ1+a50YwRe5s/YeNuiH84 iVHH86lReHNGDzpPYDpusGPB8cnERrx++DPNWFFtub8oIrPxbyC+DO7D/9WQjPEMg/DC zGAn1Xet2+Nxckv6j39/w1/VbbZyoT3iNojwy+qSf9OQUWGpw8ELslhY062wtz5p7u5W DV0a7sgkFmelpC3lo4HLJnbanGdoCbg/7utaYKGa28s4cB+yhcsdqQJCNRyg9juMNm7E G007b6eNj7cvwAcS0eidVp98x2qzAx/VepUr3uARXOOk/KwnfTAhE9Prvfqpsu7fGUhb QhmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=04GA/gYikhVm70mp04BE89vJbyB+HCgNcamoEcplm6o=; fh=M4SmwWZ/7iHrjhlTFT5OMF7TTciupAxAdgRVURl8aUM=; b=yFF0t69i+JJEul/+uhCYFQvb20OyWB3OQ1bPgqqX0/K5CWqRzNnNgxhjNdHUAd0e11 YZQYmHZyJT0WQkN+Q7BXQNTIGBGm+c751NGy4XkqcKf2+1dKi34JIlnR9MqXEyDY/zkD ELpmwloJGp+vX5FffPSlu38aSDlH5vel9ok2B3XWNXh6m32yOM3O8mJxJ0zSRH2ocAxw JqKOGPI+S0bAtkf9f5lf0lDqaQkk7wKD9ZhVsQXMplJULDwplQWUCvooNbvYBO4CFSHJ Lkok1JvoJEr38U9Q/b9NdP7BApA4WYnkrOoIc02AdQqKF+CmDYe420Q8Jd+aNS+4fpoy 6KsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H5APmZJU; spf=pass (google.com: domain of linux-kernel+bounces-25304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x4-20020a170902b40400b001d59055c547si5212815plr.293.2024.01.13.06.52.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 06:52:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H5APmZJU; spf=pass (google.com: domain of linux-kernel+bounces-25304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 493E8283CA1 for ; Sat, 13 Jan 2024 14:52:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44A7216416; Sat, 13 Jan 2024 14:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="H5APmZJU" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D068163A9 for ; Sat, 13 Jan 2024 14:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40e6a6208ecso8506525e9.0 for ; Sat, 13 Jan 2024 06:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705157467; x=1705762267; darn=vger.kernel.org; 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=04GA/gYikhVm70mp04BE89vJbyB+HCgNcamoEcplm6o=; b=H5APmZJUWhA4ovcCl7iqmGZLYgXtGyJU8OjkH/3oP1F21LMbCU/6tSCP2mNiK+73YH UmvIxM2rjPIImHpPY6kUlOZ5bY2rD4thWjwXDu3jf7MEuO2HbiDFTIORxGI/BKMx3wFK PTEm1+vQyMoy1uVkGnob1uzgGJAQ0+Iz0NlFTY6OWzVmnMpDBjSou4fgkV8YzBuTM/tO bNnrMrgXJj9EcNcP0v0p6LtZoPtowjzFSFpIta0dxpjknO8iOshLD9JU16h9s7mY5BA4 wbrhX/UAA6Oh66XTOVhsth+o6dvmIY8iNEVvK653rR4LVYPPWDtmundBvRmh58vvxQYL BfoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705157467; x=1705762267; 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=04GA/gYikhVm70mp04BE89vJbyB+HCgNcamoEcplm6o=; b=qwNhSNr8uaVEYeQMb2Ll5mOfnaz0vKzy4Q933BwH7+Q2M2ZkAAyjyldyuCBlGKAbKC Yao0p293+qSbdXS1TxwRswjPhk+MMuXVX+eoJhLxCQMytzHyY2BEAXcDMqXzqfIa9+1D 2stY0m3c1vWoTRDSIV8LI0W3EKRd381JY4Ig26IVpuOrhZZXZl6TK/eRE+aJv4qOTpj9 LJyK7qBumpXj6xUDjtvJxGwBEtDfg+X5FL2E4rJFJ82UkNlq2VqjKaQWN+6GQva1TQZl UoVx2IxUMSrs+83OBhH+f4Lkd/tbMmxeXlpWIJ1COh8xqpdepmx8+3fZ04qPN25Ni18N Gh1A== X-Gm-Message-State: AOJu0YwOIBX+nLbtvX1ZhGr69MBUDHLQutunMYIyxnLlBVaSYxSt438u YHKsN9YvEdmBZrT2vVIma9tsnGTpfrc/vzwkdmq20PzfIuc= X-Received: by 2002:a05:600c:1553:b0:40d:83b8:a8ed with SMTP id f19-20020a05600c155300b0040d83b8a8edmr808216wmg.52.1705157466994; Sat, 13 Jan 2024 06:51:06 -0800 (PST) Received: from [10.167.154.1] (178235179017.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.17]) by smtp.gmail.com with ESMTPSA id es18-20020a056402381200b00554b1d1a934sm3014593edb.27.2024.01.13.06.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 06:51:06 -0800 (PST) From: Konrad Dybcio Date: Sat, 13 Jan 2024 15:50:55 +0100 Subject: [PATCH v6 06/12] clk: qcom: gpucc-sm6115: Add runtime PM Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230717-topic-branch_aon_cleanup-v6-6-46d136a4e8d0@linaro.org> References: <20230717-topic-branch_aon_cleanup-v6-0-46d136a4e8d0@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v6-0-46d136a4e8d0@linaro.org> To: Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705157455; l=1935; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=alZr67bLnwqb3yV+3Ojldc2X/6n9g3vN6yGz8GMYLR4=; b=JyJbdesuxMki5pKs7X0S5jt+C5pgrl33I4DZtUq1W2R6eKfAJkqDwXm3URq1GnvOoNT6arqBz aBv71d7sFIIDzKxhmRNM1TnbCmmZbLOXdih6zeJXXKIEFPKdpUZriD7 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= The GPU_CC block on SM6115 is powered by the VDD_CX rail. We only need to cast an enable vote for it if the GPU blocks are in use. Enable runtime PM to keep the power flowing only when necessary. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gpucc-sm6115.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/gpucc-sm6115.c b/drivers/clk/qcom/gpucc-sm6115.c index 2c2c184747b1..15cf5d63c9ad 100644 --- a/drivers/clk/qcom/gpucc-sm6115.c +++ b/drivers/clk/qcom/gpucc-sm6115.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -443,10 +444,21 @@ MODULE_DEVICE_TABLE(of, gpu_cc_sm6115_match_table); static int gpu_cc_sm6115_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_sm6115_desc); - if (IS_ERR(regmap)) + if (IS_ERR(regmap)) { + pm_runtime_put(&pdev->dev); return PTR_ERR(regmap); + } clk_alpha_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config); clk_alpha_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config); @@ -462,7 +474,10 @@ static int gpu_cc_sm6115_probe(struct platform_device *pdev) qcom_branch_set_clk_en(regmap, 0x1078); /* GPU_CC_AHB_CLK */ qcom_branch_set_clk_en(regmap, 0x1060); /* GPU_CC_GX_CXO_CLK */ - return qcom_cc_really_probe(pdev, &gpu_cc_sm6115_desc, regmap); + ret = qcom_cc_really_probe(pdev, &gpu_cc_sm6115_desc, regmap); + pm_runtime_put(&pdev->dev); + + return ret; } static struct platform_driver gpu_cc_sm6115_driver = { -- 2.43.0