From: Taniya Das <quic_tdas@quicinc.com>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Richard Cochran <richardcochran@gmail.com>,
Conor Dooley <conor+dt@kernel.org>,
Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Imran Shaik <quic_imrashai@quicinc.com>,
<linux-arm-msm@vger.kernel.org>, <linux-clk@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<netdev@vger.kernel.org>, <jkona@quicinc.com>,
<quic_rohiagar@quicinc.com>, Taniya Das <quic_tdas@quicinc.com>
Subject: [PATCH V2 1/5] clk: qcom: branch: Extend the invert logic for branch2 clocks
Date: Fri, 12 May 2023 17:53:43 +0530 [thread overview]
Message-ID: <20230512122347.1219-2-quic_tdas@quicinc.com> (raw)
In-Reply-To: <20230512122347.1219-1-quic_tdas@quicinc.com>
From: Imran Shaik <quic_imrashai@quicinc.com>
Add support to handle the invert logic for branch2 clocks.
Invert branch halt would indicate the clock ON when CLK_OFF
bit is '1' and OFF when CLK_OFF bit is '0'.
Signed-off-by: Imran Shaik <quic_imrashai@quicinc.com>
Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
---
Changes since v1:
- Removed the multiple returns from inside clk_branch2_check_halt.
drivers/clk/qcom/clk-branch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/qcom/clk-branch.c b/drivers/clk/qcom/clk-branch.c
index ca896ebf7e1b..fc4735f74f0f 100644
--- a/drivers/clk/qcom/clk-branch.c
+++ b/drivers/clk/qcom/clk-branch.c
@@ -43,6 +43,7 @@ static bool clk_branch2_check_halt(const struct clk_branch *br, bool enabling)
{
u32 val;
u32 mask;
+ bool invert = (br->halt_check == BRANCH_HALT_ENABLE);
mask = CBCR_NOC_FSM_STATUS;
mask |= CBCR_CLK_OFF;
@@ -51,11 +52,10 @@ static bool clk_branch2_check_halt(const struct clk_branch *br, bool enabling)
if (enabling) {
val &= mask;
- return (val & CBCR_CLK_OFF) == 0 ||
+ return (val & CBCR_CLK_OFF) == (invert ? CBCR_CLK_OFF : 0) ||
FIELD_GET(CBCR_NOC_FSM_STATUS, val) == FSM_STATUS_ON;
- } else {
- return val & CBCR_CLK_OFF;
}
+ return (val & CBCR_CLK_OFF) == (invert ? 0 : CBCR_CLK_OFF);
}
static int clk_branch_wait(const struct clk_branch *br, bool enabling,
--
2.17.1
next prev parent reply other threads:[~2023-05-12 12:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 12:23 [PATCH V2 0/5] Add GCC and RPMHCC support for sdx75 Taniya Das
2023-05-12 12:23 ` Taniya Das [this message]
2023-05-12 12:23 ` [PATCH V2 2/5] dt-bindings: clock: qcom: Add GCC clocks for SDX75 Taniya Das
2023-05-12 16:52 ` Krzysztof Kozlowski
2023-05-12 12:23 ` [PATCH V2 3/5] dt-bindings: clock: qcom: Add RPMHCC " Taniya Das
2023-05-12 16:53 ` Krzysztof Kozlowski
2023-05-12 12:23 ` [PATCH V2 4/5] clk: qcom: rpmh: Add RPMH clocks support " Taniya Das
2023-05-12 12:23 ` [PATCH V2 5/5] clk: qcom: Add GCC driver " Taniya Das
2023-05-25 4:54 ` (subset) [PATCH V2 0/5] Add GCC and RPMHCC support for sdx75 Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230512122347.1219-2-quic_tdas@quicinc.com \
--to=quic_tdas@quicinc.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jkona@quicinc.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=netdev@vger.kernel.org \
--cc=quic_imrashai@quicinc.com \
--cc=quic_rohiagar@quicinc.com \
--cc=richardcochran@gmail.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®