Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4801049rdh; Wed, 29 Nov 2023 11:01:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFs7M8ePOP/IJzTV4QUIvhZwSbkqhTgVvEnLfPZ3wjNBcq5A4SV8ohgkOldf0YprKihDYJZ X-Received: by 2002:a05:6808:1211:b0:3b8:43fe:96d9 with SMTP id a17-20020a056808121100b003b843fe96d9mr28447579oil.35.1701284462673; Wed, 29 Nov 2023 11:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701284462; cv=none; d=google.com; s=arc-20160816; b=zCQQTk4fFpnEmTYDDpM4ru0vJO9HcvmbcAph4bHmxPo/Q0mmgUm2AEBiSFFAsogGuu eNXhMi/GEnPDx8d54gevUn4QUDUstGdIlQ6/GmkWPORHiHmyY7XWsDEF/kjrVkPbBDVD Y5QtA7+akaQht9LoXsPttGCUt65acPEKA/AHzl3NJoBRG1W2LcroYTPbeJBGs56j8rxy sxD+AMmUwW4/F7S2N7vYtO/KpkIZVdnHQ9MWrpVecYuuqBOEuT/ZsxHVNFYzDGo9L+bS xaFsJH/dm9P6PDN6kcULV1fPWUKHLwzLf1dx5mcYzIP946aId4mfpe48fMxzQEFSu35f z2MA== 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=RU7MUmhjYUqguRdxkKjOpWr8dfD4OnfjrqVOGeQS8T4=; fh=qBuqKhEdu3qppJ3sBxHnkC2osA67KhqyQredba/QWR0=; b=uwpruLGwfShyLYZeOFUPRe9nsTQGODI4NpboLlZAX1uaZd4z8vTpsnmqZhLw3yDlSO QY27iCPs2ufgTdHsD6/ii55dYlcD/5ZXsqkpP4FxUYSw2U0Atlp5LG41lD9P7pu7WcXQ 6n+pbn2OVvW0IYTrbQ4qAXr91jQaEvRhCYCLI8/fRB1+p6O1iSTJWvPU4Y4W33mG/X1b nhDotxNIYFQqRwKuLog1HoL244zhoGC5c0tItnuVllgm/BvlS/NtdvFGJ3RhScrOzlCm e2ZEfIkTMdTnlpTgSZ1NmoJ3IuYzVocm/AJCKNDmCufVTZYLoENeKcLo4hX7t28GOYj6 cm9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yukDFy8g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id 16-20020a631650000000b005c233bce486si11481140pgw.116.2023.11.29.11.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 11:01:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yukDFy8g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C37A4809C3AB; Wed, 29 Nov 2023 11:00:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232918AbjK2S72 (ORCPT + 99 others); Wed, 29 Nov 2023 13:59:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbjK2S70 (ORCPT ); Wed, 29 Nov 2023 13:59:26 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1917C10D1 for ; Wed, 29 Nov 2023 10:59:32 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-54be88056c2so183241a12.1 for ; Wed, 29 Nov 2023 10:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701284370; x=1701889170; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RU7MUmhjYUqguRdxkKjOpWr8dfD4OnfjrqVOGeQS8T4=; b=yukDFy8gHo1iZ9cxpdhPA7773P1RwpvlP0dV6+y4X+fl3qdWfXfStYu+3Hqy86ulqj FPDQB1ZId/UyKDM9nfDwDrYMv77BqSNjljgy0CRyw+u+qRtWmSwLSbJt3Y0cnfEWgLqB wwjOwFPfYXDgLCBrcF5BSNEElSG2Qe7hvmg3HAPPE9Wufmzbi/DH/3yygxZ+y6MpRlPG AqcUHDzfrKmDaOpj9SiTVTV7wf3oO2IWAu3Ma2Df9mngzsOc5QBYhksrpwEAXsjXkLpl BS8D7H2qt9YuSpD6y3IFKGLHMdsgSGCDyFllignkHuscfcr///orL657c6mqPIgXO3VE v3cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701284370; x=1701889170; 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=RU7MUmhjYUqguRdxkKjOpWr8dfD4OnfjrqVOGeQS8T4=; b=jTi9/9VdwomsCRbLdpjpFTjPgKZnSpEAErxgrtvmVc1b9Z8AW3TmLOz8dCwv5zvjB6 EmCl724ZezupHNIJnOUjLgpjCcTan5w26I6RrNGBRKbnxwi8gEKEAUTGMsWDTKILP20k dJ//U/MC20CQhAIV+RNw4jqScVI7IeYMh02F2O3HbXpUM3TeNh602DiDkXb7rTSRvnRw rpVgAWvtVb23wQaQWV37lv7ktbhibnUFcErHd2U6/ZFp3sX48kWgX30ay9ofGlxDD3YA m0dkyayowb/gJglc5NcpJt4YgFX39QBLW2hJJMrv5xXXk9VpIkGvI54UpxaLl/xqNMrm frHw== X-Gm-Message-State: AOJu0YzYUEecwPLqkd8WdRkJe84FXOisFgjHDtdVJ7zywwArjv4S+BPw RyXibRA9UKyUqQeddfZ7yCqQNA== X-Received: by 2002:a17:906:b299:b0:a03:ad29:a00b with SMTP id q25-20020a170906b29900b00a03ad29a00bmr16330131ejz.36.1701284370581; Wed, 29 Nov 2023 10:59:30 -0800 (PST) Received: from [10.167.154.1] (178235187166.dynamic-4-waw-k-2-3-0.vectranet.pl. [178.235.187.166]) by smtp.gmail.com with ESMTPSA id o11-20020a1709061d4b00b009faca59cf38sm8160232ejh.182.2023.11.29.10.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 10:59:30 -0800 (PST) From: Konrad Dybcio Date: Wed, 29 Nov 2023 19:59:20 +0100 Subject: [PATCH v2 01/15] clk: qcom: branch: Add a helper for setting the enable bit MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230717-topic-branch_aon_cleanup-v2-1-2a583460ef26@linaro.org> References: <20230717-topic-branch_aon_cleanup-v2-0-2a583460ef26@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v2-0-2a583460ef26@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 , Johan Hovold X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1701284367; l=1349; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=e6Fwd/o/2qWMn5DgIB1LfGYNT4yrpvovsVT/9DIkQR4=; b=+eEk+TghBsnLCZCKRQBNiCy3J6n0y4kWQbmKrrzMtwEQaCMfUHZIhn/PXAAtWGh1WSlPcpZLZ AYyrU1b4m2KAB/2TLILjlEznLF0x+to14cnRrP7UPF/6jqVKtktGyiV X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 11:00:27 -0800 (PST) We hardcode 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. Reviewed-by: Johan Hovold Signed-off-by: Konrad Dybcio --- 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; -- 2.43.0