From patchwork Mon Jul 17 15:19:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121392 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1176935vqt; Mon, 17 Jul 2023 08:20:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlHcJfS3mg+IgJ86/HggsjYKuk97rsYujqHnxtHeLdu66TTPnOxnjp8IdvX+MoxMLKUIWfFW X-Received: by 2002:a05:6a20:7a96:b0:12d:282b:8329 with SMTP id u22-20020a056a207a9600b0012d282b8329mr12396113pzh.49.1689607200655; Mon, 17 Jul 2023 08:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607200; cv=none; d=google.com; s=arc-20160816; b=AgC4Zq+t4ii1lFCK+024MU7curvb/4AjpxBcXDc5bZomWQkEDPL6hQVdeZesy5k3Vt sXJ2PBBGBVc7LyU/4EYxxaOP2Vz0UehhaG481OwAzLp0ywScAADRTsiUhuYcjFIOmkuL fLyUj7wkl2PCHUlG0e/1a++95VI//I+f1j6qAYMOWbX413IcRcqq1WkjE3O+rxJ4DheK Rt5XSigEgzB8NVInXwC5JBM07hD+tgVWZzVvAHcoModLfplN/IWWJhDMOmVHYjwcWm/l KmxinsZmAvctiJqRn8uFMeabwvTu6PuMR5OD2nvPfh+FMZb4HNcUX7VurbCHNGhG7/Vv RHGQ== 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=WJ0qGiQRfgozs+tcAPQpQ7XtDjcKLWTvi3TAMjuYVrA=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=o7H7fiIIMjMD5VDiDY4qX+vq0x1vzgeWuX3Dyc5KgKlz4Mfmz/cl8EOKnJYPgwsI8t p7wLTEQ0AvklnzoPbh5xyKaQcn9VNt0ie77ziANpIq4l7nCr6a1W/peJBlvGj1kxuRRe Oh/yhKaBZQ84A9qeLhg0IgVToxE8wl0PQ2Vnhhp5HSj332ehQA2lfA5x770eTgwp1iBB 4EcHtHp4xm0vSiYSZ8Al7bcVaTg4ftVlxu6GNvqGAYpYyygunmxDmSbfYkcTcTsv0B3/ OyZ15W7p4wVa5TlKSmpiAYOvTEjbftm1iHIUCj/I1csmkkXKg4fXwjw/bto3ZRA8fCDG Datg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BorbYIYj; 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 c8-20020a056a00248800b00679cdcafec1si12069611pfv.109.2023.07.17.08.19.47; Mon, 17 Jul 2023 08:20:00 -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=BorbYIYj; 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 S231381AbjGQPTS (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbjGQPTP (ORCPT ); Mon, 17 Jul 2023 11:19:15 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB4C8129 for ; Mon, 17 Jul 2023 08:19:13 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4fdb856482fso2470013e87.1 for ; Mon, 17 Jul 2023 08:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607152; x=1692199152; 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=WJ0qGiQRfgozs+tcAPQpQ7XtDjcKLWTvi3TAMjuYVrA=; b=BorbYIYjhnoPCbMKnNPTMh1c348OYLYDpIk3doZl3rYS4nuxYwYZVrVFqy0jeMf/b7 XxMGvBrmgas2hOWSWXcwmZhio0h6aONL+FuP9Hqy+4UHKv85hlNzio01ia17Aa1lsxQY LF/fWiN1hhKLA7D3NheFXPuZYNzoNKbqvr8UIV2axQFHsUJpIDxc4foV0pTrssUB2Zlq icogCGQHqDEHsAS5Ha/kyogr/KAcibx9uGoi2TdO9y33RrHRLa39tJlqCbYuOXleC8f7 HSUtOLLtrn213X9AGGlBVrQfwj8Wm0VdG2+wsLk4bLBgo2GJk/Htcxm8sysXY+3ne4rF f/Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607152; x=1692199152; 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=WJ0qGiQRfgozs+tcAPQpQ7XtDjcKLWTvi3TAMjuYVrA=; b=ZVzhCnKCH+weJpoE46plc/0ipEV3NYTbJJTNplvAZO3NzkX4P30F24i11P1JsB9sod aGdIrMuo4FH+CQ6aKnb+VoyR8F+P0imkImJQiY2hzJ25Ec8OmcfPMySyhQkPa1cnvANl NQwtW8twoQypW/hn6Z7U5x31jDn11P5b5mCC3X36I6/cMzXWoRZ0OBQBDHBGCfVRds1/ p5tSzXYaRb2+tbhp9213rgMRqErZXVWZQkQVXlGd6AZI2vBNr5kJHLO+Q/6/bPTc5SYL WlIQ+zpCi/59X/B6RZv+QkJaZkl5Lnvb7pIW0smCvaR373V4n8iGpx2kaKJo9PacAheO RRWA== X-Gm-Message-State: ABy/qLadCCyHPrAMu9em1HEFsYYWNImk9iegW+uf+o32ax8apDCnUH2o WiX+xVq1sMR1V0xhIENnKz2HbA== X-Received: by 2002:a19:ca52:0:b0:4f8:6d54:72fb with SMTP id h18-20020a19ca52000000b004f86d5472fbmr7170351lfj.62.1689607152302; Mon, 17 Jul 2023 08:19:12 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:11 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:08 +0200 Subject: [PATCH 01/15] clk: qcom: branch: Add a helper for setting the enable bit MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-1-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=1295; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=6Bd/Fnfm9Yhx1mDIqJ/W7OC8Bh6MqHAA2H25Y3NFUOA=; b=W+t3CYvKLcbnd3HBI6U4rTbNjkWhWpjjL8PwzInHpYqquxKS67oW2oR9Eq80nBfv1/IheKGNt MivQ+jMFAXVClg3i6dYItzbwkIsd+gg504JipLN5HWewLd5NT3MOQOS 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: INBOX X-GMAIL-THRID: 1771681559935652663 X-GMAIL-MSGID: 1771681559935652663 We harcode some clocks to be always-on, as they're essential to the functioning of the SoC / some peripherals. Add a helper to do so to make the writes less magic. Signed-off-by: Konrad Dybcio Reviewed-by: Johan Hovold --- drivers/clk/qcom/clk-branch.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/clk/qcom/clk-branch.h b/drivers/clk/qcom/clk-branch.h index 0cf800b9d08d..155818cc8d49 100644 --- a/drivers/clk/qcom/clk-branch.h +++ b/drivers/clk/qcom/clk-branch.h @@ -47,6 +47,7 @@ struct clk_branch { #define CBCR_FORCE_MEM_PERIPH_OFF BIT(12) #define CBCR_WAKEUP GENMASK(11, 8) #define CBCR_SLEEP GENMASK(7, 4) +#define CBCR_CLOCK_ENABLE BIT(0) static inline void qcom_branch_set_force_mem_core(struct regmap *regmap, struct clk_branch clk, bool on) @@ -81,6 +82,12 @@ static inline void qcom_branch_set_sleep(struct regmap *regmap, struct clk_branc FIELD_PREP(CBCR_SLEEP, val)); } +static inline void qcom_branch_set_clk_en(struct regmap *regmap, u32 cbcr) +{ + regmap_update_bits(regmap, cbcr, CBCR_CLOCK_ENABLE, + CBCR_CLOCK_ENABLE); +} + extern const struct clk_ops clk_branch_ops; extern const struct clk_ops clk_branch2_ops; extern const struct clk_ops clk_branch_simple_ops; From patchwork Mon Jul 17 15:19:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1177066vqt; Mon, 17 Jul 2023 08:20:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlF54sByJ9b9srls2NUhmeAii7Hn4tDJlKi7huL1AaP7auLc85+aJ4w3yPwHj+Rm90iuR9Bs X-Received: by 2002:a05:6a00:1828:b0:681:eddd:51fb with SMTP id y40-20020a056a00182800b00681eddd51fbmr18085183pfa.18.1689607212934; Mon, 17 Jul 2023 08:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607212; cv=none; d=google.com; s=arc-20160816; b=eCFbEM3t4vPCcBBtz/9ygaIY12Z1ibnRV0SfFNPq9zMAvzDAdhBls27kKcfpTQT5/z OYDwFPhvsvP7dV3ooDErxVj35vaoks1yvokJRnFb7LTvA3AfkybQ+TwDOS2KZsrPxAgS EFIc5NGGVbypLeFxl/9kTH0gWPwYJ2oC2ZdJvwy4NY8Qx71cGytXcHlqNox+nMOiyKM0 7M8mIOZnYJcNmx97nEqE3n2+tgNLtCEIVUL5w0EDU6rCcyfkOaKkxCvQqrt2H3XgbHxG 33FShpcNm2qVyqKLc1Ba4lH3L8svLbFFdCLphXBxpbn4a0n07EMhccfP9niu52ZYF6Z6 tgqw== 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=xEbz14sJogEawdfgO5oBd9h7t4FLIUgSkpv1pu1IPqw=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=TyADX16+luer9O6a4uOP1gmWos421HYhP5cxYMkPhDhqMsGvkvwJc1gBED3kyd4MR9 7ukpht+UqSnTjuMDt33C94T30KRka0UnHZ95zjv0yQMq+tuBHofYzrSpHLWAJNZoqRCp cIO0rFmWW2xWG+JyZpdZjGFXwW5veM1zudahrb6+0FaibnqC3Lnr1VQlTSY2NXBer0HH ZBdgk/TjxQ7RBIgyTGQ8IoxKIyTOIHgaacL0s9EUSU0dbqgVxTO8DqfYv8Df7luZYGV7 KFE1O22DquTdtZjx9UvDq+1Fl9czAeIc71vWyFDCPRgP/9eDRMguNmHWTMkBL6dpIoLa tNrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L2Ouk7KB; 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 c6-20020a63ea06000000b005578c6a7689si4333079pgi.91.2023.07.17.08.19.58; Mon, 17 Jul 2023 08:20:12 -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=L2Ouk7KB; 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 S231512AbjGQPT0 (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231405AbjGQPTT (ORCPT ); Mon, 17 Jul 2023 11:19:19 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5C8D103 for ; Mon, 17 Jul 2023 08:19:15 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4fb7b2e3dacso7375193e87.0 for ; Mon, 17 Jul 2023 08:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607154; x=1692199154; 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=xEbz14sJogEawdfgO5oBd9h7t4FLIUgSkpv1pu1IPqw=; b=L2Ouk7KBh+sMXqs/a+pppZLxaIMTZ4dGtgg/aSl8qpDmqmmuXAb26WlOE3hESDEmyY +uGJ/DHeCdAU0m9sh4MwT2jSOHPd5KfEN2ehzpRtPecjbpx914iRdmKcoj4652T6rvgx K1lNFph20QeMtm1hzuGrnbgkITQGIqOIhmZDSe9GmSoHcXMIX0ordBBbyhsJ7YVuejV9 wtu7FfxsatJLBZMZZgx6l3WEUS063PdE0wYG5z3gMDRMMGB/W+zrvoT9j+W9bFJCBS2d b6X+nhJrxVMqGAGqkxY14pg+JZ1ro5R71cypGwUJqOmV4Gh/miyOT02eMWz1kfnxAtW0 Se/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607154; x=1692199154; 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=xEbz14sJogEawdfgO5oBd9h7t4FLIUgSkpv1pu1IPqw=; b=du4rH9GmrKXLxg9q5n/NL4IN4NI5xmTuUvaUUd7RWWyvhVwsakpBS3CZqf6Fr1wGPA uIZA5L9WNSd5TdRwVcFL2zOKWopwsJm5DoLQBl4eduNYd1xgDsIrnFwLeOclIzBj6PDw pQ3q6jb8PULfTI9MkMW2dGtv3RdbVdQ6nOmonkEynYQ+TZbgH7UKA/5HQh85EKk7c6rk /CqrQl7ojpHKkoWj7UsjtOFXWJweb9u/KnTR99ItRIturIL6zeBE4zLOJLhJl0W1nxez mEeVjbLDIhae2VGVs1pygXWY19eLThqHfcUeA04mZDl4rkno77B2fHzKwiSVZu0mcXp8 NUiw== X-Gm-Message-State: ABy/qLZbywKoVKGgsG9t0ljaKu2TDCwgTmTQUqbF3/Lcm6hoa/Pbn6JJ 3YMSQCIyjtDdRMgylaiwskFxKQ== X-Received: by 2002:a05:6512:46d:b0:4fb:90f7:6769 with SMTP id x13-20020a056512046d00b004fb90f76769mr7248001lfd.21.1689607153898; Mon, 17 Jul 2023 08:19:13 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:13 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:09 +0200 Subject: [PATCH 02/15] clk: qcom: Use qcom_branch_set_clk_en() MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-2-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=26116; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=WD5ZHHQLMyFWQF1yLyD4USNKrd2rTZcsxTllxzqVFIw=; b=1i6EXn+AhtpqtfVuQu1WjMmVN9Y7MwxudW2b/HsKxH0DEFNbyKGOvJLMtgW89U8O5Q65obogI 0sTtEEkucM1A+tG0hpDGhTGu6II3bifIN/laovOJ0uOKvxooFgf/Tfw 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: INBOX X-GMAIL-THRID: 1771681572726958972 X-GMAIL-MSGID: 1771681572726958972 Instead of magically poking at the bit0 of branch clocks' CBCR, use the newly introduced helper. Signed-off-by: Konrad Dybcio Acked-by: Johan Hovold --- drivers/clk/qcom/dispcc-qcm2290.c | 2 +- drivers/clk/qcom/dispcc-sc7280.c | 2 +- drivers/clk/qcom/dispcc-sc8280xp.c | 2 +- drivers/clk/qcom/dispcc-sm6115.c | 2 +- drivers/clk/qcom/dispcc-sm8250.c | 2 +- drivers/clk/qcom/dispcc-sm8450.c | 2 +- drivers/clk/qcom/dispcc-sm8550.c | 2 +- drivers/clk/qcom/gcc-sa8775p.c | 18 +++++++++--------- drivers/clk/qcom/gcc-sc7180.c | 16 ++++++++-------- drivers/clk/qcom/gcc-sc7280.c | 14 +++++++------- drivers/clk/qcom/gcc-sc8180x.c | 20 ++++++++++---------- drivers/clk/qcom/gcc-sc8280xp.c | 18 +++++++++--------- drivers/clk/qcom/gcc-sdx55.c | 2 +- drivers/clk/qcom/gcc-sdx65.c | 2 +- drivers/clk/qcom/gcc-sdx75.c | 4 ++-- drivers/clk/qcom/gcc-sm6375.c | 6 +++--- drivers/clk/qcom/gcc-sm7150.c | 16 ++++++++-------- drivers/clk/qcom/gcc-sm8250.c | 12 ++++++------ drivers/clk/qcom/gcc-sm8350.c | 14 +++++++------- drivers/clk/qcom/gcc-sm8450.c | 14 +++++++------- drivers/clk/qcom/gcc-sm8550.c | 14 +++++++------- drivers/clk/qcom/gpucc-sc7280.c | 4 ++-- drivers/clk/qcom/gpucc-sc8280xp.c | 4 ++-- drivers/clk/qcom/gpucc-sm8550.c | 4 ++-- drivers/clk/qcom/lpasscorecc-sc7180.c | 2 +- drivers/clk/qcom/videocc-sm8250.c | 4 ++-- drivers/clk/qcom/videocc-sm8350.c | 4 ++-- drivers/clk/qcom/videocc-sm8450.c | 6 +++--- drivers/clk/qcom/videocc-sm8550.c | 6 +++--- 29 files changed, 109 insertions(+), 109 deletions(-) diff --git a/drivers/clk/qcom/dispcc-qcm2290.c b/drivers/clk/qcom/dispcc-qcm2290.c index 44dd5cfcc150..5f90e8c15c01 100644 --- a/drivers/clk/qcom/dispcc-qcm2290.c +++ b/drivers/clk/qcom/dispcc-qcm2290.c @@ -520,7 +520,7 @@ static int disp_cc_qcm2290_probe(struct platform_device *pdev) clk_alpha_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config); /* Keep DISP_CC_XO_CLK always-ON */ - regmap_update_bits(regmap, 0x604c, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x604c); ret = qcom_cc_really_probe(pdev, &disp_cc_qcm2290_desc, regmap); if (ret) { diff --git a/drivers/clk/qcom/dispcc-sc7280.c b/drivers/clk/qcom/dispcc-sc7280.c index ad596d567f6a..975f31b51539 100644 --- a/drivers/clk/qcom/dispcc-sc7280.c +++ b/drivers/clk/qcom/dispcc-sc7280.c @@ -882,7 +882,7 @@ static int disp_cc_sc7280_probe(struct platform_device *pdev) * Keep the clocks always-ON * DISP_CC_XO_CLK */ - regmap_update_bits(regmap, 0x5008, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x5008); return qcom_cc_really_probe(pdev, &disp_cc_sc7280_desc, regmap); } diff --git a/drivers/clk/qcom/dispcc-sc8280xp.c b/drivers/clk/qcom/dispcc-sc8280xp.c index 167470beb369..37b8bbbe9282 100644 --- a/drivers/clk/qcom/dispcc-sc8280xp.c +++ b/drivers/clk/qcom/dispcc-sc8280xp.c @@ -3179,7 +3179,7 @@ static int disp_cc_sc8280xp_probe(struct platform_device *pdev) } /* DISP_CC_XO_CLK always-on */ - regmap_update_bits(regmap, 0x605c, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x605c); out_pm_runtime_put: pm_runtime_put_sync(&pdev->dev); diff --git a/drivers/clk/qcom/dispcc-sm6115.c b/drivers/clk/qcom/dispcc-sm6115.c index 1937edf23f21..cf88ca143bd7 100644 --- a/drivers/clk/qcom/dispcc-sm6115.c +++ b/drivers/clk/qcom/dispcc-sm6115.c @@ -584,7 +584,7 @@ static int disp_cc_sm6115_probe(struct platform_device *pdev) clk_alpha_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config); /* Keep DISP_CC_XO_CLK always-ON */ - regmap_update_bits(regmap, 0x604c, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x604c); ret = qcom_cc_really_probe(pdev, &disp_cc_sm6115_desc, regmap); if (ret) { diff --git a/drivers/clk/qcom/dispcc-sm8250.c b/drivers/clk/qcom/dispcc-sm8250.c index e17bb8b543b5..4f2297043820 100644 --- a/drivers/clk/qcom/dispcc-sm8250.c +++ b/drivers/clk/qcom/dispcc-sm8250.c @@ -1366,7 +1366,7 @@ static int disp_cc_sm8250_probe(struct platform_device *pdev) regmap_update_bits(regmap, 0x8000, 0x10, 0x10); /* DISP_CC_XO_CLK always-on */ - regmap_update_bits(regmap, 0x605c, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x605c); ret = qcom_cc_really_probe(pdev, &disp_cc_sm8250_desc, regmap); diff --git a/drivers/clk/qcom/dispcc-sm8450.c b/drivers/clk/qcom/dispcc-sm8450.c index adbfd30bfc96..e258cd9ba87e 100644 --- a/drivers/clk/qcom/dispcc-sm8450.c +++ b/drivers/clk/qcom/dispcc-sm8450.c @@ -1789,7 +1789,7 @@ static int disp_cc_sm8450_probe(struct platform_device *pdev) * Keep clocks always enabled: * disp_cc_xo_clk */ - regmap_update_bits(regmap, 0xe05c, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0xe05c); ret = qcom_cc_really_probe(pdev, &disp_cc_sm8450_desc, regmap); diff --git a/drivers/clk/qcom/dispcc-sm8550.c b/drivers/clk/qcom/dispcc-sm8550.c index 1e5a11081860..2bd6ca2c952f 100644 --- a/drivers/clk/qcom/dispcc-sm8550.c +++ b/drivers/clk/qcom/dispcc-sm8550.c @@ -1774,7 +1774,7 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev) * Keep clocks always enabled: * disp_cc_xo_clk */ - regmap_update_bits(regmap, 0xe054, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0xe054); ret = qcom_cc_really_probe(pdev, &disp_cc_sm8550_desc, regmap); diff --git a/drivers/clk/qcom/gcc-sa8775p.c b/drivers/clk/qcom/gcc-sa8775p.c index bb94ff367abd..9db144b7f05f 100644 --- a/drivers/clk/qcom/gcc-sa8775p.c +++ b/drivers/clk/qcom/gcc-sa8775p.c @@ -4748,15 +4748,15 @@ static int gcc_sa8775p_probe(struct platform_device *pdev) * GCC_DISP1_XO_CLK, GCC_DISP_AHB_CLK, GCC_DISP_XO_CLK, * GCC_GPU_CFG_AHB_CLK, GCC_VIDEO_AHB_CLK, GCC_VIDEO_XO_CLK. */ - regmap_update_bits(regmap, 0x32004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x32020, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xc7004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xc7018, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x33004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x33018, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x7d004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x34004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x34024, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x32004); + qcom_branch_set_clk_en(regmap, 0x32020); + qcom_branch_set_clk_en(regmap, 0xc7004); + qcom_branch_set_clk_en(regmap, 0xc7018); + qcom_branch_set_clk_en(regmap, 0x33004); + qcom_branch_set_clk_en(regmap, 0x33018); + qcom_branch_set_clk_en(regmap, 0x7d004); + qcom_branch_set_clk_en(regmap, 0x34004); + qcom_branch_set_clk_en(regmap, 0x34024); return qcom_cc_really_probe(pdev, &gcc_sa8775p_desc, regmap); } diff --git a/drivers/clk/qcom/gcc-sc7180.c b/drivers/clk/qcom/gcc-sc7180.c index cef3c77564cf..4f79ecb8300d 100644 --- a/drivers/clk/qcom/gcc-sc7180.c +++ b/drivers/clk/qcom/gcc-sc7180.c @@ -2447,14 +2447,14 @@ static int gcc_sc7180_probe(struct platform_device *pdev) * GCC_CPUSS_GNOC_CLK, GCC_VIDEO_AHB_CLK, GCC_CAMERA_AHB_CLK, * GCC_DISP_AHB_CLK, GCC_GPU_CFG_AHB_CLK */ - regmap_update_bits(regmap, 0x48004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b008, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b00c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b02c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b028, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b030, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x48004); + qcom_branch_set_clk_en(regmap, 0x0b004); + qcom_branch_set_clk_en(regmap, 0x0b008); + qcom_branch_set_clk_en(regmap, 0x0b00c); + qcom_branch_set_clk_en(regmap, 0x0b02c); + qcom_branch_set_clk_en(regmap, 0x0b028); + qcom_branch_set_clk_en(regmap, 0x0b030); + qcom_branch_set_clk_en(regmap, 0x71004); ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks)); diff --git a/drivers/clk/qcom/gcc-sc7280.c b/drivers/clk/qcom/gcc-sc7280.c index 1dc804154031..b23f7103d08d 100644 --- a/drivers/clk/qcom/gcc-sc7280.c +++ b/drivers/clk/qcom/gcc-sc7280.c @@ -3458,13 +3458,13 @@ static int gcc_sc7280_probe(struct platform_device *pdev) * GCC_CAMERA_AHB_CLK/XO_CLK, GCC_DISP_AHB_CLK/XO_CLK * GCC_VIDEO_AHB_CLK/XO_CLK, GCC_GPU_CFG_AHB_CLK */ - regmap_update_bits(regmap, 0x26004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x26028, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x27004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x2701C, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x28004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x28014, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x26004); + qcom_branch_set_clk_en(regmap, 0x26028); + qcom_branch_set_clk_en(regmap, 0x27004); + qcom_branch_set_clk_en(regmap, 0x2701C); + qcom_branch_set_clk_en(regmap, 0x28004); + qcom_branch_set_clk_en(regmap, 0x28014); + qcom_branch_set_clk_en(regmap, 0x71004); regmap_update_bits(regmap, 0x7100C, BIT(13), BIT(13)); ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, diff --git a/drivers/clk/qcom/gcc-sc8180x.c b/drivers/clk/qcom/gcc-sc8180x.c index c41b9f010585..14f09c407198 100644 --- a/drivers/clk/qcom/gcc-sc8180x.c +++ b/drivers/clk/qcom/gcc-sc8180x.c @@ -4587,16 +4587,16 @@ static int gcc_sc8180x_probe(struct platform_device *pdev) * GCC_CPUSS_GNOC_CLK, GCC_CPUSS_DVM_BUS_CLK, GCC_NPU_CFG_AHB_CLK and * GCC_GPU_CFG_AHB_CLK */ - regmap_update_bits(regmap, 0xb004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xb008, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xb00c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xb040, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xb044, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xb048, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x48004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x48190, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x4d004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0xb004); + qcom_branch_set_clk_en(regmap, 0xb008); + qcom_branch_set_clk_en(regmap, 0xb00c); + qcom_branch_set_clk_en(regmap, 0xb040); + qcom_branch_set_clk_en(regmap, 0xb044); + qcom_branch_set_clk_en(regmap, 0xb048); + qcom_branch_set_clk_en(regmap, 0x48004); + qcom_branch_set_clk_en(regmap, 0x48190); + qcom_branch_set_clk_en(regmap, 0x4d004); + qcom_branch_set_clk_en(regmap, 0x71004); /* Disable the GPLL0 active input to NPU and GPU via MISC registers */ regmap_update_bits(regmap, 0x4d110, 0x3, 0x3); diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c index 1fb6ffac730c..a9b3735baa4b 100644 --- a/drivers/clk/qcom/gcc-sc8280xp.c +++ b/drivers/clk/qcom/gcc-sc8280xp.c @@ -7549,15 +7549,15 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev) * GCC_DISP_XO_CLK, GCC_GPU_CFG_AHB_CLK, GCC_VIDEO_AHB_CLK, * GCC_VIDEO_XO_CLK, GCC_DISP1_AHB_CLK, GCC_DISP1_XO_CLK */ - regmap_update_bits(regmap, 0x26004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x26020, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x27004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x27028, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x28004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x28028, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xbb004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xbb028, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x26004); + qcom_branch_set_clk_en(regmap, 0x26020); + qcom_branch_set_clk_en(regmap, 0x27004); + qcom_branch_set_clk_en(regmap, 0x27028); + qcom_branch_set_clk_en(regmap, 0x71004); + qcom_branch_set_clk_en(regmap, 0x28004); + qcom_branch_set_clk_en(regmap, 0x28028); + qcom_branch_set_clk_en(regmap, 0xbb004); + qcom_branch_set_clk_en(regmap, 0xbb028); ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks)); if (ret) diff --git a/drivers/clk/qcom/gcc-sdx55.c b/drivers/clk/qcom/gcc-sdx55.c index d5e17122698c..b1ef6223b5ee 100644 --- a/drivers/clk/qcom/gcc-sdx55.c +++ b/drivers/clk/qcom/gcc-sdx55.c @@ -1616,7 +1616,7 @@ static int gcc_sdx55_probe(struct platform_device *pdev) * of the system: * GCC_SYS_NOC_CPUSS_AHB_CLK, GCC_CPUSS_AHB_CLK, GCC_CPUSS_GNOC_CLK */ - regmap_update_bits(regmap, 0x6d008, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x6d008); regmap_update_bits(regmap, 0x6d008, BIT(21), BIT(21)); regmap_update_bits(regmap, 0x6d008, BIT(22), BIT(22)); diff --git a/drivers/clk/qcom/gcc-sdx65.c b/drivers/clk/qcom/gcc-sdx65.c index b0c17043551d..62ea059d528d 100644 --- a/drivers/clk/qcom/gcc-sdx65.c +++ b/drivers/clk/qcom/gcc-sdx65.c @@ -1579,7 +1579,7 @@ static int gcc_sdx65_probe(struct platform_device *pdev) * of the system: * GCC_SYS_NOC_CPUSS_AHB_CLK, GCC_CPUSS_AHB_CLK, GCC_CPUSS_GNOC_CLK */ - regmap_update_bits(regmap, 0x6d008, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x6d008); regmap_update_bits(regmap, 0x6d008, BIT(21), BIT(21)); regmap_update_bits(regmap, 0x6d008, BIT(22), BIT(22)); diff --git a/drivers/clk/qcom/gcc-sdx75.c b/drivers/clk/qcom/gcc-sdx75.c index b6772abdcec5..3c838fb43ce8 100644 --- a/drivers/clk/qcom/gcc-sdx75.c +++ b/drivers/clk/qcom/gcc-sdx75.c @@ -2940,8 +2940,8 @@ static int gcc_sdx75_probe(struct platform_device *pdev) * gcc_ahb_pcie_link_clk * gcc_xo_pcie_link_clk */ - regmap_update_bits(regmap, 0x3e004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x3e008, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x3e004); + qcom_branch_set_clk_en(regmap, 0x3e008); return qcom_cc_really_probe(pdev, &gcc_sdx75_desc, regmap); } diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c index 417a0fd242ec..e94e88bdfb91 100644 --- a/drivers/clk/qcom/gcc-sm6375.c +++ b/drivers/clk/qcom/gcc-sm6375.c @@ -3885,9 +3885,9 @@ static int gcc_sm6375_probe(struct platform_device *pdev) * Keep the following clocks always on: * GCC_CAMERA_XO_CLK, GCC_CPUSS_GNOC_CLK, GCC_DISP_XO_CLK */ - regmap_update_bits(regmap, 0x17028, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x2b004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x1702c, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x17028); + qcom_branch_set_clk_en(regmap, 0x2b004); + qcom_branch_set_clk_en(regmap, 0x1702c); clk_lucid_pll_configure(&gpll10, regmap, &gpll10_config); clk_lucid_pll_configure(&gpll11, regmap, &gpll11_config); diff --git a/drivers/clk/qcom/gcc-sm7150.c b/drivers/clk/qcom/gcc-sm7150.c index 6da87f0436d0..696cca37b48b 100644 --- a/drivers/clk/qcom/gcc-sm7150.c +++ b/drivers/clk/qcom/gcc-sm7150.c @@ -3008,14 +3008,14 @@ static int gcc_sm7150_probe(struct platform_device *pdev) * GCC_DISP_AHB_CLK, GCC_CAMERA_XO_CLK, GCC_VIDEO_XO_CLK, * GCC_DISP_XO_CLK, GCC_GPU_CFG_AHB_CLK */ - regmap_update_bits(regmap, 0x48004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b008, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b00c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b02c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b028, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b030, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x48004); + qcom_branch_set_clk_en(regmap, 0x0b004); + qcom_branch_set_clk_en(regmap, 0x0b008); + qcom_branch_set_clk_en(regmap, 0x0b00c); + qcom_branch_set_clk_en(regmap, 0x0b02c); + qcom_branch_set_clk_en(regmap, 0x0b028); + qcom_branch_set_clk_en(regmap, 0x0b030); + qcom_branch_set_clk_en(regmap, 0x71004); ret = qcom_cc_register_rcg_dfs(regmap, gcc_sm7150_dfs_desc, ARRAY_SIZE(gcc_sm7150_dfs_desc)); diff --git a/drivers/clk/qcom/gcc-sm8250.c b/drivers/clk/qcom/gcc-sm8250.c index b6cf4bc88d4d..ad3dd69dd198 100644 --- a/drivers/clk/qcom/gcc-sm8250.c +++ b/drivers/clk/qcom/gcc-sm8250.c @@ -3648,12 +3648,12 @@ static int gcc_sm8250_probe(struct platform_device *pdev) * GCC_CPUSS_DVM_BUS_CLK, GCC_GPU_CFG_AHB_CLK, * GCC_SYS_NOC_CPUSS_AHB_CLK */ - regmap_update_bits(regmap, 0x0b004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b008, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x0b00c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x4818c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x52000, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x0b004); + qcom_branch_set_clk_en(regmap, 0x0b008); + qcom_branch_set_clk_en(regmap, 0x0b00c); + qcom_branch_set_clk_en(regmap, 0x4818c); + qcom_branch_set_clk_en(regmap, 0x71004); + qcom_branch_set_clk_en(regmap, 0x52000); ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks)); diff --git a/drivers/clk/qcom/gcc-sm8350.c b/drivers/clk/qcom/gcc-sm8350.c index 1385a98eb3bb..b56a7669b770 100644 --- a/drivers/clk/qcom/gcc-sm8350.c +++ b/drivers/clk/qcom/gcc-sm8350.c @@ -3811,13 +3811,13 @@ static int gcc_sm8350_probe(struct platform_device *pdev) * GCC_CAMERA_AHB_CLK, GCC_CAMERA_XO_CLK, GCC_DISP_AHB_CLK, GCC_DISP_XO_CLK, * GCC_GPU_CFG_AHB_CLK, GCC_VIDEO_AHB_CLK, GCC_VIDEO_XO_CLK */ - regmap_update_bits(regmap, 0x26004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x26018, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x27004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x2701c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x28004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x28020, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x26004); + qcom_branch_set_clk_en(regmap, 0x26018); + qcom_branch_set_clk_en(regmap, 0x27004); + qcom_branch_set_clk_en(regmap, 0x2701c); + qcom_branch_set_clk_en(regmap, 0x71004); + qcom_branch_set_clk_en(regmap, 0x28004); + qcom_branch_set_clk_en(regmap, 0x28020); ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks)); if (ret) diff --git a/drivers/clk/qcom/gcc-sm8450.c b/drivers/clk/qcom/gcc-sm8450.c index 75635d40a12d..5a7a723ff5ef 100644 --- a/drivers/clk/qcom/gcc-sm8450.c +++ b/drivers/clk/qcom/gcc-sm8450.c @@ -3285,13 +3285,13 @@ static int gcc_sm8450_probe(struct platform_device *pdev) * gcc_disp_xo_clk, gcc_gpu_cfg_ahb_clk, gcc_video_ahb_clk, * gcc_video_xo_clk */ - regmap_update_bits(regmap, 0x36004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x36020, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x37004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x3701c, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x81004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x42004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x42028, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x36004); + qcom_branch_set_clk_en(regmap, 0x36020); + qcom_branch_set_clk_en(regmap, 0x37004); + qcom_branch_set_clk_en(regmap, 0x3701c); + qcom_branch_set_clk_en(regmap, 0x81004); + qcom_branch_set_clk_en(regmap, 0x42004); + qcom_branch_set_clk_en(regmap, 0x42028); return qcom_cc_really_probe(pdev, &gcc_sm8450_desc, regmap); } diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c index 277cd4f020ff..a6404421021f 100644 --- a/drivers/clk/qcom/gcc-sm8550.c +++ b/drivers/clk/qcom/gcc-sm8550.c @@ -3349,13 +3349,13 @@ static int gcc_sm8550_probe(struct platform_device *pdev) * gcc_disp_xo_clk, gcc_gpu_cfg_ahb_clk, gcc_video_ahb_clk, * gcc_video_xo_clk */ - regmap_update_bits(regmap, 0x26004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x26028, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x27004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x27018, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x32004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x32030, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x26004); + qcom_branch_set_clk_en(regmap, 0x26028); + qcom_branch_set_clk_en(regmap, 0x27004); + qcom_branch_set_clk_en(regmap, 0x27018); + qcom_branch_set_clk_en(regmap, 0x71004); + qcom_branch_set_clk_en(regmap, 0x32004); + qcom_branch_set_clk_en(regmap, 0x32030); /* Clear GDSC_SLEEP_ENA_VOTE to stop votes being auto-removed in sleep. */ regmap_write(regmap, 0x52024, 0x0); diff --git a/drivers/clk/qcom/gpucc-sc7280.c b/drivers/clk/qcom/gpucc-sc7280.c index 1490cd45a654..a678c51cd75e 100644 --- a/drivers/clk/qcom/gpucc-sc7280.c +++ b/drivers/clk/qcom/gpucc-sc7280.c @@ -461,8 +461,8 @@ static int gpu_cc_sc7280_probe(struct platform_device *pdev) * Keep the clocks always-ON * GPU_CC_CB_CLK, GPUCC_CX_GMU_CLK */ - regmap_update_bits(regmap, 0x1170, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x1098, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x1170); + qcom_branch_set_clk_en(regmap, 0x1098); regmap_update_bits(regmap, 0x1098, BIT(13), BIT(13)); return qcom_cc_really_probe(pdev, &gpu_cc_sc7280_desc, regmap); diff --git a/drivers/clk/qcom/gpucc-sc8280xp.c b/drivers/clk/qcom/gpucc-sc8280xp.c index 8e147ee294ee..c709365a3c57 100644 --- a/drivers/clk/qcom/gpucc-sc8280xp.c +++ b/drivers/clk/qcom/gpucc-sc8280xp.c @@ -448,8 +448,8 @@ static int gpu_cc_sc8280xp_probe(struct platform_device *pdev) * Keep the clocks always-ON * GPU_CC_CB_CLK, GPU_CC_CXO_CLK */ - regmap_update_bits(regmap, 0x1170, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x109c, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x1170); + qcom_branch_set_clk_en(regmap, 0x109c); ret = qcom_cc_really_probe(pdev, &gpu_cc_sc8280xp_desc, regmap); pm_runtime_put(&pdev->dev); diff --git a/drivers/clk/qcom/gpucc-sm8550.c b/drivers/clk/qcom/gpucc-sm8550.c index 8a2e3522af51..225807979435 100644 --- a/drivers/clk/qcom/gpucc-sm8550.c +++ b/drivers/clk/qcom/gpucc-sm8550.c @@ -581,8 +581,8 @@ static int gpu_cc_sm8550_probe(struct platform_device *pdev) * gpu_cc_cxo_aon_clk * gpu_cc_demet_clk */ - regmap_update_bits(regmap, 0x9004, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x900c, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x9004); + qcom_branch_set_clk_en(regmap, 0x900c); return qcom_cc_really_probe(pdev, &gpu_cc_sm8550_desc, regmap); } diff --git a/drivers/clk/qcom/lpasscorecc-sc7180.c b/drivers/clk/qcom/lpasscorecc-sc7180.c index 010867dcc2ef..7fa2e28489fd 100644 --- a/drivers/clk/qcom/lpasscorecc-sc7180.c +++ b/drivers/clk/qcom/lpasscorecc-sc7180.c @@ -405,7 +405,7 @@ static int lpass_core_cc_sc7180_probe(struct platform_device *pdev) * Keep the CLK always-ON * LPASS_AUDIO_CORE_SYSNOC_SWAY_CORE_CLK */ - regmap_update_bits(regmap, 0x24000, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x24000); /* PLL settings */ regmap_write(regmap, 0x1008, 0x20); diff --git a/drivers/clk/qcom/videocc-sm8250.c b/drivers/clk/qcom/videocc-sm8250.c index ad46c4014a40..1f269025f3f8 100644 --- a/drivers/clk/qcom/videocc-sm8250.c +++ b/drivers/clk/qcom/videocc-sm8250.c @@ -384,8 +384,8 @@ static int video_cc_sm8250_probe(struct platform_device *pdev) clk_lucid_pll_configure(&video_pll1, regmap, &video_pll1_config); /* Keep VIDEO_CC_AHB_CLK and VIDEO_CC_XO_CLK ALWAYS-ON */ - regmap_update_bits(regmap, 0xe58, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xeec, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0xe58); + qcom_branch_set_clk_en(regmap, 0xeec); ret = qcom_cc_really_probe(pdev, &video_cc_sm8250_desc, regmap); diff --git a/drivers/clk/qcom/videocc-sm8350.c b/drivers/clk/qcom/videocc-sm8350.c index b148877fc73d..4e6b2c7fe61b 100644 --- a/drivers/clk/qcom/videocc-sm8350.c +++ b/drivers/clk/qcom/videocc-sm8350.c @@ -524,8 +524,8 @@ static int video_cc_sm8350_probe(struct platform_device *pdev) * video_cc_ahb_clk * video_cc_xo_clk */ - regmap_update_bits(regmap, 0xe58, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0xeec, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0xe58); + qcom_branch_set_clk_en(regmap, 0xeec); ret = qcom_cc_really_probe(pdev, &video_cc_sm8350_desc, regmap); pm_runtime_put(&pdev->dev); diff --git a/drivers/clk/qcom/videocc-sm8450.c b/drivers/clk/qcom/videocc-sm8450.c index 7d0029b8b799..deaf58c95749 100644 --- a/drivers/clk/qcom/videocc-sm8450.c +++ b/drivers/clk/qcom/videocc-sm8450.c @@ -428,9 +428,9 @@ static int video_cc_sm8450_probe(struct platform_device *pdev) * video_cc_sleep_clk * video_cc_xo_clk */ - regmap_update_bits(regmap, 0x80e4, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x8130, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x8114, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x80e4); + qcom_branch_set_clk_en(regmap, 0x8130); + qcom_branch_set_clk_en(regmap, 0x8114); ret = qcom_cc_really_probe(pdev, &video_cc_sm8450_desc, regmap); diff --git a/drivers/clk/qcom/videocc-sm8550.c b/drivers/clk/qcom/videocc-sm8550.c index e2400fe23e60..802bbd616b2f 100644 --- a/drivers/clk/qcom/videocc-sm8550.c +++ b/drivers/clk/qcom/videocc-sm8550.c @@ -435,9 +435,9 @@ static int video_cc_sm8550_probe(struct platform_device *pdev) * video_cc_sleep_clk * video_cc_xo_clk */ - regmap_update_bits(regmap, 0x80f4, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x8140, BIT(0), BIT(0)); - regmap_update_bits(regmap, 0x8124, BIT(0), BIT(0)); + qcom_branch_set_clk_en(regmap, 0x80f4); + qcom_branch_set_clk_en(regmap, 0x8140); + qcom_branch_set_clk_en(regmap, 0x8124); ret = qcom_cc_really_probe(pdev, &video_cc_sm8550_desc, regmap); From patchwork Mon Jul 17 15:19:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121409 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1182458vqt; Mon, 17 Jul 2023 08:30:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEh/tkdoNWOXud5ZR2N6nv6znHCrhYPW5pMLlWZ5ooLcmyjN2qq1XLBVnOKJlEn1R34/ngL X-Received: by 2002:a17:906:14e:b0:989:450:e57d with SMTP id 14-20020a170906014e00b009890450e57dmr10402460ejh.73.1689607807348; Mon, 17 Jul 2023 08:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607807; cv=none; d=google.com; s=arc-20160816; b=xJki0hWzZl9MexN3+YzOv2oXHfHpi3vHcR9x1jlAEh+RR0OAc/Mj6t30bE5pH/t7S0 23on4ksMk1maDBh3lZwSF0DlBTCbAZT8v7EjTFcsNifcNEcd/5qgiAS083oUU2bG4W9N zgX2kv4dnwbdOIloo6lSaKWInxC3mz95NtZVWZs4D/K0vuXGSf+5mkiTpS4VyY9udeXw 0T82WPmRQghZ96kFVV41RoVaENAfbp673DvriVqURN3IAMgfFm0bRFAatT/DnIGQxm54 xAq2AxggjWBIguGQeNg0gpgH2xbyvdYs0f5A44fXbMhBRDq7wH/ZvwgqBsF3ENxsrY3K wR+w== 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=8dB0fbKd3+8AbGwql3M82AbS790ZYBGNIltYY40ECjw=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=P1kezZDPoLzoswH9rDr0AfeOf8zT4LI7J3touZW+kigV0BOB5M1Es/575l2EoWybfC tlokoHvP3v7OIXTK+V9bK93Q7Tq5X452nqKm6pJKiwBWC69r7HyrQ6KkN5uahcLGPYRk xcQ0r22gr6waDQh9cB29td59xTvGMEJ2pYcH44/paJhlz9uP6qp4mFc7/KOXH3wbX0Ap ZNGtcBRsMKkacBEEri0WHKH/H8XhEHyfa+GkAYsOILfiet4apgrjRdNIzow/aLya+E7j KEaWRPgdtFwSUjHnsP3Sh2PkYYxFXcbT4m94/BVNeMZcSk3oV2AhggTaFHWpTzu+gyJV U5Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VoNKx2pf; 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 w17-20020a1709067c9100b0098e2aa0bb92si13575182ejo.137.2023.07.17.08.29.42; Mon, 17 Jul 2023 08:30:07 -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=VoNKx2pf; 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 S231490AbjGQPTY (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbjGQPTT (ORCPT ); Mon, 17 Jul 2023 11:19:19 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E796D2 for ; Mon, 17 Jul 2023 08:19:17 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4faaaa476a9so7473607e87.2 for ; Mon, 17 Jul 2023 08:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607155; x=1692199155; 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=8dB0fbKd3+8AbGwql3M82AbS790ZYBGNIltYY40ECjw=; b=VoNKx2pfjcI/atQfdZc39nUP0jj9XPlEdzjSv36h/itQHX65GtSU51yXxBlOEdYMpP 2jinTqzUXPuzZGEWI22d5HKIlt8yFJL9+GmLgNO9dZOPDvul8yDyKi4xd8Gkvpzg+kmt XEmg6SqxdHDWsVtrh4qK0PkSY5sPqAAkbRRaQr/uIKLObHO600u5VrObNoWnv6tSw96G Un/ypVIys1fO7umkh8w9g8O0RPqmw0Op4YQ0vTcecRj0Kvf4qEy8aM7vHlOoMFbL4l/A 7fhxotZHC4pAPAonoIzAI8fTLM1R3ALs4LVHV8i6Qx21sJEFaH/ZoFhLbM3zVAf9wosE 8tVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607155; x=1692199155; 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=8dB0fbKd3+8AbGwql3M82AbS790ZYBGNIltYY40ECjw=; b=YmHmnP7b9bwaMFuq5hUDFuJ0KLmALriuDVpURmCk1h5Aj7Nav1RSecgL/Ly/4qPtru WaVtLQquIls9Jow/CRtRNk0TwykbNRpELJEb4rLzhFU5yT6PjulNHxbHW/jcHFCK+VfQ OrTzQjX/akahOMNYrflGn8MlUl6FnwFa7bUXI8oKN9iD9Dlonvvp0lI6145ml+4XzGxG JrSrLB+K6wZgXo5Z/QmZAYaLGEdsXcAwGp/TStNI86U542G10BY9RZpRj+FyCgD3O6ap jcW27GGuOxRWRGq02TPuR9hPq3ZxFFiodnxZGL7zW1eYDOwORW368xqPmzSguAr4iaIT U00Q== X-Gm-Message-State: ABy/qLbcAheVlM3M7ckx627Jqqy6biH2I6U3uq4UgMKNzgAo+gOsTS9v 5FDe6M3F2Gwtb+gD/MvNujbJxg== X-Received: by 2002:a05:6512:110a:b0:4fd:c715:5667 with SMTP id l10-20020a056512110a00b004fdc7155667mr978338lfg.20.1689607155303; Mon, 17 Jul 2023 08:19:15 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:14 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:10 +0200 Subject: [PATCH 03/15] clk: qcom: gcc-sm6375: Unregister critical clocks MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-3-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=6998; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nlQSrpDwXAIARKneY1DtqMYtmRn22TVOrx5+llC+mac=; b=Q8exJDNvf0akjWbLPSSCB3p1/wGsxf7IiaC12cwhOiJjkDGuhdyQjIWhE1y7NZQgd/WL03TeR 09db139MQWIAkYjF+lSjURkUbstR21+5GO8OwWhjceBVb21azUQy2a2 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: INBOX X-GMAIL-THRID: 1771682196311866186 X-GMAIL-MSGID: 1771682196311866186 Some clocks need to be always-on, but we don't really do anything with them, other than calling enable() once and telling Linux they're enabled. Unregister them to save a couple of bytes and, perhaps more importantly, allow for runtime suspend of the clock controller device, as CLK_IS_CRITICAL prevents the latter. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gcc-sm6375.c | 103 ++++++------------------------------------ 1 file changed, 13 insertions(+), 90 deletions(-) diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c index e94e88bdfb91..14dafea45ac9 100644 --- a/drivers/clk/qcom/gcc-sm6375.c +++ b/drivers/clk/qcom/gcc-sm6375.c @@ -1742,22 +1742,6 @@ static struct clk_branch gcc_cam_throttle_rt_clk = { }, }; -static struct clk_branch gcc_camera_ahb_clk = { - .halt_reg = 0x17008, - .halt_check = BRANCH_HALT_DELAY, - .hwcg_reg = 0x17008, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x17008, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_camera_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_camss_axi_clk = { .halt_reg = 0x58044, .halt_check = BRANCH_HALT, @@ -2308,22 +2292,6 @@ static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = { }, }; -static struct clk_branch gcc_disp_ahb_clk = { - .halt_reg = 0x1700c, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x1700c, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x1700c, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_disp_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_regmap_div gcc_disp_gpll0_clk_src = { .reg = 0x17058, .shift = 0, @@ -2454,22 +2422,6 @@ static struct clk_branch gcc_gp3_clk = { }, }; -static struct clk_branch gcc_gpu_cfg_ahb_clk = { - .halt_reg = 0x36004, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x36004, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x36004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_gpu_cfg_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_gpu_gpll0_clk_src = { .halt_check = BRANCH_HALT_DELAY, .clkr = { @@ -3093,26 +3045,6 @@ static struct clk_branch gcc_sdcc2_apps_clk = { }, }; -static struct clk_branch gcc_sys_noc_cpuss_ahb_clk = { - .halt_reg = 0x2b06c, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x2b06c, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x79004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_sys_noc_cpuss_ahb_clk", - .parent_hws = (const struct clk_hw*[]) { - &gcc_cpuss_ahb_postdiv_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_sys_noc_ufs_phy_axi_clk = { .halt_reg = 0x45098, .halt_check = BRANCH_HALT, @@ -3432,22 +3364,6 @@ static struct clk_branch gcc_venus_ctl_axi_clk = { }, }; -static struct clk_branch gcc_video_ahb_clk = { - .halt_reg = 0x17004, - .halt_check = BRANCH_HALT_DELAY, - .hwcg_reg = 0x17004, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x17004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_video_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_video_axi0_clk = { .halt_reg = 0x1701c, .halt_check = BRANCH_HALT_VOTED, @@ -3614,7 +3530,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, [GCC_CAM_THROTTLE_NRT_CLK] = &gcc_cam_throttle_nrt_clk.clkr, [GCC_CAM_THROTTLE_RT_CLK] = &gcc_cam_throttle_rt_clk.clkr, - [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr, [GCC_CAMSS_AXI_CLK] = &gcc_camss_axi_clk.clkr, [GCC_CAMSS_AXI_CLK_SRC] = &gcc_camss_axi_clk_src.clkr, [GCC_CAMSS_CCI_0_CLK] = &gcc_camss_cci_0_clk.clkr, @@ -3670,7 +3585,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr, [GCC_CPUSS_AHB_CLK_SRC] = &gcc_cpuss_ahb_clk_src.clkr, [GCC_CPUSS_AHB_POSTDIV_CLK_SRC] = &gcc_cpuss_ahb_postdiv_clk_src.clkr, - [GCC_DISP_AHB_CLK] = &gcc_disp_ahb_clk.clkr, [GCC_DISP_GPLL0_CLK_SRC] = &gcc_disp_gpll0_clk_src.clkr, [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr, [GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr, @@ -3682,7 +3596,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr, [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, - [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr, @@ -3738,7 +3651,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr, - [GCC_SYS_NOC_CPUSS_AHB_CLK] = &gcc_sys_noc_cpuss_ahb_clk.clkr, [GCC_SYS_NOC_UFS_PHY_AXI_CLK] = &gcc_sys_noc_ufs_phy_axi_clk.clkr, [GCC_SYS_NOC_USB3_PRIM_AXI_CLK] = &gcc_sys_noc_usb3_prim_axi_clk.clkr, [GCC_UFS_PHY_AHB_CLK] = &gcc_ufs_phy_ahb_clk.clkr, @@ -3765,7 +3677,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_VCODEC0_AXI_CLK] = &gcc_vcodec0_axi_clk.clkr, [GCC_VENUS_AHB_CLK] = &gcc_venus_ahb_clk.clkr, [GCC_VENUS_CTL_AXI_CLK] = &gcc_venus_ctl_axi_clk.clkr, - [GCC_VIDEO_AHB_CLK] = &gcc_video_ahb_clk.clkr, [GCC_VIDEO_AXI0_CLK] = &gcc_video_axi0_clk.clkr, [GCC_VIDEO_THROTTLE_CORE_CLK] = &gcc_video_throttle_core_clk.clkr, [GCC_VIDEO_VCODEC0_SYS_CLK] = &gcc_video_vcodec0_sys_clk.clkr, @@ -3883,11 +3794,23 @@ static int gcc_sm6375_probe(struct platform_device *pdev) /* * Keep the following clocks always on: - * GCC_CAMERA_XO_CLK, GCC_CPUSS_GNOC_CLK, GCC_DISP_XO_CLK + * GCC_CAMERA_XO_CLK + * GCC_CPUSS_GNOC_CLK + * GCC_DISP_XO_CLK + * GCC_CAMERA_AHB_CLK + * GCC_DISP_AHB_CLK + * GCC_GPU_CFG_AHB_CLK + * GCC_SYS_NOC_CPUSS_AHB_CLK + * GCC_VIDEO_AHB_CLK */ qcom_branch_set_clk_en(regmap, 0x17028); qcom_branch_set_clk_en(regmap, 0x2b004); qcom_branch_set_clk_en(regmap, 0x1702c); + qcom_branch_set_clk_en(regmap, 0x17008); + qcom_branch_set_clk_en(regmap, 0x1700c); + qcom_branch_set_clk_en(regmap, 0x36004); + qcom_branch_set_clk_en(regmap, 0x2b06c); + qcom_branch_set_clk_en(regmap, 0x17004); clk_lucid_pll_configure(&gpll10, regmap, &gpll10_config); clk_lucid_pll_configure(&gpll11, regmap, &gpll11_config); From patchwork Mon Jul 17 15:19:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1177110vqt; Mon, 17 Jul 2023 08:20:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlF7+D98OA6oY9b0O1xxLDQmu4mXNGDdWl6Y8Ulg8R5EJaa4GLR2GeBIbTNbntqV/hpiZqw3 X-Received: by 2002:a05:6a00:218c:b0:67b:2eba:bed4 with SMTP id h12-20020a056a00218c00b0067b2ebabed4mr15844844pfi.14.1689607215601; Mon, 17 Jul 2023 08:20:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607215; cv=none; d=google.com; s=arc-20160816; b=TlfytzoL2/TSufeqb60Nnuj0J/hj9mDYeysVXFlO+iNfRZCduO8XyBjgisYtzHjXKF mwz/XkCZRyH/+DdW9TUfwgznF2TPq0E0wHOTLSO9/xc2OS8TyuiGcxNzl55PLQwD/3ez U3TY8nH9zJGxC1s3mKyY1z1MiKO2gJ3IFYQPmYzYXBsbQ++aY7iI/WoLB2n8UCbeh5Rs DN5hQlmpddSJucMIMXIc7MoTpsM8pkggKAmTWiPkPNirobkkSABgKfaAJCVDDNJj6SQn /i8SC7/jl6k6W/b+Og3EGlhon44UC2faf56uEpTjusoDsuTHFh8u/LC5M2ekGJNCSn8B 7iiQ== 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=v5UGzoa3/koIQxPCbuvsSf/gSJDcDpJCJzVPK7lHYGg=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=jYxTNcJrbg7tKC2QP/WLoaehaiF2GEzLa/6/m1eK3NvZuX1U8iqs/o7Ts3rc00b1j/ DPb6ushcWVj0g6DwDfuTskyL+G7ZfrOYhX6P4gbouW+LH9Hxf8h5mZWRv1a7l5gIg6My SS/atKdV7fLwaLpX4dgicO16Fy6pX76uap0cC9fCGzhH7wf/NFxNh7U7FlMEGrmtmI43 VogLnyWiI7CQqyWqrn//BmCpb4DodJe3o2GpSOR2LsgyfuVl6SMDZu5fYLG8rhUvpFUl kxmy8EPNMS67PrzCvBuIFmd3TlBqCIEXOTb4b3vGpAz+HH/ulygAibxi7C//YRlwbke1 KqLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lvVIY5Hn; 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 h190-20020a636cc7000000b0055bc2561b72si11733306pgc.739.2023.07.17.08.20.01; Mon, 17 Jul 2023 08:20:15 -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=lvVIY5Hn; 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 S231560AbjGQPT3 (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231419AbjGQPTW (ORCPT ); Mon, 17 Jul 2023 11:19:22 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E60B10C8 for ; Mon, 17 Jul 2023 08:19:18 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4fbf1f6c771so7448562e87.1 for ; Mon, 17 Jul 2023 08:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607156; x=1692199156; 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=v5UGzoa3/koIQxPCbuvsSf/gSJDcDpJCJzVPK7lHYGg=; b=lvVIY5HnPn775etSZkJURynY2sELYdbHS1aL5KCIr3doLxGDLnqsV3pw6iT8ywcyv7 PXv6Q3CxYOk/JR9hmr4AZwP8LJS1PKxZLfMDtahvpo3yZf3ocFX1E4shgymv645TRCKo IBM2c/D8OEJf6r/WzIWy0VHZAG8Ubm9cCvdF0eXtplWUp8863aHM844dbanbe21l+QNk KU9toeof+Es9vrY2kqbu0trTogO/L69I4Qiss7nPWr5qHSp8GPxFNzzlc6VmWCKsYODr 3UN+B1Smhq1wZWAisUEpXf/YmX3AK42rKdHkPlUiduUKG4UoWKQm8/A1snZ/W8aKezxN 5Svg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607156; x=1692199156; 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=v5UGzoa3/koIQxPCbuvsSf/gSJDcDpJCJzVPK7lHYGg=; b=IsU4QtHepXCj7dc3sYefckYiF5JpUAoUr3OPo4uumymljQNA+gqZqOFxzGx+IG4TSx QttyUF4Wd43E6uq04d+zfqiEVBKlFKBPvH01V0iss/SHqGNgQBTeQEYY/XmCj8om0kQA JNYWECTKtigFOEo+EXfiRbTNQ62CxDtXX9m/9h5lvjOKBIy0q0CZd+ZigaOEG9GvZpsh EgC9Y3x64ednkUZhyKg0fyn9P/sd2GJoBeqb1BqotMC+G2eFk2RbDttEWFvchSo+9wkY 6728CSe4lihbZks9zi9kCcW3u+PTC1w0lzSNCJ3b8jwcsyBP8ZQgh80LrQ+ixBSilcdE mvwQ== X-Gm-Message-State: ABy/qLZOJXOFOh2AVUUVWmogqwL6DmB1l/sqNA94v1PFMjpud1ncrsnM wA/Y36lkPQUa6v6v+hMbItYeVQ== X-Received: by 2002:a05:6512:114e:b0:4f8:56cd:da8c with SMTP id m14-20020a056512114e00b004f856cdda8cmr8589577lfg.34.1689607156634; Mon, 17 Jul 2023 08:19:16 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:16 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:11 +0200 Subject: [PATCH 04/15] clk: qcom: gcc-sm6375: Add runtime PM MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-4-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=1780; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=WXWB5RGonBM5RqpbxW2SMsHOf815i9gADOm2q9pJjmc=; b=pWDCxZlE9tVeTMDDwCA3p9Rrnt12uzwSvlwHXrl1IvLIW1632NI1TETMDnuB+qC3FrRMZgcEF TtvljvXN3azCzTks/QYfkOJ+xYNaQKKqWTAnKYaUWJ/hO2MD6rDpj2Y 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: INBOX X-GMAIL-THRID: 1771681575680081656 X-GMAIL-MSGID: 1771681575680081656 The GCC block on SM6375 is powered by the VDD_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-sm6375.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c index 14dafea45ac9..4b2de545d3f8 100644 --- a/drivers/clk/qcom/gcc-sm6375.c +++ b/drivers/clk/qcom/gcc-sm6375.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -3784,9 +3785,19 @@ static int gcc_sm6375_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_sm6375_desc); - if (IS_ERR(regmap)) + if (IS_ERR(regmap)) { + pm_runtime_put(&pdev->dev); return PTR_ERR(regmap); + } ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks)); if (ret) @@ -3817,7 +3828,10 @@ static int gcc_sm6375_probe(struct platform_device *pdev) clk_lucid_pll_configure(&gpll8, regmap, &gpll8_config); clk_zonda_pll_configure(&gpll9, regmap, &gpll9_config); - return qcom_cc_really_probe(pdev, &gcc_sm6375_desc, regmap); + ret = qcom_cc_really_probe(pdev, &gcc_sm6375_desc, regmap); + pm_runtime_put(&pdev->dev); + + return ret; } static struct platform_driver gcc_sm6375_driver = { From patchwork Mon Jul 17 15:19:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121405 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1182097vqt; Mon, 17 Jul 2023 08:29:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlEC3LAZc+v4NWxosNoIUZ8D5qeqCeBsmQcOpyTFJ723Q8I3bETlEV85FiUzhQlZJjj5rYu1 X-Received: by 2002:a17:906:73cb:b0:982:2586:f85 with SMTP id n11-20020a17090673cb00b0098225860f85mr10056362ejl.65.1689607776038; Mon, 17 Jul 2023 08:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607776; cv=none; d=google.com; s=arc-20160816; b=lyQ/Vk8MRJvHVrx0nYl6UKE/R/+kqgRbsTKB4hApQA4lrllJk35cQJ7lpGV2IWy4Dx NJ3Ub2vh+u3qdb6jDvKhWWFgbOiBc/1dKJaHRn9tZkw69YA2pNBLXMdGy3YFni3yAM0Z sm3nWNKdIRW0NpLU5FRP32aEIc+OCwDL0qSYvtJN5KLL2Shz2svxao9TnvEi+3XGSdfR /GDSNB53DH9ZHBCA9eMk6eanZxt5yVZU3jLrJ4+beWX7giErh6WOUjhYPsBHFDCWDTfU OAPH3ccawRojtC+j5iESoFbUKk1aFDcK17rcUbjsXZ5TKc8Wgz9bX9yIiMGl1nlzEk6H XylA== 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=+KuPxi1C9v4ead/OACB04tCRB3cg6PlY88neux9MKiA=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=XnbYemVyfLOKvX6vQKv4S0LIc3uG2/y3U22eDo9h/9k4Nh5lnXbx6KjnVQ0gljsffB TfEykR9ZVcRtLflhXugR0lO7GTEoLpZyXtPNifdNlOAZ4QHnGGr2LCA0moycaCg8A4Bb /2wYtI46wpIlM33MGMB4zn6sgB8TeIWBlJiDrkal/wZlIRP5MCAzp4bi/zx5QBdt/XWw RpMDTF1skV0NBkBaLHoZV4wGbxsEYKaW4CSkNpBUZMqM6RLn3/YFH8n1y2G7SbV4bxOC zRVLf0kdgNrrB9aDwMKFM4b7n+qBI3CC+tjJMEM83mi8P5GwzeaO3ZdJ1LKiZyH4N5LU aE9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EaOiMiPG; 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 z23-20020a1709064e1700b0098e42bef735si12634430eju.337.2023.07.17.08.29.11; Mon, 17 Jul 2023 08:29:36 -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=EaOiMiPG; 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 S231582AbjGQPTc (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231384AbjGQPTX (ORCPT ); Mon, 17 Jul 2023 11:19:23 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2280C10E7 for ; Mon, 17 Jul 2023 08:19:20 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f9fdb0ef35so7519361e87.0 for ; Mon, 17 Jul 2023 08:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607158; x=1692199158; 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=+KuPxi1C9v4ead/OACB04tCRB3cg6PlY88neux9MKiA=; b=EaOiMiPGl0szt/u6qKnLFCt30b8Wg/W8aK13JrTNCd564obk0rB+4MOCLzhg9DITvo P0XTAcSjbaYOBHVEf3jtvPNZXjHS+IGpqqYv1j1uisTe5w4MjUrjbi5rpsLnv8CsUALb 7bQ12iAMHRV4kBrzpUys58T1VI6yByH6d9SCJDljgVMisP8TPdkZJ7WQUDDyzF1vFcO9 dI0j/NBLen/VqrvWhZwvXt+XG/ZEKeuPSwMxo4AYR+yu/IRA8i8VCMs/2nWk8A0qW12P KgfNZI43plk7LEtSTKUIJ4woWRVTOPDLFgid3ynvEbOdbryAJFCrBxpzICRafZ7rvjPP dFqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607158; x=1692199158; 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=+KuPxi1C9v4ead/OACB04tCRB3cg6PlY88neux9MKiA=; b=MtNFCuSSj2pU+mfn/DgrRwQorjsL/YYTyvQ1jw9GainCUm1vnv77ZkDS5GsWCILffM vTVTDTJDBCLDBm+guRCyz1dRUtYIm+fdjwYP8AUUDqms38zPbZpv3+iVCfgn19WtsICr 1smtZc6TZD/DqU0z8iLuW3hgVwnFDoqLaVfzWtAtu8OMXolkzanqU3WO2t4YzCngyK7F 4SOhU2TZ7tN+gfpEQKCBufYqAxBYraRvrSWng+/VMvW3i58paSUr+49Ob7cCSawWbYsh gmlDSlLcnNJe5vo3tjeyFzF2IHCouIt46R5r2emnIr8reiCA3sp/T6S08h/9QDfPlnJV TP0g== X-Gm-Message-State: ABy/qLZ7wahDUFIXxve9Ox3zm/ZyoWqMHmOFeERS9DDRnws2I+yi8uIG 1/Dmq9ISw7Sb9d3vtXoYEttyCQ== X-Received: by 2002:ac2:548b:0:b0:4f9:72a5:2b76 with SMTP id t11-20020ac2548b000000b004f972a52b76mr7826843lfk.65.1689607158068; Mon, 17 Jul 2023 08:19:18 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:17 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:12 +0200 Subject: [PATCH 05/15] clk: qcom: gpucc-sm6375: Unregister critical clocks MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-5-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=9588; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=qrPiFGkb35Smv+A56ju84eBm0qjbLG5DXe1UpLsgD14=; b=40ig1X5bIzfGx13qAC9tEY/MyfhAPa/1IYBhtQWC94fSClVve1HzxtI5vFtPMFoiS+HUMkpsm +WQzaSk1LAvCMiQ0XbDPTV1GoRKu3CTzr5mj0otBeV8VZXlBAFge8c5 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: INBOX X-GMAIL-THRID: 1771682163129608390 X-GMAIL-MSGID: 1771682163129608390 Some clocks need to be always-on, but we don't really do anything with them, other than calling enable() once and telling Linux they're enabled. Unregister them to save a couple of bytes and, perhaps more importantly, allow for runtime suspend of the clock controller device, as CLK_IS_CRITICAL prevents the latter. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gcc-sm6375.c | 105 ++++++++++++++++++++++++++++++++++------ drivers/clk/qcom/gpucc-sm6375.c | 38 +++------------ 2 files changed, 97 insertions(+), 46 deletions(-) diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c index 4b2de545d3f8..a8eb7a47e284 100644 --- a/drivers/clk/qcom/gcc-sm6375.c +++ b/drivers/clk/qcom/gcc-sm6375.c @@ -1743,6 +1743,21 @@ static struct clk_branch gcc_cam_throttle_rt_clk = { }, }; +static struct clk_branch gcc_camera_ahb_clk = { + .halt_reg = 0x17008, + .halt_check = BRANCH_HALT_DELAY, + .hwcg_reg = 0x17008, + .hwcg_bit = 1, + .clkr = { + .enable_reg = 0x17008, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_camera_ahb_clk", + .ops = &clk_branch2_aon_ops, + }, + }, +}; + static struct clk_branch gcc_camss_axi_clk = { .halt_reg = 0x58044, .halt_check = BRANCH_HALT, @@ -2293,6 +2308,21 @@ static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = { }, }; +static struct clk_branch gcc_disp_ahb_clk = { + .halt_reg = 0x1700c, + .halt_check = BRANCH_HALT_VOTED, + .hwcg_reg = 0x1700c, + .hwcg_bit = 1, + .clkr = { + .enable_reg = 0x1700c, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_disp_ahb_clk", + .ops = &clk_branch2_aon_ops, + }, + }, +}; + static struct clk_regmap_div gcc_disp_gpll0_clk_src = { .reg = 0x17058, .shift = 0, @@ -2423,6 +2453,21 @@ static struct clk_branch gcc_gp3_clk = { }, }; +static struct clk_branch gcc_gpu_cfg_ahb_clk = { + .halt_reg = 0x36004, + .halt_check = BRANCH_HALT_VOTED, + .hwcg_reg = 0x36004, + .hwcg_bit = 1, + .clkr = { + .enable_reg = 0x36004, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_gpu_cfg_ahb_clk", + .ops = &clk_branch2_aon_ops, + }, + }, +}; + static struct clk_branch gcc_gpu_gpll0_clk_src = { .halt_check = BRANCH_HALT_DELAY, .clkr = { @@ -3046,6 +3091,26 @@ static struct clk_branch gcc_sdcc2_apps_clk = { }, }; +static struct clk_branch gcc_sys_noc_cpuss_ahb_clk = { + .halt_reg = 0x2b06c, + .halt_check = BRANCH_HALT_VOTED, + .hwcg_reg = 0x2b06c, + .hwcg_bit = 1, + .clkr = { + .enable_reg = 0x79004, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_sys_noc_cpuss_ahb_clk", + .parent_hws = (const struct clk_hw*[]) { + &gcc_cpuss_ahb_postdiv_clk_src.clkr.hw, + }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_aon_ops, + }, + }, +}; + static struct clk_branch gcc_sys_noc_ufs_phy_axi_clk = { .halt_reg = 0x45098, .halt_check = BRANCH_HALT, @@ -3365,6 +3430,21 @@ static struct clk_branch gcc_venus_ctl_axi_clk = { }, }; +static struct clk_branch gcc_video_ahb_clk = { + .halt_reg = 0x17004, + .halt_check = BRANCH_HALT_DELAY, + .hwcg_reg = 0x17004, + .hwcg_bit = 1, + .clkr = { + .enable_reg = 0x17004, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_video_ahb_clk", + .ops = &clk_branch2_aon_ops, + }, + }, +}; + static struct clk_branch gcc_video_axi0_clk = { .halt_reg = 0x1701c, .halt_check = BRANCH_HALT_VOTED, @@ -3531,6 +3611,7 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, [GCC_CAM_THROTTLE_NRT_CLK] = &gcc_cam_throttle_nrt_clk.clkr, [GCC_CAM_THROTTLE_RT_CLK] = &gcc_cam_throttle_rt_clk.clkr, + [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr, [GCC_CAMSS_AXI_CLK] = &gcc_camss_axi_clk.clkr, [GCC_CAMSS_AXI_CLK_SRC] = &gcc_camss_axi_clk_src.clkr, [GCC_CAMSS_CCI_0_CLK] = &gcc_camss_cci_0_clk.clkr, @@ -3586,6 +3667,7 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr, [GCC_CPUSS_AHB_CLK_SRC] = &gcc_cpuss_ahb_clk_src.clkr, [GCC_CPUSS_AHB_POSTDIV_CLK_SRC] = &gcc_cpuss_ahb_postdiv_clk_src.clkr, + [GCC_DISP_AHB_CLK] = &gcc_disp_ahb_clk.clkr, [GCC_DISP_GPLL0_CLK_SRC] = &gcc_disp_gpll0_clk_src.clkr, [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr, [GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr, @@ -3597,6 +3679,7 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr, [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, + [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr, @@ -3652,6 +3735,7 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr, + [GCC_SYS_NOC_CPUSS_AHB_CLK] = &gcc_sys_noc_cpuss_ahb_clk.clkr, [GCC_SYS_NOC_UFS_PHY_AXI_CLK] = &gcc_sys_noc_ufs_phy_axi_clk.clkr, [GCC_SYS_NOC_USB3_PRIM_AXI_CLK] = &gcc_sys_noc_usb3_prim_axi_clk.clkr, [GCC_UFS_PHY_AHB_CLK] = &gcc_ufs_phy_ahb_clk.clkr, @@ -3678,6 +3762,7 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_VCODEC0_AXI_CLK] = &gcc_vcodec0_axi_clk.clkr, [GCC_VENUS_AHB_CLK] = &gcc_venus_ahb_clk.clkr, [GCC_VENUS_CTL_AXI_CLK] = &gcc_venus_ctl_axi_clk.clkr, + [GCC_VIDEO_AHB_CLK] = &gcc_video_ahb_clk.clkr, [GCC_VIDEO_AXI0_CLK] = &gcc_video_axi0_clk.clkr, [GCC_VIDEO_THROTTLE_CORE_CLK] = &gcc_video_throttle_core_clk.clkr, [GCC_VIDEO_VCODEC0_SYS_CLK] = &gcc_video_vcodec0_sys_clk.clkr, @@ -3805,23 +3890,11 @@ static int gcc_sm6375_probe(struct platform_device *pdev) /* * Keep the following clocks always on: - * GCC_CAMERA_XO_CLK - * GCC_CPUSS_GNOC_CLK - * GCC_DISP_XO_CLK - * GCC_CAMERA_AHB_CLK - * GCC_DISP_AHB_CLK - * GCC_GPU_CFG_AHB_CLK - * GCC_SYS_NOC_CPUSS_AHB_CLK - * GCC_VIDEO_AHB_CLK + * GCC_CAMERA_XO_CLK, GCC_CPUSS_GNOC_CLK, GCC_DISP_XO_CLK */ - qcom_branch_set_clk_en(regmap, 0x17028); - qcom_branch_set_clk_en(regmap, 0x2b004); - qcom_branch_set_clk_en(regmap, 0x1702c); - qcom_branch_set_clk_en(regmap, 0x17008); - qcom_branch_set_clk_en(regmap, 0x1700c); - qcom_branch_set_clk_en(regmap, 0x36004); - qcom_branch_set_clk_en(regmap, 0x2b06c); - qcom_branch_set_clk_en(regmap, 0x17004); + regmap_update_bits(regmap, 0x17028, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x2b004, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x1702c, BIT(0), BIT(0)); clk_lucid_pll_configure(&gpll10, regmap, &gpll10_config); clk_lucid_pll_configure(&gpll11, regmap, &gpll11_config); diff --git a/drivers/clk/qcom/gpucc-sm6375.c b/drivers/clk/qcom/gpucc-sm6375.c index 2d863dc3d83b..d70c6ed0440b 100644 --- a/drivers/clk/qcom/gpucc-sm6375.c +++ b/drivers/clk/qcom/gpucc-sm6375.c @@ -182,20 +182,6 @@ static struct clk_rcg2 gpucc_gx_gfx3d_clk_src = { }, }; -static struct clk_branch gpucc_ahb_clk = { - .halt_reg = 0x1078, - .halt_check = BRANCH_HALT_DELAY, - .clkr = { - .enable_reg = 0x1078, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gpucc_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gpucc_cx_gfx3d_clk = { .halt_reg = 0x10a4, .halt_check = BRANCH_HALT_DELAY, @@ -293,20 +279,6 @@ static struct clk_branch gpucc_cxo_clk = { }, }; -static struct clk_branch gpucc_gx_cxo_clk = { - .halt_reg = 0x1060, - .halt_check = BRANCH_HALT_DELAY, - .clkr = { - .enable_reg = 0x1060, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gpucc_gx_cxo_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gpucc_gx_gfx3d_clk = { .halt_reg = 0x1054, .halt_check = BRANCH_HALT_DELAY, @@ -380,7 +352,6 @@ static struct gdsc gpu_gx_gdsc = { }; static struct clk_regmap *gpucc_sm6375_clocks[] = { - [GPU_CC_AHB_CLK] = &gpucc_ahb_clk.clkr, [GPU_CC_CX_GFX3D_CLK] = &gpucc_cx_gfx3d_clk.clkr, [GPU_CC_CX_GFX3D_SLV_CLK] = &gpucc_cx_gfx3d_slv_clk.clkr, [GPU_CC_CX_GMU_CLK] = &gpucc_cx_gmu_clk.clkr, @@ -388,7 +359,6 @@ static struct clk_regmap *gpucc_sm6375_clocks[] = { [GPU_CC_CXO_AON_CLK] = &gpucc_cxo_aon_clk.clkr, [GPU_CC_CXO_CLK] = &gpucc_cxo_clk.clkr, [GPU_CC_GMU_CLK_SRC] = &gpucc_gmu_clk_src.clkr, - [GPU_CC_GX_CXO_CLK] = &gpucc_gx_cxo_clk.clkr, [GPU_CC_GX_GFX3D_CLK] = &gpucc_gx_gfx3d_clk.clkr, [GPU_CC_GX_GFX3D_CLK_SRC] = &gpucc_gx_gfx3d_clk_src.clkr, [GPU_CC_GX_GMU_CLK] = &gpucc_gx_gmu_clk.clkr, @@ -454,6 +424,14 @@ static int gpucc_sm6375_probe(struct platform_device *pdev) clk_lucid_pll_configure(&gpucc_pll0, regmap, &gpucc_pll0_config); clk_lucid_pll_configure(&gpucc_pll1, regmap, &gpucc_pll1_config); + /* + * Keep clocks always enabled: + * gpucc_ahb_clk + * gpucc_gx_cxo_clk + */ + qcom_branch_set_clk_en(regmap, 0x1078); + qcom_branch_set_clk_en(regmap, 0x1060); + ret = qcom_cc_really_probe(pdev, &gpucc_sm6375_desc, regmap); pm_runtime_put(&pdev->dev); From patchwork Mon Jul 17 15:19:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121413 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1183291vqt; Mon, 17 Jul 2023 08:31:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlH3GpHVBk6UfLbHhn/HTmVvL366mmcQD2Eyrq1IOJJacYY42N6qmbA0797MBAYqaK+WJygQ X-Received: by 2002:a2e:84d7:0:b0:2b6:cca1:975f with SMTP id q23-20020a2e84d7000000b002b6cca1975fmr9009368ljh.13.1689607884203; Mon, 17 Jul 2023 08:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607884; cv=none; d=google.com; s=arc-20160816; b=SMLPZEjt4nu3nXheLLSI/hvboaVNk9fS7kp9y3iCUn6A8xNEBvorhNI2cqA+dCJ2An Lrj/Ct/oMxQMpuNqrKpPt++6pmFnW2XVedOF6ZcKxj6WRkCvJ603Tq6yPt0x1slf1Soo 5ImWY74ZQdEz1+fsrxNyWaJXEbVM2bLfusiDaBfvGKnGiYiswLja+HkICbwhC1NFpGWY 0sNuBYqtT4w7vYwJelYdK5vhfsY9KBbhGRKFnhC+kTirHId6Borwt/LSW4ExbmCAfPwm LVilq9LR/FGiqKQ9wDXvC4hfNBKui+OfTZCqcAqyylCRcrswj44v26S40wL7fieEuCje 5z9g== 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=PL/9liL2QLMSw3GK115iE6vTLgR9G2NI4UgfxPoIK+c=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=nsTGb+MkiJ5vq0nQV45VUB4aSPoadNGRutebgk8aSYj4YdxuDQvP5qd60iBWRuCyyT nBt7yju59Pj2irZGE9ZpmV07KTRIDMraoMRtitM9ZzIzauQAhZEYVc4ourHEM0Z24y1q 7xOthCHJxRiAETTB3O05wkH6Ew5FmsZSXmKXzBEuXUF5udmrM7EWzhzX8VjzIHU/N2dc ame/FNgkYQoG+zBs11ghd9EJflKm7u60fLjW3fJcBdFeedpHxCJ/9WJNabUgEXDZeDrg tWgEXsf5WdpcRySrFBeRfHq9jqAiWjpbzD6pYcjwJBJeDD03Woy/aHYU9BRIm45MnYk+ O8Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AtlVVnOE; 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 cf13-20020a170906b2cd00b0098e4aef078esi5635502ejb.778.2023.07.17.08.30.59; Mon, 17 Jul 2023 08:31: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=AtlVVnOE; 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 S231349AbjGQPTi (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbjGQPTY (ORCPT ); Mon, 17 Jul 2023 11:19:24 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B9481701 for ; Mon, 17 Jul 2023 08:19:21 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4fb9ae4cef6so7388040e87.3 for ; Mon, 17 Jul 2023 08:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607160; x=1692199160; 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=PL/9liL2QLMSw3GK115iE6vTLgR9G2NI4UgfxPoIK+c=; b=AtlVVnOEMmn9rMMAu1Hmx8QD9ZwSUa7aRvgFSEpExRjuuDiQLgUSKsViwzr0HW89NX vOQY+GGq3XB46nrcemgvEe1REFnFsseuOEVDtA1VYbC8p2AyEwZyoZ0Za1Cg5Vqs3zcb UyYZGnJNdezEytqN3LKmm9JLe5iCcmHCSJQJ8S0ElnANnnlgn2fOsZ0DHQHh5tn8Mq3G +XHNMLO/jFMAuZEQ09Fb1/leEBgHP/+k6xCrI5iKHSiYB86rm7vEdxx6Nq5iIwLqXiC9 ZZ8kGuPIs/si+4uXhvJ69G33GhhV7OPyzgWgjvtaIEqYOwIlDtD2mxIIQzVRPH6fcmoj HbMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607160; x=1692199160; 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=PL/9liL2QLMSw3GK115iE6vTLgR9G2NI4UgfxPoIK+c=; b=K7fwdA6DdvyZZ/2c0jyJ1DN7/DyMxVWuykhbgsswMlZAQBX3DnMnH/vnhT2Mr1T596 5wKjKrW9qgBGI56Anf00b8RSnOMbVzdwokPoj+aZYBEEJpqbX1bZPpeJf8bXeMJhDqBv RQ+kXNcJxkevfKqpD86h1NhF6B7pmnIq0o0CCF8W00AjmYdcqxtFoKsh4B2wBrVzvKL7 f5K8AfSkCIdiWL0VX8+LJmvWkPs4bkUIYC2COEz4njh5icCvH1tq8s17ZGObRfD6Kg7p 99E8Czpi3G9892hyAZs+0v7A/TSVtDk9kuQ5XCMbQHndluCxZdZ5Dq0ka/mfDMrebENB 7RLg== X-Gm-Message-State: ABy/qLZ+Hvy5beMeskRuPUssNknb/vlKqQ9n7pNyoMOT+9jhMXf27zTL xSKJ21wz5aIq1U64d4Legtbltg== X-Received: by 2002:a19:915e:0:b0:4fb:744e:17db with SMTP id y30-20020a19915e000000b004fb744e17dbmr7841352lfj.1.1689607159904; Mon, 17 Jul 2023 08:19:19 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:19 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:13 +0200 Subject: [PATCH 06/15] clk: qcom: gpucc-sm6115: Unregister critical clocks MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-6-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=3009; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=gGAKlFsEiMqa1it7eUHKXDQHPq4ci/PWNufQygBA064=; b=aGgzTFz/dux49UIL4Jba0PLcD4jT5zrtFO320nx1kJrqM0u124ZO9trfZoW4Ic9nu+bC+g8MJ 0Lg0yit19gxClVTvBBAspBNpX+ssuJRvr3X6EAWQ2c7PY29OXaagFGJ 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: INBOX X-GMAIL-THRID: 1771682276869598742 X-GMAIL-MSGID: 1771682276869598742 Some clocks need to be always-on, but we don't really do anything with them, other than calling enable() once and telling Linux they're enabled. Unregister them to save a couple of bytes and, perhaps more importantly, allow for runtime suspend of the clock controller device, as CLK_IS_CRITICAL prevents the latter. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gpucc-sm6115.c | 38 ++++++++------------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/drivers/clk/qcom/gpucc-sm6115.c b/drivers/clk/qcom/gpucc-sm6115.c index c84727e8352d..ac048f7973d0 100644 --- a/drivers/clk/qcom/gpucc-sm6115.c +++ b/drivers/clk/qcom/gpucc-sm6115.c @@ -233,20 +233,6 @@ static struct clk_rcg2 gpu_cc_gx_gfx3d_clk_src = { }, }; -static struct clk_branch gpu_cc_ahb_clk = { - .halt_reg = 0x1078, - .halt_check = BRANCH_HALT_DELAY, - .clkr = { - .enable_reg = 0x1078, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gpu_cc_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gpu_cc_crc_ahb_clk = { .halt_reg = 0x107c, .halt_check = BRANCH_HALT_DELAY, @@ -335,20 +321,6 @@ static struct clk_branch gpu_cc_cxo_clk = { }, }; -static struct clk_branch gpu_cc_gx_cxo_clk = { - .halt_reg = 0x1060, - .halt_check = BRANCH_HALT_DELAY, - .clkr = { - .enable_reg = 0x1060, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gpu_cc_gx_cxo_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gpu_cc_gx_gfx3d_clk = { .halt_reg = 0x1054, .halt_check = BRANCH_HALT_SKIP, @@ -417,7 +389,6 @@ static struct gdsc gpu_gx_gdsc = { }; static struct clk_regmap *gpu_cc_sm6115_clocks[] = { - [GPU_CC_AHB_CLK] = &gpu_cc_ahb_clk.clkr, [GPU_CC_CRC_AHB_CLK] = &gpu_cc_crc_ahb_clk.clkr, [GPU_CC_CX_GFX3D_CLK] = &gpu_cc_cx_gfx3d_clk.clkr, [GPU_CC_CX_GMU_CLK] = &gpu_cc_cx_gmu_clk.clkr, @@ -425,7 +396,6 @@ static struct clk_regmap *gpu_cc_sm6115_clocks[] = { [GPU_CC_CXO_AON_CLK] = &gpu_cc_cxo_aon_clk.clkr, [GPU_CC_CXO_CLK] = &gpu_cc_cxo_clk.clkr, [GPU_CC_GMU_CLK_SRC] = &gpu_cc_gmu_clk_src.clkr, - [GPU_CC_GX_CXO_CLK] = &gpu_cc_gx_cxo_clk.clkr, [GPU_CC_GX_GFX3D_CLK] = &gpu_cc_gx_gfx3d_clk.clkr, [GPU_CC_GX_GFX3D_CLK_SRC] = &gpu_cc_gx_gfx3d_clk_src.clkr, [GPU_CC_PLL0] = &gpu_cc_pll0.clkr, @@ -487,6 +457,14 @@ static int gpu_cc_sm6115_probe(struct platform_device *pdev) qcom_branch_set_force_mem_core(regmap, gpu_cc_gx_gfx3d_clk, true); qcom_branch_set_force_periph_on(regmap, gpu_cc_gx_gfx3d_clk, true); + /* + * Keep clocks always enabled: + * gpu_cc_ahb_clk + * gpu_cc_gx_cxo_clk + */ + qcom_branch_set_clk_en(regmap, 0x1078); + qcom_branch_set_clk_en(regmap, 0x1060); + return qcom_cc_really_probe(pdev, &gpu_cc_sm6115_desc, regmap); } From patchwork Mon Jul 17 15:19:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121398 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1180229vqt; Mon, 17 Jul 2023 08:26:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlFVNdG5fmSveapBNeVxsmTOsykRTFiNcm5UUb9IfULf5yaIzm2XN6vEJomgf92so8TY2Cou X-Received: by 2002:aa7:88d3:0:b0:64d:46b2:9a58 with SMTP id k19-20020aa788d3000000b0064d46b29a58mr12723559pff.26.1689607568864; Mon, 17 Jul 2023 08:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607568; cv=none; d=google.com; s=arc-20160816; b=KWxX3mOpLkoqtjFvU/Jqns67+MGTQZhnG2iyNX0CJAyXW/bWSKQTHcuMyEnh8D+vjj ciZ+DHYgeg+uldUFTwL3+H4IqQ7kbsqGN6jZyNAMkyXfVGbIKUySsxOF4TNVlRyH1quD nXaYHMZhY0tn8XinGWUKXhuX1dtn3yUgKtjTPLIwNtGpSLY/8KT5Z/3HVhaf0ugEPNoA e4LeFupr4pVWbgiOGuEjKgpW4v5owCCV6E2ojGOEh0Vs+e4HfeEw3NuSj0/266S78odG BSW8k1CUwL3gyjnguHRh8mbULGnUO15BbaK0IpkKjMK0nZDpGw1TY4VB0HjxYJShcArg 51Xg== 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=aMKrJ+Fk4SISACAyctqyw3SjO2t5kFSsy8Yfv02loX8=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=HyUxCADz5tTnwIKy6bXDzwORV1MmFnHc45mvIVjwT2Ht2h8CnxpdUr2WCIytALpK/Z QR6KgWYKMMbLqZW0nOIpLXn3iibRg8o/zN46SZEgVynDr12tOZDi2sKQHu5jq4fIZtgN 58ftJiPjtsd8D1Za7O5g/zXtUdDiVMkcecQk1Ey0xzut1s7aB1ZmOecp1mRjmvCcxV2/ HjIKhqQoxuVecdinPqHbq+2VvAl4/kBn+HPFgHSRsreyJDMRNMo3BuAF5AutaBp3BozT YwCZW3MvoouhsYfIgM5iFDP2vP35zh8N3/uMlUoTjA4XoeLLU4hKC9QuPkl73gbmRuwS bxeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RqxDhYpf; 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 r5-20020a632045000000b0053ee9b21820si6879051pgm.72.2023.07.17.08.25.55; Mon, 17 Jul 2023 08:26:08 -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=RqxDhYpf; 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 S231570AbjGQPTl (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231411AbjGQPT1 (ORCPT ); Mon, 17 Jul 2023 11:19:27 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24D911705 for ; Mon, 17 Jul 2023 08:19:23 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4fb7373dd35so7224209e87.1 for ; Mon, 17 Jul 2023 08:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607161; x=1692199161; 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=aMKrJ+Fk4SISACAyctqyw3SjO2t5kFSsy8Yfv02loX8=; b=RqxDhYpfvoCzAEVPA/XfFz4Yj2XoYRbXw/ikb6oRAJHAyu97uTgSQM+m3cnHotVkO8 qkfIVfY88p8BmuR4kk3RSnzmLcST8kGoob5ONg+DEirIzzvIYiR+CISYz4FlQY8Nx8wN 3XBeuAVwuiwkfH6QXZWCxvLi/60axTtaz16ocDpHicCCES9GxuBsdgraVrR6R0BzANTR QuRRA6Ym7XQyiTjCLG1u1p1MgtDC/XLY9w2X5xISHCohx12qDUyN6//sQoHBinCcQ+W2 9Jec7/j8sJ0uH0UQK/IXhlwjiTNJcGmC9yY+H7baPIJazLWOTcna7nk5XI9q9+AcPu51 yOow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607161; x=1692199161; 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=aMKrJ+Fk4SISACAyctqyw3SjO2t5kFSsy8Yfv02loX8=; b=fw5nIxKLa875vRAdw04C4JxIaRJWMr2hV3hM2jX6LyEpfsfTox73rjulr3NYbiPrT/ JWHg1x8WAVlYaksAGKgzm3pfTRHVRXU7byvDkXb0LmCQpb7uORLwD5PUiyvZZ5m6j4hx O+i+H1dWC3MoJc0iz3RY5oc/NV4aAjMwA/aMrleQm9b4WsEawABhL0LrcKJpOPRot8H5 yGbFyHXa4RZuf7qUEBUo3KrUVYr3djyzjrnAnT7KvM9tM81lBt4/tOZo0iTwAuWgrxD+ 5vMDutVvqsxk0wLebfH+r623eOIUltz9+GyiwYx786sKPV1J4YnyOghPQwVj9QiKhZXb 4cUg== X-Gm-Message-State: ABy/qLZmNRcjMF9vejXmvZnEzD+GimGs7uF9Ey82kMHhwCLJJbfOxWs/ 2ysAnUqMlbwCAQzI3oVBzOLB2A== X-Received: by 2002:a19:650f:0:b0:4fb:8938:48ab with SMTP id z15-20020a19650f000000b004fb893848abmr3518295lfb.16.1689607161341; Mon, 17 Jul 2023 08:19:21 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:20 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:14 +0200 Subject: [PATCH 07/15] clk: qcom: gpucc-sm6115: Add runtime PM MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-7-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=1880; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=o/nBQFsy6m0Ejq8unCaPVPl+lPMZHWnHPCCx0UDdlsM=; b=6zENJRt1rnQwS88lMzbUfG17CjAcgwstRaXd3IyR0lKxmh6OaPAnukiieoNDlxIsTo7z2zi1s xIgjDV6A7OEDC2l4rappuf9sWVqtBlURpfgAH5TdeStkzgLuFos71Pu 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: INBOX X-GMAIL-THRID: 1771681945892189095 X-GMAIL-MSGID: 1771681945892189095 The GPU_CC block on SM6115 is powered by the VDD_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/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 ac048f7973d0..6fb84492d292 100644 --- a/drivers/clk/qcom/gpucc-sm6115.c +++ b/drivers/clk/qcom/gpucc-sm6115.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -442,10 +443,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); @@ -465,7 +477,10 @@ static int gpu_cc_sm6115_probe(struct platform_device *pdev) qcom_branch_set_clk_en(regmap, 0x1078); qcom_branch_set_clk_en(regmap, 0x1060); - 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 = { From patchwork Mon Jul 17 15:19:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121395 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1179273vqt; Mon, 17 Jul 2023 08:24:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlFyZEykTtsyeMdHZtiRWZ1a9jbBhrcaEcIHkq4Ppg4SO6yR/79SlocS6/K6Gf3O3PP166MS X-Received: by 2002:a05:6a00:b4c:b0:675:8f71:28ee with SMTP id p12-20020a056a000b4c00b006758f7128eemr16091056pfo.34.1689607457431; Mon, 17 Jul 2023 08:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607457; cv=none; d=google.com; s=arc-20160816; b=KoOzlMObLKBahOE2Xe0jXVK70aY51UD8ABzsZmtpW13NcYJ5wI3+xkwbV8zD1IdYwZ zQY+IVDDVaod6XhtGrtyiW5axvDdaUKO02byVgllgs5jq0t34BZ8uvzsTkQZD3GGQ7ET ptVJigebPD3qgxi6+Kth32qsDMm1w9Ly9c/IK/b51hHeqo8rloCg23AeLIXeveSJ99P6 mzPGH0NOLyt9f/aPF+95zXw0LBZUH/+F+VLnxyHaKTVP70IPvopVzNnSkqykewdlCtLz 6gsk8m1SJS6a+AwF3qXNKIUsGVtWtCdPO+pASAKVUIMzR5xn/lLgf+K5/7T7OFstrndF 7owA== 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=E9bzAyxEmZcjuCgWaxCe1scGgqcWcCc2saD7jQbkp1s=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=ZtP5bIcICi2j7hydkFQwr6XQKwu2XP3aK4V4uIlFLTO+YA5xrDwyVH7fxcQz2z/M+T zA4QBi6tc5MrvwBtLdyU5PA5/J/flD794LQsypWc7GpIQ0+nsLK/ZTNtZIxSkDtZKjHu iSi7OZQH9ufdWq5Y8lWFpDrxbdt+ILnakyeYnj2pgsaDgvmCvzy4wknQOwCa4l4/l/PF 0imU10ixEZmX9KaSdVBLhSvaGNsBEGfx8kqCxI9MhsQ5ZYIPSMKZ8iq0Zjb2mDqRjBnN 01Q5N4UnTgExEkWq/yONGVaFFzrSPFlfDoXA/KUxGhVmgi/6CXke1oSBqpWlU/8iyaOz LbWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vT5vpiki; 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 fi40-20020a056a0039a800b006824a5ca9a6si6864625pfb.35.2023.07.17.08.24.04; Mon, 17 Jul 2023 08:24:17 -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=vT5vpiki; 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 S231755AbjGQPTq (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231552AbjGQPT3 (ORCPT ); Mon, 17 Jul 2023 11:19:29 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2A75BD for ; Mon, 17 Jul 2023 08:19:24 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4fb761efa7aso7289185e87.0 for ; Mon, 17 Jul 2023 08:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607162; x=1692199162; 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=E9bzAyxEmZcjuCgWaxCe1scGgqcWcCc2saD7jQbkp1s=; b=vT5vpikihNkMJKaZ/Qf6szhp3xNMEA4DwQ6u06WwTwuPK7dKC7kQJwAii06wK7TNKS XLF6hdPM0V7qNOM1A7+iXyNi01G9cPKcjb9zx5oC71o+dF+gh+yfm9EV7cV2IpGyyd7Q aue+eCvd/GaLRITjAJhJRqqIXE9sQHejGU5OdINb37UV3Z/vgAXa4NBeH+jXB5ZMve5f XAFQIbc6akIiZBwhf/BjSXlmR9rzv8G9Rlry2Ypfgeud8Oi7LrDrPWZNiQKKo+vVEzpe KJmoW7Z1AdITQrCgbXULFCk4FQFcUaI6g3oUa7K2e5MZFMncTHPGtswaWdXVKFPBEXtn /q7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607162; x=1692199162; 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=E9bzAyxEmZcjuCgWaxCe1scGgqcWcCc2saD7jQbkp1s=; b=GvXjW5SDTU9DlfHZ8iXNJgqMyV+Ab3U0/dG50rsoMXEVFoUYY0YQBG+GY5DV3Z2WbS BCDzWxAnz2WOEoqFoot7YQbWVusZdxzL1f7z6CLOtD2LjkVieJq+nsxhEqDo9Eu9GsZt ZPEA23L6YuEXliB0cArqkNcQoS1yOHhVEpS+uRFMKmWzL+vfACrBKulRu4Nr2bqq/QM1 DMhUl+1hMop7AA5dw+pxz3TsWvF9x0tKFcwBC9FNgs92+PJsZ8bgI4fTJ4Ut3SztVwdS 3/PfcX3mZWwo2dQ9+eULJn2CgwKSWJb/nzECl77Pu34K2aDoWrCL4+PTWFdqoP+OfUI5 rlTQ== X-Gm-Message-State: ABy/qLbDTEGhfin7L9tC3j56jTPuNc5Wt+qOit1a2BUhYo6+fWVFnMtu 7RcJ8iSdJHdoulI270mD/HN4dg== X-Received: by 2002:a05:6512:348b:b0:4fb:8616:7a03 with SMTP id v11-20020a056512348b00b004fb86167a03mr7426349lfr.4.1689607162748; Mon, 17 Jul 2023 08:19:22 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:22 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:15 +0200 Subject: [PATCH 08/15] clk: qcom: gcc-sm6115: Unregister critical clocks MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-8-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=7208; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Aprdi0pZJRcBcTqfoFWAZFZktiahphM2R1wPtOeWO3k=; b=YtWCtGmXdJsmjCmRwxfGg668SV4dORifui04NPqdj8pEemuT9pVl8Oi2UM+iAzXxEyZc3e0pY 9gEbb12MF3KAL+mxHS9JvdtTwH8s1g9gGR6pAmBAH+o+0DENyIsnvc+ 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: INBOX X-GMAIL-THRID: 1771681829318581069 X-GMAIL-MSGID: 1771681829318581069 Some clocks need to be always-on, but we don't really do anything with them, other than calling enable() once and telling Linux they're enabled. Unregister them to save a couple of bytes and, perhaps more importantly, allow for runtime suspend of the clock controller device, as CLK_IS_CRITICAL prevents the latter. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gcc-sm6115.c | 133 ++++++------------------------------------ 1 file changed, 18 insertions(+), 115 deletions(-) diff --git a/drivers/clk/qcom/gcc-sm6115.c b/drivers/clk/qcom/gcc-sm6115.c index 033e308ff865..1b6016e7ddeb 100644 --- a/drivers/clk/qcom/gcc-sm6115.c +++ b/drivers/clk/qcom/gcc-sm6115.c @@ -1585,36 +1585,6 @@ static struct clk_branch gcc_cam_throttle_rt_clk = { }, }; -static struct clk_branch gcc_camera_ahb_clk = { - .halt_reg = 0x17008, - .halt_check = BRANCH_HALT_DELAY, - .hwcg_reg = 0x17008, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x17008, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_camera_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch gcc_camera_xo_clk = { - .halt_reg = 0x17028, - .halt_check = BRANCH_HALT, - .clkr = { - .enable_reg = 0x17028, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_camera_xo_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_camss_axi_clk = { .halt_reg = 0x58044, .halt_check = BRANCH_HALT, @@ -2123,38 +2093,6 @@ static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = { }, }; -static struct clk_branch gcc_cpuss_gnoc_clk = { - .halt_reg = 0x2b004, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x2b004, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x79004, - .enable_mask = BIT(22), - .hw.init = &(struct clk_init_data){ - .name = "gcc_cpuss_gnoc_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch gcc_disp_ahb_clk = { - .halt_reg = 0x1700c, - .halt_check = BRANCH_HALT, - .hwcg_reg = 0x1700c, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x1700c, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_disp_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_regmap_div gcc_disp_gpll0_clk_src = { .reg = 0x17058, .shift = 0, @@ -2214,20 +2152,6 @@ static struct clk_branch gcc_disp_throttle_core_clk = { }, }; -static struct clk_branch gcc_disp_xo_clk = { - .halt_reg = 0x1702c, - .halt_check = BRANCH_HALT, - .clkr = { - .enable_reg = 0x1702c, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_disp_xo_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_gp1_clk = { .halt_reg = 0x4d000, .halt_check = BRANCH_HALT, @@ -2282,22 +2206,6 @@ static struct clk_branch gcc_gp3_clk = { }, }; -static struct clk_branch gcc_gpu_cfg_ahb_clk = { - .halt_reg = 0x36004, - .halt_check = BRANCH_HALT, - .hwcg_reg = 0x36004, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x36004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_gpu_cfg_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_gpu_gpll0_clk_src = { .halt_check = BRANCH_HALT_DELAY, .clkr = { @@ -2770,22 +2678,6 @@ static struct clk_branch gcc_sdcc2_apps_clk = { }, }; -static struct clk_branch gcc_sys_noc_cpuss_ahb_clk = { - .halt_reg = 0x2b06c, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x2b06c, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x79004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_sys_noc_cpuss_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_sys_noc_ufs_phy_axi_clk = { .halt_reg = 0x45098, .halt_check = BRANCH_HALT, @@ -3271,8 +3163,6 @@ static struct clk_regmap *gcc_sm6115_clocks[] = { [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, [GCC_CAM_THROTTLE_NRT_CLK] = &gcc_cam_throttle_nrt_clk.clkr, [GCC_CAM_THROTTLE_RT_CLK] = &gcc_cam_throttle_rt_clk.clkr, - [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr, - [GCC_CAMERA_XO_CLK] = &gcc_camera_xo_clk.clkr, [GCC_CAMSS_AXI_CLK] = &gcc_camss_axi_clk.clkr, [GCC_CAMSS_AXI_CLK_SRC] = &gcc_camss_axi_clk_src.clkr, [GCC_CAMSS_CAMNOC_ATB_CLK] = &gcc_camss_camnoc_atb_clk.clkr, @@ -3321,20 +3211,16 @@ static struct clk_regmap *gcc_sm6115_clocks[] = { [GCC_CAMSS_TOP_AHB_CLK] = &gcc_camss_top_ahb_clk.clkr, [GCC_CAMSS_TOP_AHB_CLK_SRC] = &gcc_camss_top_ahb_clk_src.clkr, [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr, - [GCC_CPUSS_GNOC_CLK] = &gcc_cpuss_gnoc_clk.clkr, - [GCC_DISP_AHB_CLK] = &gcc_disp_ahb_clk.clkr, [GCC_DISP_GPLL0_CLK_SRC] = &gcc_disp_gpll0_clk_src.clkr, [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr, [GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr, [GCC_DISP_THROTTLE_CORE_CLK] = &gcc_disp_throttle_core_clk.clkr, - [GCC_DISP_XO_CLK] = &gcc_disp_xo_clk.clkr, [GCC_GP1_CLK] = &gcc_gp1_clk.clkr, [GCC_GP1_CLK_SRC] = &gcc_gp1_clk_src.clkr, [GCC_GP2_CLK] = &gcc_gp2_clk.clkr, [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr, [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, - [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, [GCC_GPU_IREF_CLK] = &gcc_gpu_iref_clk.clkr, @@ -3375,7 +3261,6 @@ static struct clk_regmap *gcc_sm6115_clocks[] = { [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr, - [GCC_SYS_NOC_CPUSS_AHB_CLK] = &gcc_sys_noc_cpuss_ahb_clk.clkr, [GCC_SYS_NOC_UFS_PHY_AXI_CLK] = &gcc_sys_noc_ufs_phy_axi_clk.clkr, [GCC_SYS_NOC_USB3_PRIM_AXI_CLK] = &gcc_sys_noc_usb3_prim_axi_clk.clkr, [GCC_UFS_CLKREF_CLK] = &gcc_ufs_clkref_clk.clkr, @@ -3512,6 +3397,24 @@ static int gcc_sm6115_probe(struct platform_device *pdev) clk_alpha_pll_configure(&gpll10, regmap, &gpll10_config); clk_alpha_pll_configure(&gpll11, regmap, &gpll11_config); + /* + * Keep the following clocks always on: + * GCC_CAMERA_AHB_CLK + * GCC_CAMERA_XO_CLK + * GCC_CPUSS_GNOC_CLK + * GCC_DISP_AHB_CLK + * GCC_DISP_XO_CLK + * GCC_GPU_CFG_AHB_CLK + * GCC_SYS_NOC_CPUSS_AHB_CLK + */ + qcom_branch_set_clk_en(regmap, 0x17008); + qcom_branch_set_clk_en(regmap, 0x17028); + qcom_branch_set_clk_en(regmap, 0x2b004); + qcom_branch_set_clk_en(regmap, 0x1700c); + qcom_branch_set_clk_en(regmap, 0x1702c); + qcom_branch_set_clk_en(regmap, 0x36004); + qcom_branch_set_clk_en(regmap, 0x2b06c); + return qcom_cc_really_probe(pdev, &gcc_sm6115_desc, regmap); } From patchwork Mon Jul 17 15:19:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121412 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1183168vqt; Mon, 17 Jul 2023 08:31:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlFjpfScze9AWZQcR/YPNDHnBtoETloj8FiizaNiedNY2aAc8+bMsu7bylnoFeyFZAYdD1rc X-Received: by 2002:a05:6512:344a:b0:4fb:ca59:42d7 with SMTP id j10-20020a056512344a00b004fbca5942d7mr7879046lfr.33.1689607875312; Mon, 17 Jul 2023 08:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607875; cv=none; d=google.com; s=arc-20160816; b=AtCUr/KW9rP8xxygANxY44yMsH14e0ldBd27QCfZ2nKrtrEb1aC5lb5h8crOanW/PQ Y6ki5Zi2tnPULdcuy6Cfn/s/S1DFZl2d8MWy353Ojgv8psL5WebmCTEFA3pQgvAafwXB hyFmdbN/6hVbIOTBg4d9xIafreeqiipXeo/2bcHYoFL5lOW15NE7OLEUxcZntBjUhpPf 1BR3l6kpNFyB1ENYz66SrRJ6hNZKEjLfD/X/b/ballztViv7Q4Pu+uMGRClxIKYJW/MS cg0T5Ua5YimLQxQw6v8IUtJYWvm2YNIPP+GIwriDW6RscJqGnfgp7NGKJLpUZ4LyvHao WoCw== 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=WE5v23OlD5LJtk2p6O/kwniXhCkm0INjdGCu2aq7Yhw=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=T47G+F/cby+yEVuyQqK5NOYNcXaZzv1NFU2QDvk3suA6PQJazIIgpoXpldNhwX3OWO oNjOc//gDehP1xhDYi3GutOmYexmEWhmKveqLw71PQIhiXJTmZwBML6n7/p+w9ZagWJ4 7zqiFf2CEhbfjSS8rpiorBomia85baBrK8n8tO1qd0JN3B3Za3SSxJzJtGiCIbqPc7c/ rJv+8Ith65Pg2UgSTim6WH4lBMQmylQzGuwNOxhp9innc0dHMd3m6xtmTUVYvFexdnJp A64qmfUg1K76FC9iCNSdAEtqwso1gagOwiRuT9zAt80j2ecFRGQxRMlBUotittJMI22w 9SMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2RsrZiK; 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 f24-20020a05640214d800b0051be9317ccasi14023399edx.508.2023.07.17.08.30.49; Mon, 17 Jul 2023 08:31:15 -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=K2RsrZiK; 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 S231416AbjGQPT6 (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbjGQPTg (ORCPT ); Mon, 17 Jul 2023 11:19:36 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0AB410E3 for ; Mon, 17 Jul 2023 08:19:25 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4fb863edcb6so7472934e87.0 for ; Mon, 17 Jul 2023 08:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607164; x=1692199164; 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=WE5v23OlD5LJtk2p6O/kwniXhCkm0INjdGCu2aq7Yhw=; b=K2RsrZiK6ywueOF8zudyG+3JPdxj2VzooeydrEYDhn6MH3y2AzQgPEOv7wJ04lLjs9 cUt6wh24LZmLfEwZN94lrzri2sEkYSe6/p25EjiUbs2tlvVcwW0CS3t+bQ8N3Pbx6x6I TnKo/E1Nta9LtaRi4d5hL9Vn8f5SUfuNpfz33wpqgdILWq5u0XXxmyHI2oZ9BhmnABg+ Ew9TA0c/OSv/0tGXLusZnDMoSZQc8z+gqWPEPqDBoqdQpDeKkY4hqqCn9d99CVfmEI/F aPingDL8a5o/OKd9W+x5JWU8iePt87NZBqyQWrHffKd04jMvwT0PeMZk7cG7EWSdc0RS yQCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607164; x=1692199164; 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=WE5v23OlD5LJtk2p6O/kwniXhCkm0INjdGCu2aq7Yhw=; b=URwMEqSUN5HjmRfC/Dz68cPjwCa89d5D7KsAosLa/Y86KpdeZLY0TPR7F4sZN4hwEX st/GljbNol8LqP8sfllrjImvpOBkTNojQ5ees1CejOh1kdIuvHxu2jseoblj0UAHxPB+ XO/zS11Y7D/Y8+FBor8wFPQqMeuZ5qV4UIRVBPsBbySKbumb+lK5ovImSCtnV0WrPnGZ ekzp0ZQ8lPAs0RUq2582sdCbraMR9QEfBZaHaiK7LUrhE+Txu4BV9otLaGUlfjQ+132q IZo1CMtkfmSfN2ZNpR1eropDtZsIXeYGLV++vmlzzx5V2brXd2CHgWmaLd4KTJNwUn0W rKdA== X-Gm-Message-State: ABy/qLbpbXMjWsPXYKmx6kBYaG1Cft1SjHTF+r82lOwO9dv2t/+LTh1I Q9sNdBMXJuIhBiZ8mB48ggkeeQ== X-Received: by 2002:ac2:4bd0:0:b0:4fd:c0dd:d54b with SMTP id o16-20020ac24bd0000000b004fdc0ddd54bmr2124537lfq.65.1689607164166; Mon, 17 Jul 2023 08:19:24 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:23 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:16 +0200 Subject: [PATCH 09/15] clk: qcom: gcc-sm6115: Add runtime PM MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-9-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=1944; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=lXR6hOkSuPWCLG8Y1XTv1XtQPJ6qFUCSZCtX0olhcqk=; b=DQYrdPNp19ItZkKR9xWvUUJTORbiBfixcO8AHbrs211Ztx4OFUykP8yb7igKdKVAa5/WLFnmo qw6yMvFLjcWCmwnUwF5TEtWfHufk7HvsdnuJvf5ryqyOpsGjqyupVfF 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: INBOX X-GMAIL-THRID: 1771682267269362596 X-GMAIL-MSGID: 1771682267269362596 The GCC block on SM6115 is mostly powered by the VDD_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-sm6115.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/gcc-sm6115.c b/drivers/clk/qcom/gcc-sm6115.c index 1b6016e7ddeb..7f1e278c63c0 100644 --- a/drivers/clk/qcom/gcc-sm6115.c +++ b/drivers/clk/qcom/gcc-sm6115.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -3383,14 +3384,26 @@ static int gcc_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, &gcc_sm6115_desc); - if (IS_ERR(regmap)) + if (IS_ERR(regmap)) { + pm_runtime_put(&pdev->dev); return PTR_ERR(regmap); + } ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks)); - if (ret) + if (ret) { + pm_runtime_put(&pdev->dev); return ret; + } clk_alpha_pll_configure(&gpll8, regmap, &gpll8_config); clk_alpha_pll_configure(&gpll9, regmap, &gpll9_config); @@ -3415,7 +3428,10 @@ static int gcc_sm6115_probe(struct platform_device *pdev) qcom_branch_set_clk_en(regmap, 0x36004); qcom_branch_set_clk_en(regmap, 0x2b06c); - return qcom_cc_really_probe(pdev, &gcc_sm6115_desc, regmap); + ret = qcom_cc_really_probe(pdev, &gcc_sm6115_desc, regmap); + pm_runtime_put(&pdev->dev); + + return ret; } static struct platform_driver gcc_sm6115_driver = { From patchwork Mon Jul 17 15:19: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: 121416 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1185772vqt; Mon, 17 Jul 2023 08:35:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlEukMbAJeNdwhUawBiSmRx5iwQ02cGMbLXnijEHpnLMJwDfDY1M9SLRFKXO5gVIQfNG0ZG/ X-Received: by 2002:aa7:c986:0:b0:521:6d39:7e45 with SMTP id c6-20020aa7c986000000b005216d397e45mr7400469edt.31.1689608134447; Mon, 17 Jul 2023 08:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689608134; cv=none; d=google.com; s=arc-20160816; b=SW3+Z60We9gI4+ig5DNK42kFAh9poFlrxGvf3ewzXSiicgL32dtrzwTEmfg00O7kcb egbD/ocgXk/S5DsEwkOw2k++skibt8lcxYrFz8LgGpKubO1fLld0YDyZkAIcpPq3wdb5 aNeZGwjYgW5JD2tj7Aw7mgJJn0HHVajPD64DVrmQOW0IEEZyMUmlcxJ4mqqKawzYODO4 hpJkICYeSl3kVKPV85iNjpdf3Z9K1TaPTKwaOr4pJp4watCuOFaRk3e9QuLBcFWj3Aep 7Uv7wKarQxTRMCqZNNcV4JQ5uOaF58mmHXRBGlY/2f2RyXjbnb9ix4IZ4SMZ3b8q/RZ2 YKAQ== 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=mx86M5YQS8ymXI+vhUkZgSGnBjsFbSeN3nBqebJBsPs=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=CUgtR+nc1pNZDLmMjiizHvOGWvXgnM/mW0A2lmibIuzXzoycmrkaa+Cttg+7FmS8Co YwmeU+LcuVy6DQsR7kidR2eyY6XkFpM1aIcxHRxd6mzdYe3wi9Kg8f+l4GqGpFpuxy0F MrHIE7BWab9bJpoL9GrKJu8XIgxFPTSdtFx/siBNPzXlpPrVaBXWxjt6T349rBBUf8S7 lO97Jz1v1nYTcoyge/8ljc1Y0ouoxJUs3BVPyl1njqCJghXGUPvUPen4V8uOc4gJPyWI T4z/w4d7/pGYuoKJqNMdNnCnHEctcmCRDBGNxr2TPVLwlc1xS5+QyDTvueoR7NcmCD5O odXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=koh4FjdI; 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 w10-20020aa7cb4a000000b0051e0c1e0782si13857724edt.148.2023.07.17.08.35.10; Mon, 17 Jul 2023 08:35:34 -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=koh4FjdI; 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 S231676AbjGQPUB (ORCPT + 99 others); Mon, 17 Jul 2023 11:20:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231654AbjGQPTj (ORCPT ); Mon, 17 Jul 2023 11:19:39 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6244171A for ; Mon, 17 Jul 2023 08:19:27 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4faaaa476a9so7473970e87.2 for ; Mon, 17 Jul 2023 08:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607165; x=1692199165; 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=mx86M5YQS8ymXI+vhUkZgSGnBjsFbSeN3nBqebJBsPs=; b=koh4FjdIFtADjbfwJhBoCJQwPDHdjexRnhGMoOt7JLCxB+qLWP5V4U6ZhvsYSxMaEZ x1qbJA3TEvKDyrsNusKiFgxi3c0CVDZfpPCwYhKlg8bRVAgzafsnPLQjlOe684/RXdmU EVrMZ8mQN9t1qEazImEgmnUN+bJuFdIKoCBeJ7cz0Kqe3AYZOO0ojYyzYye691b1lZ/W qRfHEVW3QEFZ0d0t4ZhlX8ZNRl3tuIvx0GrG8O325+eR0QYGv61Dq9wpJ8bYTpV2j3Dw FIU3DN0kNPC/Zc1ziGgpwA42vro3g1MWsiZISlVmMWgf5j9jp5PUmNZM+GApYyWnJonq nO3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607165; x=1692199165; 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=mx86M5YQS8ymXI+vhUkZgSGnBjsFbSeN3nBqebJBsPs=; b=Xkk9ZC8NtX2Z9tm9N5iXTVRGiDHxaiwGU3ee2tP55WJYFVaG8HbSYEntvNmcZpfpHw 5X3ORfl850REH2itxX4Ts5NUUHIGoqtcVyerqCw9f4k3aR7NZNTtGqENH4WydPXNZXxT YFz0BzdE+UrwgUTDzAUaWiMskbYdKXwWVJ8+Z/bOo/Yza0TzRuqkhTf/709xlY6xhpp8 r4PRHRIVTau0WtDwI7XR/6EYa5wWo23RLZrGrOvrjV5eH1qe5aWXyQ8mgfVNw2L+yciv oent8jPy5yXNnr5kKQfphpE63J7vZfDkzcAnfgSIIyGpxhhIZsPS8Lqmds45HXVCxV/0 pLCA== X-Gm-Message-State: ABy/qLbfqcFsZaVqn64/YzyRHIBUH4TtK5IEh0Tgie/o9d0ajmgioOIp sjwRMU6GWj929i/+HrCRBC+XxA== X-Received: by 2002:a05:6512:311b:b0:4f8:7897:55e6 with SMTP id n27-20020a056512311b00b004f8789755e6mr6798837lfb.45.1689607165533; Mon, 17 Jul 2023 08:19:25 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:25 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:17 +0200 Subject: [PATCH 10/15] clk: qcom: gcc-qcm2290: Unregister critical clocks MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-10-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=6725; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=9cGrBLjkf/WHHpMBheuUWUOeDKVWRiwfgvREpTuuJGM=; b=epHujApYdIacicRVBFYoStpuG8TBPBgFBYfQlAGo4OFydyohxJA6rspQcP3JA6EwWPxIuuBMv UE5TYKpOB+WDQ2cRST1hLJDom70hMClEOCeNub5oACZG5f0KgO8Pis7 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: INBOX X-GMAIL-THRID: 1771682539271223483 X-GMAIL-MSGID: 1771682539271223483 Some clocks need to be always-on, but we don't really do anything with them, other than calling enable() once and telling Linux they're enabled. Unregister them to save a couple of bytes and, perhaps more importantly, allow for runtime suspend of the clock controller device, as CLK_IS_CRITICAL prevents the latter. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gcc-qcm2290.c | 114 ++++++----------------------------------- 1 file changed, 16 insertions(+), 98 deletions(-) diff --git a/drivers/clk/qcom/gcc-qcm2290.c b/drivers/clk/qcom/gcc-qcm2290.c index 48995e50c6bd..1a8acc2de921 100644 --- a/drivers/clk/qcom/gcc-qcm2290.c +++ b/drivers/clk/qcom/gcc-qcm2290.c @@ -1397,36 +1397,6 @@ static struct clk_branch gcc_cam_throttle_rt_clk = { }, }; -static struct clk_branch gcc_camera_ahb_clk = { - .halt_reg = 0x17008, - .halt_check = BRANCH_HALT_DELAY, - .hwcg_reg = 0x17008, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x17008, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_camera_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - -static struct clk_branch gcc_camera_xo_clk = { - .halt_reg = 0x17028, - .halt_check = BRANCH_HALT, - .clkr = { - .enable_reg = 0x17028, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_camera_xo_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_camss_axi_clk = { .halt_reg = 0x58044, .halt_check = BRANCH_HALT, @@ -1825,22 +1795,6 @@ static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = { }, }; -static struct clk_branch gcc_disp_ahb_clk = { - .halt_reg = 0x1700c, - .halt_check = BRANCH_HALT, - .hwcg_reg = 0x1700c, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x1700c, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_disp_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_regmap_div gcc_disp_gpll0_clk_src = { .reg = 0x17058, .shift = 0, @@ -1899,20 +1853,6 @@ static struct clk_branch gcc_disp_throttle_core_clk = { }, }; -static struct clk_branch gcc_disp_xo_clk = { - .halt_reg = 0x1702c, - .halt_check = BRANCH_HALT, - .clkr = { - .enable_reg = 0x1702c, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_disp_xo_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_gp1_clk = { .halt_reg = 0x4d000, .halt_check = BRANCH_HALT, @@ -1964,22 +1904,6 @@ static struct clk_branch gcc_gp3_clk = { }, }; -static struct clk_branch gcc_gpu_cfg_ahb_clk = { - .halt_reg = 0x36004, - .halt_check = BRANCH_HALT, - .hwcg_reg = 0x36004, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x36004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_gpu_cfg_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_gpu_gpll0_clk_src = { .halt_check = BRANCH_HALT_DELAY, .clkr = { @@ -2439,22 +2363,6 @@ static struct clk_branch gcc_sdcc2_apps_clk = { }, }; -static struct clk_branch gcc_sys_noc_cpuss_ahb_clk = { - .halt_reg = 0x2b06c, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x2b06c, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x79004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_sys_noc_cpuss_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_sys_noc_usb3_prim_axi_clk = { .halt_reg = 0x1a080, .halt_check = BRANCH_HALT, @@ -2774,8 +2682,6 @@ static struct clk_regmap *gcc_qcm2290_clocks[] = { [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, [GCC_CAM_THROTTLE_NRT_CLK] = &gcc_cam_throttle_nrt_clk.clkr, [GCC_CAM_THROTTLE_RT_CLK] = &gcc_cam_throttle_rt_clk.clkr, - [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr, - [GCC_CAMERA_XO_CLK] = &gcc_camera_xo_clk.clkr, [GCC_CAMSS_AXI_CLK] = &gcc_camss_axi_clk.clkr, [GCC_CAMSS_AXI_CLK_SRC] = &gcc_camss_axi_clk_src.clkr, [GCC_CAMSS_CAMNOC_ATB_CLK] = &gcc_camss_camnoc_atb_clk.clkr, @@ -2816,19 +2722,16 @@ static struct clk_regmap *gcc_qcm2290_clocks[] = { [GCC_CAMSS_TOP_AHB_CLK] = &gcc_camss_top_ahb_clk.clkr, [GCC_CAMSS_TOP_AHB_CLK_SRC] = &gcc_camss_top_ahb_clk_src.clkr, [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr, - [GCC_DISP_AHB_CLK] = &gcc_disp_ahb_clk.clkr, [GCC_DISP_GPLL0_CLK_SRC] = &gcc_disp_gpll0_clk_src.clkr, [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr, [GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr, [GCC_DISP_THROTTLE_CORE_CLK] = &gcc_disp_throttle_core_clk.clkr, - [GCC_DISP_XO_CLK] = &gcc_disp_xo_clk.clkr, [GCC_GP1_CLK] = &gcc_gp1_clk.clkr, [GCC_GP1_CLK_SRC] = &gcc_gp1_clk_src.clkr, [GCC_GP2_CLK] = &gcc_gp2_clk.clkr, [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr, [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, - [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, [GCC_GPU_IREF_CLK] = &gcc_gpu_iref_clk.clkr, @@ -2869,7 +2772,6 @@ static struct clk_regmap *gcc_qcm2290_clocks[] = { [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr, - [GCC_SYS_NOC_CPUSS_AHB_CLK] = &gcc_sys_noc_cpuss_ahb_clk.clkr, [GCC_SYS_NOC_USB3_PRIM_AXI_CLK] = &gcc_sys_noc_usb3_prim_axi_clk.clkr, [GCC_USB30_PRIM_MASTER_CLK] = &gcc_usb30_prim_master_clk.clkr, [GCC_USB30_PRIM_MASTER_CLK_SRC] = &gcc_usb30_prim_master_clk_src.clkr, @@ -2994,6 +2896,22 @@ static int gcc_qcm2290_probe(struct platform_device *pdev) clk_alpha_pll_configure(&gpll8, regmap, &gpll8_config); clk_alpha_pll_configure(&gpll9, regmap, &gpll9_config); + /* + * Keep clocks always enabled: + * GCC_CAMERA_AHB_CLK + * GCC_CAMERA_XO_CLK + * GCC_DISP_AHB_CLK + * GCC_DISP_XO_CLK + * GCC_GPU_CFG_AHB_CLK + * GCC_SYS_NOC_CPUSS_AHB_CLK + */ + qcom_branch_set_clk_en(regmap, 0x17008); + qcom_branch_set_clk_en(regmap, 0x17028); + qcom_branch_set_clk_en(regmap, 0x1700c); + qcom_branch_set_clk_en(regmap, 0x1702c); + qcom_branch_set_clk_en(regmap, 0x36004); + qcom_branch_set_clk_en(regmap, 0x2b06c); + return qcom_cc_really_probe(pdev, &gcc_qcm2290_desc, regmap); } From patchwork Mon Jul 17 15:19: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: 121406 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1182131vqt; Mon, 17 Jul 2023 08:29:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZYrccWfiCm2fsuzRQ/KKwtrm+Bs//GI7UYKEnIXi7QIswqwPg60Dy3v5r5TCnJXfdTEei X-Received: by 2002:a17:906:5a98:b0:973:c070:1b5f with SMTP id l24-20020a1709065a9800b00973c0701b5fmr9568990ejq.44.1689607780330; Mon, 17 Jul 2023 08:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607780; cv=none; d=google.com; s=arc-20160816; b=WoyPGipCF+nDxVD75VTTi1ayHkqFKHnQGs+yOyxBVZA31QVXkN8oT/u3PFJMoc39lj EQ2zoNh3Rx5bKK3I5vEJzrSE/CdMq3XPjwayxl6z83TB3u8T+HjmGhDcJYbnYmwpxr4D ft5Za75NwRhQQm64Gshi+8H0mSTbnOuuhFm7Y8V8Zzsd5yyNKwRp3ygKBqWrsaEtrPwQ dptPpgDbHTrERf2mym0sHsvoBpgKbMj2wWO3/811plEAuPmOYEy2bkq6N+n5G/+Q1UWe 6B0JgCn7emPnJRsilown4b1oi9FuKP110/BawThdr/etpShhsHDUNYB3Ko3Ctu6u5wVS 1k7g== 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=y2B8xuxpSnWhbwKMqhSwKujiuUg9pN0gk3aNyNEAwhE=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=h4xybcIsO9l0uUC7DIjVnq1M/FmnimFFNEOZZiIWAESypBi8SyhxBqDUicXl8NnMF5 YBVJVIz8kaD/RJXVdeBxHqYXewAKGqfeG9fC5nblHDr4gHMO1vmqlUP94qIzZTfdtZHk A4X4N20Xt13QD7jVwNvaRh0s7S/MMX5FiLc/4B2NaKvuiWpfKyMViETr6a6zo9Xt/TMN RZgRDUEGwqWQe8Wh1vU0JO2Kp9UTfi+pW1csyLgWy7jC/5JuYPM9Cv5nGpEoFey6ybFT NiZJT4JsWZlrRSu2Y7ZbTLx8Vfql4wNHsywpGhAeiU63fh5UdENDRCyQ7EGT3wFZlW06 0EGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eatRw8c4; 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 dv21-20020a170906b81500b00992e14af9bbsi13122890ejb.555.2023.07.17.08.29.16; Mon, 17 Jul 2023 08:29:40 -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=eatRw8c4; 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 S231866AbjGQPUE (ORCPT + 99 others); Mon, 17 Jul 2023 11:20:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbjGQPTk (ORCPT ); Mon, 17 Jul 2023 11:19:40 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 245A01736 for ; Mon, 17 Jul 2023 08:19:29 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f122ff663eso7332749e87.2 for ; Mon, 17 Jul 2023 08:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607167; x=1692199167; 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=y2B8xuxpSnWhbwKMqhSwKujiuUg9pN0gk3aNyNEAwhE=; b=eatRw8c4boyIvPhRaLxD5x7GbLwPJJdKgtqcudBmKAdJt+3WsAZKB38G0s6JoxepuQ 1fiUEMRMTEFV1vib41dJVQP0cD0paZULlKEpDLB92OHcSDPBbuXp6WyAcETmaCcOagsP owYnk+Dx9Miu+jMEr8902UgaPz5k73GYoZ7pG9P2XWtQ/uS1Z38lCs3ouAqp9BRpyPry 3WArdvrA+wp9YrmQztsJFI973HztM90xTT9sVX5/1Vq8OCI4OTiV3gEJQ7H95spvY+ZY J0eNkvk4CvPPt4bwmw5o8Z1zy94t/zZe6iK4luYmY4UISQ8nD3X2eV1lqjxuzewQm2ry ayxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607167; x=1692199167; 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=y2B8xuxpSnWhbwKMqhSwKujiuUg9pN0gk3aNyNEAwhE=; b=ATd/9/TPJOV9k4Woz5o4AaluGKt+T+6QSImJAj2rMUMHrqFbuxooRE7aWm88uL4dWP LxJ5difUpH7dley4OhnRgQLZ586ZGvDd0RSUDkFyk8jRDribAhkka+iqqNJDym0dNiJz hAFR8gUo0ewOP11RlOL78WbkmaSJwIEqNnhxt3qMgtYccG5A9dPJsXuwT84SZ0bQgPBH ouE7h6yw1CHfHknXRiovzor3c21wwFMcoLd7GRHlZPpyEqx5jPxRqESKBuiAMMIk7jpy U+sqMkE9UDwyjghDUby2VHfj9GaBLNVv/zK5LUoj3Bk5Co+tFTcrQvEFDdXoWOE8nEbg jVmw== X-Gm-Message-State: ABy/qLaDYD42uewkKrJt+HFg/zdVdFsPk09/4OPLAOn8GYMRU2OQERzp M//8ZsVEcyTHw5jczUrpK2zVgQ== X-Received: by 2002:ac2:5f7a:0:b0:4f8:6ea5:104b with SMTP id c26-20020ac25f7a000000b004f86ea5104bmr6981516lfc.30.1689607166903; Mon, 17 Jul 2023 08:19:26 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:26 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:18 +0200 Subject: [PATCH 11/15] clk: qcom: gcc-qcm2290: Add runtime PM MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-11-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=1980; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=SEE5Vf2kJq6CXu3dBwAauLybj1NpUkl0+Tc5/vKK29A=; b=xpHotqpRsd1M6m6fXXG+MlRWzVc91b4BPgGLqLB6PoDcJtO6t4WTluXgb8iW4mKZN3lEG/wW6 53LYl6aqR+mDtzTQEBZpmTgapcF2rbKk+1paoIbTctCdLj3Ur5Ddb2j 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: INBOX X-GMAIL-THRID: 1771682167669108168 X-GMAIL-MSGID: 1771682167669108168 The GCC block on QCM2290 is mostly powered by the VDD_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-qcm2290.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/gcc-qcm2290.c b/drivers/clk/qcom/gcc-qcm2290.c index 1a8acc2de921..573cb550d678 100644 --- a/drivers/clk/qcom/gcc-qcm2290.c +++ b/drivers/clk/qcom/gcc-qcm2290.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -2882,14 +2883,26 @@ static int gcc_qcm2290_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_qcm2290_desc); - if (IS_ERR(regmap)) + if (IS_ERR(regmap)) { + pm_runtime_put(&pdev->dev); return PTR_ERR(regmap); + } ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks)); - if (ret) + if (ret) { + pm_runtime_put(&pdev->dev); return ret; + } clk_alpha_pll_configure(&gpll10, regmap, &gpll10_config); clk_alpha_pll_configure(&gpll11, regmap, &gpll11_config); @@ -2912,7 +2925,10 @@ static int gcc_qcm2290_probe(struct platform_device *pdev) qcom_branch_set_clk_en(regmap, 0x36004); qcom_branch_set_clk_en(regmap, 0x2b06c); - return qcom_cc_really_probe(pdev, &gcc_qcm2290_desc, regmap); + ret = qcom_cc_really_probe(pdev, &gcc_qcm2290_desc, regmap); + pm_runtime_put(&pdev->dev); + + return ret; } static struct platform_driver gcc_qcm2290_driver = { From patchwork Mon Jul 17 15:19:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121407 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1182281vqt; Mon, 17 Jul 2023 08:29:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlFRhztZRjesQWS1oEiDO2SDQVeK+xCESaBEHD/ouwmscKmgnQa9QIKFR4MQsLscpw7IJ+nd X-Received: by 2002:aa7:d644:0:b0:51d:fa7c:c330 with SMTP id v4-20020aa7d644000000b0051dfa7cc330mr12830059edr.26.1689607794205; Mon, 17 Jul 2023 08:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607794; cv=none; d=google.com; s=arc-20160816; b=w8e7VdL1e+wob3455lgf1v96Wh0AxmUK+7lrgVECkS3AmRkXMtNfoN3DTznoKVmCQY SSGRRgxGzmFwGHbAmw+InM4PiqzmY45TBBvCsZSx86m1A6e6MZmv/TDgArz+ZbyyR0Eb czzQGcUmyLuCTg+N/IQiZziftNZysjDGhJsQU6+04Y/SqjgJ8o3HCQcR4k6L/jkgfCBh x6Qdv/ZBAqwiinDdSp/QFZe6Pb19zd9rPWtjSPV5JLnBKE+VGwP8rDgVe/i/51Zk+jJ4 5eFoz2hMOBnr82bzPT0aZdcgu1MtpffC4NLi5GEMHZSd9NxkdOuP90Af4gQ4eekl476o Y1Aw== 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=Hib3PW+pD9Vw/aBXh9phjmFHPMYV0WlytMyF3Y7iRI0=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=OIqFvYHo3e0laQdxttwuuOs+TzL37uSGXanCifTvq9qbH5cHlfZFMBnq/AyBQcwr7p iy8Gu9Afr9EDdHpE3dusuLTlkxOCc8p9H8aUc0WC+CefuRgJBLZ+ECujAvVASgi1UIJy HDoJxAgtqqLfX4CRW9awW/NKdWjEYQYFp9Z+kd3TDb+vnDci7HsfT5BsaRyf/Qx+Mml0 QsAh2LMmS5Yvd2SaPRED7F4pFzP/QH2bPy9heSmFWEcC6PaRb11ufv3ARPRo1jA3QbuK EBpGnMCqjc4ViR1vCVq+h4YCY8RGJ3rgQATEOAzwceD+Jl35J0dxB3KaFYfrXmF7nW7r bGgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ySpZsA4u; 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 b9-20020aa7d489000000b0051dd2d2cfb8si15167739edr.644.2023.07.17.08.29.29; Mon, 17 Jul 2023 08:29:54 -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=ySpZsA4u; 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 S231640AbjGQPUT (ORCPT + 99 others); Mon, 17 Jul 2023 11:20:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231256AbjGQPTz (ORCPT ); Mon, 17 Jul 2023 11:19:55 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C90E4199C for ; Mon, 17 Jul 2023 08:19:30 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fcd615d7d6so6809737e87.3 for ; Mon, 17 Jul 2023 08:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607168; x=1692199168; 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=Hib3PW+pD9Vw/aBXh9phjmFHPMYV0WlytMyF3Y7iRI0=; b=ySpZsA4uVOf6a6NXu+CgSrkKV5uqya3BOQAA+PS1SpMmvBS6r5JwQ0aEyQoK9ZqMsS UKzy/px5q2FbmTiNEmBJRaPJguE6qdd+xTqVBW/b5QDk53EtVvk1y9m0IAAMrflxzaLd 4vV2BLae/ubxxUqgS42VH34WPIJ3kHI+D0siP70LlKBAFyIll6YRsjHiKeo8AcjyyIlK 0p7Yk0RvADkVXGaxhTZ7kHf8WBdlpu+U42L7zp4vJFluYWnwWEnrztiF2fRj3GZrInZb NLueirZg6JMDXq9CojQ1hzuIi4DwwPYtfRZKLw3xjnlpXcLNuKWJ5JwEwqymz6+cnfF+ ZNYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607168; x=1692199168; 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=Hib3PW+pD9Vw/aBXh9phjmFHPMYV0WlytMyF3Y7iRI0=; b=cMZiG2TQZSAUqNsk/toAcZMj5E5BBzwQfERP/qkpNIyoQaQ5hVKC9YfZ8FKvebcIYZ ai+AJ3i8bgHh5lN/rWkHBoycDyxla8Ig0jckY01aDUOMiJQjyaJIOh2rkAAhDqHk8mH7 moIe+KYsM7ECDXwPQsBFZKHZAyyY/cS6IHB9cKR5O0mMg3x9tZhjOnR3cRwtA9xUczoE DXlfFLxinUd/L9fipK6CLTFLr8Z/bDBJye+m1NBfQo5f2Ze4MUPUML/BOz9J4t48YqxM dTCexY8TG1bebLT7eXkTuWn09IE0fDLVOBlxSeGp76ZMMhyxXalMf00x2WGmQgluVkJn d7jw== X-Gm-Message-State: ABy/qLayZvraDraL+7eBpBCl+M4EF8A+c3KNkIIzjIXBBVUVUmabZQ31 N81+DJIIyVKqZ5W3ac/iokjULg== X-Received: by 2002:a05:6512:53b:b0:4fb:89bb:bcc5 with SMTP id o27-20020a056512053b00b004fb89bbbcc5mr11228445lfc.50.1689607168350; Mon, 17 Jul 2023 08:19:28 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:27 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:19 +0200 Subject: [PATCH 12/15] arm64: dts: qcom: sm6375: Add VDD_CX to GCC MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-12-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=718; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=C5XEfW1WulMPJ7l5fdZmAX7BDZDcdKgcMmWnfi4QWbk=; b=lIIYO4AAgn3LQgFkNPM78AvqMep4285ACx41eHmSryMN4ieLlG+4MiBKsUD0PFHAb/5ggeJap upV1mIuDrvvC9e87w7J/sOYEIiT3vtWIVYbQWLFanqfT4fy1tBV90/8 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: INBOX X-GMAIL-THRID: 1771682182881871925 X-GMAIL-MSGID: 1771682182881871925 The GCC block is mainly powered by VDD_CX. Describe that. Signed-off-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sm6375.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sm6375.dtsi b/arch/arm64/boot/dts/qcom/sm6375.dtsi index e7ff55443da7..6fec45b54c98 100644 --- a/arch/arm64/boot/dts/qcom/sm6375.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6375.dtsi @@ -904,6 +904,7 @@ gcc: clock-controller@1400000 { clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, <&rpmcc RPM_SMD_XO_A_CLK_SRC>, <&sleep_clk>; + power-domains = <&rpmpd SM6375_VDDCX>; #power-domain-cells = <1>; #clock-cells = <1>; #reset-cells = <1>; From patchwork Mon Jul 17 15:19:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121408 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1182312vqt; Mon, 17 Jul 2023 08:29:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlGeWYIeokZY52GwqXzxAmeGCYOSmzJ0bUFL3T6kUJA8B9T3kiVhJSGFGpMUAe4zGzLIOxKD X-Received: by 2002:a17:907:2bcf:b0:992:1653:3406 with SMTP id gv15-20020a1709072bcf00b0099216533406mr9514187ejc.73.1689607796472; Mon, 17 Jul 2023 08:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607796; cv=none; d=google.com; s=arc-20160816; b=bI8goukHL//fIXJu2IDjPCiRu4A0gqlKn9fZHZsL7DMAgURBA6BJ0GTiFO4uFZS+Lj /bb87TCwHySwsXY/eOgqWEStbvfIzGwRNVDM7KprqMSqLFjgS2AHl4DXP5kNNPDIlzRC M2cKtjMzMImb5U2HgifjeGoeffpvc6ho58ERqvjw2k551TpO0bxffCadGAGtOUNN5E+F PDZQOdUcsJhdVw8yWS8boMsz1MfsPvAWwXOSoIQA3IypOTpFxxjnf3binJFkiJUsKDK+ ajb1l1Hidmo7pBBG56/xRl0X5/rfljmXrb+DkInn0KEwVg6MYVsmTnTkRLdlGKdf5QlM emWw== 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=ZkK0zo9Pzls7HuP6fjOXcbL6dtei0B7+SlDRygwdvi8=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=v4F2sfjTusqQ/dsN88mDkV3Ts34167B7rrAh/MeaWVzCCPFQ9pNQjBEr9jzPY1mI3v pssJXMj3uikzypaXEm5jK+8yMegqf8KYwJlDKrVCoD667i/P/+2gDckCyZhfyLMiB3yI maBf4/NQPgyrTzapUvX4+s8xezK3gPo2/pr5m8Q7jL1n4tpO9BE1M7hXFEPgRrAc1Wg7 X5nI2mQOY53t70ihg+y4mdC+0dPCdmZ89VTWgtIOB+5Y5mE/shtn3mFQKLTtJYZzEL+9 LvOKPKQnbO3gex43jDtjE+y6Y43IwdDlwUNIZhNFPrzpPdssrTSeBZnlRo52m0x1v7Jg yypA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iR1XfiKE; 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 bl1-20020a170906c24100b009889b69c1edsi13575981ejb.697.2023.07.17.08.29.30; Mon, 17 Jul 2023 08:29:56 -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=iR1XfiKE; 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 S231848AbjGQPU0 (ORCPT + 99 others); Mon, 17 Jul 2023 11:20:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231807AbjGQPT5 (ORCPT ); Mon, 17 Jul 2023 11:19:57 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E26CD19B1 for ; Mon, 17 Jul 2023 08:19:31 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4fb7dc16ff0so7241103e87.2 for ; Mon, 17 Jul 2023 08:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607169; x=1692199169; 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=ZkK0zo9Pzls7HuP6fjOXcbL6dtei0B7+SlDRygwdvi8=; b=iR1XfiKEzrx7+T4BDT5YuM955j5yDVy9OhdERnmdlfO6RjaGQtzMIdoGtE5Mjjezhd +3j1ecAmLtYvr1aFTK2pqDTZrzdc3ZM9kn/IFosFTienwFzol7xDCNmw8CMda7YoK8lU KGMtE+Yqr92xe0eiLB8nHadioD/dWtJiq+xDuk87+eks7sSS17pGU/ISpC26N8a7Za4i bJaqmNZF2QcXv0EqFRsYsNIO0ZLF2Vuvcx1HT3933tK6NqnFtG2cRvIso7kjuoB2zal5 /6rCohkAuVVGnxTdP8pf0jNWBbe4YIv8BaHk5uA0MLxLEKtpHDOZrVfaymPL0+g/CZ0N lJlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607169; x=1692199169; 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=ZkK0zo9Pzls7HuP6fjOXcbL6dtei0B7+SlDRygwdvi8=; b=GM4hZXx6PFwvyhRC8x8MlKGuGZnRja5S/pcAkfUfCGHcYHpbgZb4708H1+NrkHOCJB hjARmepQQUI+5O1XpNKtKVXnKBIgBG63MJl3SrCnMMc2G7P7jygLOTJ6Xx5Wl5Nd9P/7 8tnWlhKNBMVjH/P1zPvrZ+BGC7j29xcyi+5o+R/RthR0vdeggDsTsYQxXw6sLwii+cd7 z9wGxyYhQEXkVYcRHcyLgRi8lUPw+lQaXiv/aqdvoYliYTla8sRIu1eMXMYA5P0SikcD I3afZaSapQoCWMqRHYH8tC6m/+lF3dJBpYZ0eagy0BWr2YXlr2JZWrPNpykSdte41K6f enGg== X-Gm-Message-State: ABy/qLYYhLzvrkYvHeyIHQCv6Gho4zhD2842DdvoMMRPgJn1IJ+2KgZV swRkSf60hM6uK4/2eTbY9ChwlA== X-Received: by 2002:ac2:4546:0:b0:4fa:d522:a38e with SMTP id j6-20020ac24546000000b004fad522a38emr8262794lfm.35.1689607169690; Mon, 17 Jul 2023 08:19:29 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:29 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:20 +0200 Subject: [PATCH 13/15] arm64: dts: qcom: qcm2290: Add VDD_CX to GCC MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-13-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=764; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=CPIjnOdtakV5i/cKNTsCCaP/1W9vDnorxYs0r/7/pcg=; b=WOkbSks1r0/0/zz3X2U6Fi1XiOfql7qbx696TFz4HDvz9aDWN8L/4R9cCn0Xe2bSuOw2blzri Ypn4itLVWWqA3FXGDaS4p66CG3cykA3YI6V/hCCKLXU3IpaKvRNXPf1 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: INBOX X-GMAIL-THRID: 1771682184762016610 X-GMAIL-MSGID: 1771682184762016610 The GCC block is mainly powered by VDD_CX. Describe that. Signed-off-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/qcm2290.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi index d46e591e72b5..a3191e3548c1 100644 --- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi +++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi @@ -622,6 +622,7 @@ gcc: clock-controller@1400000 { reg = <0x0 0x01400000 0x0 0x1f0000>; clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, <&sleep_clk>; clock-names = "bi_tcxo", "sleep_clk"; + power-domains = <&rpmpd QCM2290_VDDCX>; #clock-cells = <1>; #reset-cells = <1>; #power-domain-cells = <1>; From patchwork Mon Jul 17 15:19:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1179769vqt; Mon, 17 Jul 2023 08:25:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlE9Gbl7NsMrx0kVM1X5eW0OwoykAG8fHbftUQ7j3ZI/oIKOEcmGDF3NTO1SQVuEYgRPt2uz X-Received: by 2002:a05:6e02:20e2:b0:347:fd0d:2ba1 with SMTP id q2-20020a056e0220e200b00347fd0d2ba1mr113886ilv.28.1689607517013; Mon, 17 Jul 2023 08:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607516; cv=none; d=google.com; s=arc-20160816; b=RRgeQfM+dn1c6GGyfwb6W0OOfgKBhvATtzoLPM01aeVT3j9GwB9r58XLFskJq3peoi zgZ7HZjZm20uJA+Wr3wgN/HKVycbAk8qOYx9DwV18qadIm9agzpRbuLlft7Ck8aLnZ1T 7mX07F92vgdaKS7bqFpwCWNl6Ot3CDG5Th81fhJVXPdHFUAVDr9ksbU6LwcAGWM2vH41 FNrdanLoiw0AzPz4eLAUdP2lhFqNLjNWSUQ9syzWvxD7rQYgYEY+vJdIIRnfzX8GE+z+ nkEB3YJTXojtgAR9Z9tvDy1OVaduB8aHBsVFc5ZuUMLIyAg5vavSGoxkjo8f6X1icPs5 RIug== 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=2ZVz0HHbNacYcZ7SswA3bwyZfWy1YH5AMNjeXJBFPFg=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=U7DHOd9puhPGE+HEfQi7Qm3raNlzWwgGQBvsr22aC1si4zcHgvcfeTNYDeI/KGVMiX Va3HJ1LpOovVe45KxLuQ3xLqvhyEIP5zQwdM0J8vq9pBLID8O+/GFVSu5qeCj9onrYa4 xU59oJwN/0+MN7K2u4EEuOhtnHPDZZv/5VpnlESdoR4vSPYPJUrOgkeafgXpVnBuQDfg Pwq4eWnJdocZTHs1+TmfvSWv/OyIFzQszUB9JlV3eJmW3l7VauF7a3fBKzzyenW2QZjM Xc7Ue4TO/ZqdG/PhkOWuxTjHL7zcLSaltdlSGIxUiDSC+qRB0pkOijxlpciXTEGcEHEB /TPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rNZgbBZp; 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 t10-20020a17090ad14a00b00262cc36ea3esi30354pjw.76.2023.07.17.08.25.04; Mon, 17 Jul 2023 08:25:16 -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=rNZgbBZp; 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 S231963AbjGQPU2 (ORCPT + 99 others); Mon, 17 Jul 2023 11:20:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231842AbjGQPT6 (ORCPT ); Mon, 17 Jul 2023 11:19:58 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 583AD1BCF for ; Mon, 17 Jul 2023 08:19:33 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fbf1f6c771so7449042e87.1 for ; Mon, 17 Jul 2023 08:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607171; x=1692199171; 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=2ZVz0HHbNacYcZ7SswA3bwyZfWy1YH5AMNjeXJBFPFg=; b=rNZgbBZpPSV/suV6tgIxgg4kwXvvWfXFhsYAXsuDsXPyn3ogYa6AhAMB3K/eb7b9m0 kTlXUad7J2qcGe3C5yzvyjW8qyEJlPRWmHZQpZ7KdpM3bGqMkbFS8KfBSHYo9pGMv3Kz V3F+kyEZSClCsJYw06QomxibukGtsnZOUgJiBXHmbcM59vrI3TJrenZleJJAOvikgUiL TUASUEtBkdtCPDHxLhb+IzarEOgHsaTSrleD6nlrlFCzFftztEyK26g3Pl0l19DpeAtY dvEYD5Zi6rHZI2vcpNtuOW2puNkRGTXxXljnSoc7kwwDio5gAaPICN9qWfL2oAx278VE qqgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607171; x=1692199171; 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=2ZVz0HHbNacYcZ7SswA3bwyZfWy1YH5AMNjeXJBFPFg=; b=U3KAYcs5KCuC74Cj5EfIR5MI0XGrd/S6kQHkPshmo/nZ4OrV3YXxgoSdjAXhRcj3Uy 8Dixem/RDwRJOrN1topqqXytyOLSrndiAUt8qa14ZGy+Hu7HFvqqvdOaBKN+FbWlQ6yu /Nxl/144GYCSjfA+OjMgFFh/rHI4P/isWbEueh+rSJdrd22oAWZ0g1JixdNWJcYScrg2 sYgGPrDxseP9lZhrMYXkFhP+nHSU8hMzKRpEtGooBsS+NmSMmLhs9Pgd2OwYphdkF8ng f/UAqEclPAno/az4S2AvG48mOED15IYmuzprcc5nL52xNT2av6/pbgv9t9DROjasli6x t2DQ== X-Gm-Message-State: ABy/qLb2xIq3gop1kKIqC3qtSW7OfulxVNYXGCcwQGYKZX1sMQgKSzzP fKcWtWIfFhGNMz7luoV2MxvLXA== X-Received: by 2002:a05:6512:304e:b0:4fb:89e3:5ac4 with SMTP id b14-20020a056512304e00b004fb89e35ac4mr9148515lfb.66.1689607171063; Mon, 17 Jul 2023 08:19:31 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:30 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:21 +0200 Subject: [PATCH 14/15] arm64: dts: qcom: sm6115: Add VDD_CX to GCC MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-14-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=758; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=teCmvh/mH8/+KIQ6w2EiUF+9FzEW2n4wijD09cbH2a4=; b=Z6lj84tCtOpwyb5JGxRB90l01ovLnN0ixjCPdiYSidGzkn9vehSp80TM9eBEPDZtKZiNTZMJx jHf11RCWkK0CDgzc5nJ9DXHOh81HZwyCwcG3HSLvDV8PIeemm2MGyUo 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: INBOX X-GMAIL-THRID: 1771681891826186373 X-GMAIL-MSGID: 1771681891826186373 The GCC block is mainly powered by VDD_CX. Describe that. Signed-off-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sm6115.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi index 839c60351240..29b5b388cd94 100644 --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi @@ -784,6 +784,7 @@ gcc: clock-controller@1400000 { reg = <0x0 0x01400000 0x0 0x1f0000>; clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, <&sleep_clk>; clock-names = "bi_tcxo", "sleep_clk"; + power-domains = <&rpmpd SM6115_VDDCX>; #clock-cells = <1>; #reset-cells = <1>; #power-domain-cells = <1>; From patchwork Mon Jul 17 15:19:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 121400 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1181719vqt; Mon, 17 Jul 2023 08:28:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlG1g0vvTPkqo0zO9rb7LNVRJbWnEQsk4AyBDsZG8RwCqnSDQZ2C+PKzAfx19UAFNLLKV1On X-Received: by 2002:a2e:3606:0:b0:2b6:eb5a:d377 with SMTP id d6-20020a2e3606000000b002b6eb5ad377mr8859762lja.5.1689607736976; Mon, 17 Jul 2023 08:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607736; cv=none; d=google.com; s=arc-20160816; b=lGqk3SGuCiSljK3yrfNckvZxUVzDflbHmW4RrCnfTu8fkEhfnPedIb1S2bsy4GWovq ngzDabqckuT4b3D75e8USSvmGTsm61jt7vwSnA50iAY7bFUtTLbuR5vSsRZp4XcYrfLS 7INNH/n9/oMvQ/jgv7p1N6Luyb8LaN+W2dDuCJElYTWRmrloWja9OFxo7xFn+s58LvuU 98XUWcIKPN6B8p3ALp8ZWH6Y0hCq2vZ7iIPjgQGOhbhFXx4f/wmwGvba/x1kKOf4vkYu qggf0uzuhiKp0xJCKaZmk1OiiU/b4ghVOquKQ8zExN1AEGUJYW7raP6dB0OS5ipdia8Z +xPQ== 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=6ucP2HxOwgP4Yjc3Q8ZZBgQ8j1uIc3OmiWC7cbRp7SQ=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=xSUkz1hjs1RpaXb6rkviVS0m615zoIC1xxvrtXkfuwTeu0RmGSkq0z4BUoUjV5Z5fV PhGbw8e43VYeKaGw5HqCRCY8J2RinsSmBefFJcHxyp/QkActIzqjW6alIjp++XJACaPz 7RacFInUGYs5Gom2u8rSyLSe8Wv02wr+7qPBoNjuFczB45Y0WGkFvxbbi829h0SmIW3L Av7IWR/JQu5HgJvos/lQ+OgL83WWj1a1fiRmFjgItnWATZcyC1EgwnJvU5J/a5pBr5rM 2MPUGfZ9kqFyEphRl1Ww+9QyVodc7nm14ZBOfOKnaHveumjz26sHtq7rF1iAXzZv7QxL Zgdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aAsyFds6; 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 c26-20020a170906529a00b0098296d092ffsi13709972ejm.330.2023.07.17.08.28.32; Mon, 17 Jul 2023 08:28:56 -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=aAsyFds6; 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 S231486AbjGQPUr (ORCPT + 99 others); Mon, 17 Jul 2023 11:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbjGQPUe (ORCPT ); Mon, 17 Jul 2023 11:20:34 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35F1226BE for ; Mon, 17 Jul 2023 08:19:55 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fa48b5dc2eso7448291e87.1 for ; Mon, 17 Jul 2023 08:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607172; x=1692199172; 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=6ucP2HxOwgP4Yjc3Q8ZZBgQ8j1uIc3OmiWC7cbRp7SQ=; b=aAsyFds6D3PMJEXo1mRw7yaSFEFyCwzpw8bc7QERWt12x+GbYXficzoCDkDyBo7h4Z 62Z6Rxu+5TMH3EeAAlv60yIOJkKs1lSTWu6iBieEmkUsquuIa11nMNQdHG1kcNXk6Jml vJ3dObu5l1Rzkk8/4WSFhvQI/+4XhyexGyeCk2bUjkLEU5rjBwlHMcklMQfaStrCnlHC 0xORplVjcyGhMZq87BeArmLClMW1oKgWZH6VyMbA1rowzdSZMO1VTIDvtjbCAqA2QdlV Wng487nS0xowQ1eGL8UF+0LXKbfRkU6VVCeJzJxiPeyy1m56qprgDRFCfjNPyi5WNzZ/ iDAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607172; x=1692199172; 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=6ucP2HxOwgP4Yjc3Q8ZZBgQ8j1uIc3OmiWC7cbRp7SQ=; b=KxO1qoWZgpgPHMfyWtEoHoRXZAVMtfk+dYjnxQjupbQLnAv0Hr/oDx4nyf3m3eFM5u 5h1ifpaGJJM8KC3GrF98ni2u13LzqpB9XFGzvoGtAWxkvLfKVA2zD2mDm2FNLzg0rd4K nrCWwtXHNliGavsD8RPyWx81UHOt3EpGG7w96Bwn9mtKJrrS4RgTQmOFmFnCKa4cFQFs J+ZihYUuc0bnuhQUhYAEeuXAP+SxfOJv+cdNUJYXXEFanrIPUCRivMnSFucq0ls2OvG3 rcrRP/qeGKLxBAUZGhRDE7DLgpvhxmCDx6NvW+23wk+5S5VoGx2sRo4WVyFcoG3Lxg52 KqHQ== X-Gm-Message-State: ABy/qLZE5c98+HMGuNR7cvodOTIUCPW1bRzqPQlrlyE4QV+YR5NA8MaD TQ516Ir8V7yCzjx+GciGkpTXJw== X-Received: by 2002:a05:6512:3121:b0:4f8:6533:3341 with SMTP id p1-20020a056512312100b004f865333341mr8483185lfd.20.1689607172501; Mon, 17 Jul 2023 08:19:32 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:32 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:22 +0200 Subject: [PATCH 15/15] arm64: dts: qcom: sm6115: Add VDD_CX to GPU_CCC MIME-Version: 1.0 Message-Id: <20230717-topic-branch_aon_cleanup-v1-15-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@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=1689607149; l=782; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=KUdFQ1vDlHA4ohS8EU78+JEQV/TntyZtIcOU/vB61S4=; b=PXU+1NIif1o8q606ns3V3Z9OE4O7LZWnqOhTWMcpM/+BblfkOHNE3GpDoGEyTgvH3VTTUBZrq TubYMkT6OmRDcWp5p4Sj2bY+QorleRofBFq1lfUNCd7lsYo875iG8b+ 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: INBOX X-GMAIL-THRID: 1771682122626790815 X-GMAIL-MSGID: 1771682122626790815 The GPU_CC block is powered by VDD_CX. Describe that. Signed-off-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sm6115.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi index 29b5b388cd94..bfaaa1801a4d 100644 --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi @@ -1430,6 +1430,8 @@ gpucc: clock-controller@5990000 { clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, <&gcc GCC_GPU_GPLL0_CLK_SRC>, <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; + power-domains = <&rpmpd SM6115_VDDCX>; + required-opps = <&rpmpd_opp_low_svs>; #clock-cells = <1>; #reset-cells = <1>; #power-domain-cells = <1>;