Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7126375rdb; Wed, 3 Jan 2024 05:37:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFM4z2J3PTrV3OcA4E/MocJo/WNN1t251ej+XcYLYxeh29YIB8d4KAK1pu/g8j6GUQ34PQq X-Received: by 2002:a05:6358:5923:b0:175:59fc:3e32 with SMTP id g35-20020a056358592300b0017559fc3e32mr824601rwf.27.1704289056545; Wed, 03 Jan 2024 05:37:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704289056; cv=none; d=google.com; s=arc-20160816; b=UnRMnKKZuIP/9RycR9WMnqQWaEPpMxuPp621xi8McWCs/hqbMipjvELTLDAsQTENxq 4Nt6nNWDwpfa8rC3m5QIgUBuH+FcXErHsRymeNKyrewhfQFOuQTMInzZtWQee30LF06m HA4+kAnEl6Y9h0QvhrBoT6UHD3w4Z9STSU4xvbY1UWkEyggJfx7QDgj9aQ5ZDnqEvNsS IP9IsaP9Jh2ErKxvbrhm7ty5OaFcY+DjeGgp5qvTNcVm7G4U2jLO+VL4WSgDa2tvFaM3 SoaM0FMRsNkppa85A7qKzL1+aMrEeGKjHKtzknZZOVsG5c5lHqvebOkQB1+i8G4PDPPP mHLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=XfDCSXNar/0OypW7xIXC/SzvfN+SSQCc1nv247H/a24=; fh=MkFdVN+LDhRMwYZGMbT0hIwVISxx/ufGkS/k1knkCCE=; b=Wu/VoVSjK6lFydI+eaPLbqi6cX7nhSieRjvRMVZpRAnp5mWslnDpArcfwpcHIx9OIp /EW+wZda8mmlyun6ucsZ34zpvps8ZlgSuL9pE40KoldFtWmfhabNwB0QwAPydoudHret dkgae23Sxf4opsdMaUJdbR86ktF1FkgGy2+jWPf2kSgeCAhbzdTFyXW6IeREarMi4HnM tDGMRYiB2dAONN8ftknraZpAZy/e6AGUA/RNwjbD+5DFPYCfcmSTcP/BBrrm+V7SmRhe Wr5rIvXFHhHdgkzDLkr6QI60xNJscVSrntI54tdxQNmHd27w00geBuKtasI6TUOdRd7T A8RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IgvJB4hV; spf=pass (google.com: domain of linux-kernel+bounces-15591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z197-20020a6333ce000000b005cde3cc04c5si21529872pgz.821.2024.01.03.05.37.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:37:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IgvJB4hV; spf=pass (google.com: domain of linux-kernel+bounces-15591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 32C1B2845FB for ; Wed, 3 Jan 2024 13:37:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE1411A594; Wed, 3 Jan 2024 13:37:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IgvJB4hV" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2703A19BDC for ; Wed, 3 Jan 2024 13:37:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a271a28aeb4so660681766b.2 for ; Wed, 03 Jan 2024 05:37:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704289021; x=1704893821; 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=XfDCSXNar/0OypW7xIXC/SzvfN+SSQCc1nv247H/a24=; b=IgvJB4hVyHg3hf8XIM99RSVYOwlXZfk5qn3T/BwJuk6CeCupv890n2qKQn4ELULmcs nUGNfHEEVDRGQWpF6ysdnJCSkwmjlfQFaGyeilcqpeMf7b9a1vg8i4viJ2/R6D2Gk4KN NpM45rkW8lDXSJ+93um1cwn57l+1AYZQ+/I/UEIVdray/VdE9Mo8GPNafgPGKKLYGmtE U01MjvQLuRmIFKIdn3gQLIllgkg3GSQLpN+dJz/Lw0FIKI/6S1qFQhpo4f+NkYYI0vMV T4ACS9eEUQ/u7masbITeJDRJgWkekwCLrUAOLcF3yrxm58OOqKJk05vm4gr1XxFhbMqZ W3kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704289021; x=1704893821; 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=XfDCSXNar/0OypW7xIXC/SzvfN+SSQCc1nv247H/a24=; b=KhQDf2feg9prZrvahed/oFa2ReceWBB/dYB4feKa9+w6dLFDOgYwUC6I4vjYW3Dtms XIUr49pfXTnbgDfpvK8YZk9EcRowVepjGzrBTxF4p+4nZmsBKzyhlOhcnt5ktrlioMbD pC8ocATsgx2RiUwbJdG+9bVL3FvvXxhLauGzfGgpF0b/YeKTZ0SOaNOOvJOlz9Rf6z4l HwqlAxvV9Lh2Qfegf1ZD0qDDWv5CekKljTtHhj149okEoO6kueZkgJ7GU9BrSGCYHL4Z vbuo5bYXhecH6pv+wVugl1EW6gMWIwEjor3cpzNYsxqqHTt2N0O6/FzZQocJCHlqv7dx WjBQ== X-Gm-Message-State: AOJu0YyLTr9LihoU3l0y1XKhJWUaZ7xoscuabxJIn62QYx+7sJxFS4TI Cd2kFhNVdBx+w5ggm4FiEjCeHvWKQOmG9w== X-Received: by 2002:a17:906:8910:b0:a27:5343:d3e8 with SMTP id fr16-20020a170906891000b00a275343d3e8mr4661410ejc.97.1704289021333; Wed, 03 Jan 2024 05:37:01 -0800 (PST) Received: from [10.167.154.1] (178235179036.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.36]) by smtp.gmail.com with ESMTPSA id cl2-20020a170906c4c200b00a275637e699sm6474351ejb.166.2024.01.03.05.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:37:01 -0800 (PST) From: Konrad Dybcio Date: Wed, 03 Jan 2024 14:35:59 +0100 Subject: [PATCH v5 01/12] clk: qcom: branch: Add a helper for setting the enable bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230717-topic-branch_aon_cleanup-v5-1-99942e6bf1ba@linaro.org> References: <20230717-topic-branch_aon_cleanup-v5-0-99942e6bf1ba@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v5-0-99942e6bf1ba@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 , Bryan O'Donoghue X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1704289018; l=1413; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Bhpm8sfSCBACZPHOO1eUmAv4id2tp/m4vWhfhP3T9EI=; b=hEZH4a69zyBqaQHiB5GodkQDXw08IHWnibGhlyALGGLFuAseNs0NvKha96pN6FJfWQb2xmkJL 70H7xhOF6ikC2pE3knApl7HawF5a8QnHmPCx9eCtcxaXKpH2FNOuCJM X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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 Reviewed-by: Bryan O'Donoghue 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 8ffed603c050..0514bc43100b 100644 --- a/drivers/clk/qcom/clk-branch.h +++ b/drivers/clk/qcom/clk-branch.h @@ -64,6 +64,7 @@ struct clk_mem_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) @@ -98,6 +99,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