From patchwork Sat Jan 13 14:50:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 187907 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp794105dyc; Sat, 13 Jan 2024 06:51:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKWPUxkV6ewSHXdxMabBBLBlo5hoXmKfzLBSMCQQ64dpVktU/Nh+71U+dwZamZNzEhBFju X-Received: by 2002:ae9:f003:0:b0:783:3409:f6d with SMTP id l3-20020ae9f003000000b0078334090f6dmr2922544qkg.134.1705157496041; Sat, 13 Jan 2024 06:51:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705157496; cv=none; d=google.com; s=arc-20160816; b=D0OV+tSPx6Fz2CwSj8/tPSFJIhJchVnkF2ru65dRYBUgOfEazMPPwACeYw/0xgiFNm C52I/CcN9YNoE9yZYl7CjmwHPSfTqG1+NzTusvA6pZl8hI3pzrLLTspnufl0C1xtYOxG LnWFUOT/fWPNmkMZ/U+XV73Lx1JO2pVvc+1QhWu2FPDpYntiq1PlAMp+nNledJ711bbc 7yZ4fyUfDauj7qZy012NtBTiqgGND+3WEIYdOH8dab/Iv9sKFVweBOG7JwZKU0jHHuRk vsTqShx6cxOHVrJAWMUVKb0xAG1PMYv8MSuj0vQIQeK0j2vOs+nIMVyhBBsfyVEBHVDo qHzA== 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=ruXVr7MJGC6EhbaFJ69K+O9rrXjVS8sCOfK+iSqxSzCh2ZgfJwfNyeUVgJSVwBWVEZ o/i0XlM14qQDcpv/4UWBdcEW2xLoJhE1dAsCCiio56BWxRERcq7NqZ/bfoivXainzr/r B+EyISdIPMsuSYQ/8lOICdU2PBxKnJrUL6YhXrJJlD/sqcINsP3vOOyOI3mNdxA8GdYT MU+SbOjSoG/c5T+0GVlL/+hk1WHe6YxJ/ofm/Zx11q5nkrMNRpxyWagtGdoY0L/FyNlo oVThVJcXW5JGP1wahYo318b/IzSsk42zrF5K+VMusnDRG1NScQqY5jA2WBhvW9giUDXc ib8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yf04sLoI; spf=pass (google.com: domain of linux-kernel+bounces-25299-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25299-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m12-20020a05620a220c00b007830c3de57fsi4691827qkh.239.2024.01.13.06.51.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 06:51:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25299-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yf04sLoI; spf=pass (google.com: domain of linux-kernel+bounces-25299-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25299-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C3FA71C21462 for ; Sat, 13 Jan 2024 14:51:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D8444A26; Sat, 13 Jan 2024 14:51:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Yf04sLoI" Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (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 DDDFD360 for ; Sat, 13 Jan 2024 14:51:00 +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-lj1-f182.google.com with SMTP id 38308e7fff4ca-2cd64022164so76685051fa.3 for ; Sat, 13 Jan 2024 06:51:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705157458; x=1705762258; 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=Yf04sLoIHc7nj3sRv6zRciRjQbyfh19sv9ZGkt3b4PgNz7uR+3iZ1iWIvCzaSwu0aS t/zpZ0BUsgucv9rzI2PWblf36K2Q37vcnl4v7y/DmEuRCZHlC/Zjjy7lVfjhOEJsBfMp ovlXjKOZRglq75RebK3AimdFSAObRpbrKbOPTkMR0JwVn8zShLYDhotKKlfITTCOIP2l vJHc7F0wDthLhszqlFVZN87fO1o9xZmNoQYqceUKk+SAzTrd1t1I8HPu8VwWicuxok1m HXh9U0bJ3W0wU1aML25jZFH6zh6jHSJkBJvHynioKfXAt6TdaSsCKEJE8B4wk8KAJlVr ct3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705157458; x=1705762258; 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=fm8LGfUxhG0YZv6Zno9KLVktijiECWKp2RP/kPPQqia/+1qGREQ0xwfaU1GmkN0ckR tL2m1v3aObl/A8EoDAsrseiJTy390+aUH8+Tke2DQg5sgmtrYnR/g9KQysFmrMvAXMi7 XlBpaKqPyaG8QU31OhE5o5D8OvgsB2B8U4X35S9MegfzYviX/un69g+bSoFHue8K5hRt veexx2CBuGikinBccHK2e0Rqhzr+Lp0dxl5xTJoQdfu+4ITLXpR2UQqbMgSj5okEuP7C SXNNgsDKMDW+dBbRHVIemLYcdXQVjykwgPRfdFaKnyJFtQr6xcZoK08oaQ+RVW9FC/Gh jcmQ== X-Gm-Message-State: AOJu0YzxeyrcUVUhaaMeqtHy5/d5Qh/rECTOAoZo6FeW0ZR4X4hfvjIM CKwKnWwao39k6/H0QPMIEiD++OqQRysnLJCoWd34m1hpOLo= X-Received: by 2002:a2e:9f10:0:b0:2cc:f586:ce9a with SMTP id u16-20020a2e9f10000000b002ccf586ce9amr1565995ljk.93.1705157458658; Sat, 13 Jan 2024 06:50:58 -0800 (PST) Received: from [10.167.154.1] (178235179017.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.17]) by smtp.gmail.com with ESMTPSA id es18-20020a056402381200b00554b1d1a934sm3014593edb.27.2024.01.13.06.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 06:50:58 -0800 (PST) From: Konrad Dybcio Date: Sat, 13 Jan 2024 15:50:50 +0100 Subject: [PATCH v6 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 Message-Id: <20230717-topic-branch_aon_cleanup-v6-1-46d136a4e8d0@linaro.org> References: <20230717-topic-branch_aon_cleanup-v6-0-46d136a4e8d0@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v6-0-46d136a4e8d0@linaro.org> To: Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Johan Hovold , Bryan O'Donoghue X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705157455; l=1413; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Bhpm8sfSCBACZPHOO1eUmAv4id2tp/m4vWhfhP3T9EI=; b=U8t99OE+nuQKV/KjR/tksz8wIitl5avD9kp1LgyS4lurH3E9MqzA2JPAXGXRDJX/IDCa6cSd6 SaAx0i7QOGtDyUV5qS112GadjQlq3T+qOYNNNfQuNbq0DpfgQzc8Sk8 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787987226583103379 X-GMAIL-MSGID: 1787987226583103379 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 Reviewed-by: Dmitry Baryshkov --- 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;