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;