clk: qcom: Add support for BRANCH_HALT_SKIP flag for branch clocks
authorAmit Nischal <anischal@codeaurora.org>
Mon, 30 Apr 2018 16:20:09 +0000 (21:50 +0530)
committerStephen Boyd <sboyd@kernel.org>
Tue, 8 May 2018 18:22:55 +0000 (11:22 -0700)
There could be few clocks where the clock status bit is not
required to be polled as the clock on/off would be controlled
by enabling/disabling external source. Add support for the
same by introducing new flag named as 'BRANCH_HALT_SKIP'.

Signed-off-by: Amit Nischal <anischal@codeaurora.org>
[sboyd@kernel.org: Rename flag to BRANCH_HALT_SKIP]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/qcom/clk-branch.c
drivers/clk/qcom/clk-branch.h

index 26f7af315066f2381d10396d6d8e5b350f370032..c58c5538b1b64f849bf384e9bad7e24e8c3e0ffb 100644 (file)
@@ -77,8 +77,11 @@ static int clk_branch_wait(const struct clk_branch *br, bool enabling,
        bool voted = br->halt_check & BRANCH_VOTED;
        const char *name = clk_hw_get_name(&br->clkr.hw);
 
-       /* Skip checking halt bit if the clock is in hardware gated mode */
-       if (clk_branch_in_hwcg_mode(br))
+       /*
+        * Skip checking halt bit if we're explicitly ignoring the bit or the
+        * clock is in hardware gated mode
+        */
+       if (br->halt_check == BRANCH_HALT_SKIP || clk_branch_in_hwcg_mode(br))
                return 0;
 
        if (br->halt_check == BRANCH_HALT_DELAY || (!enabling && voted)) {
index 284df3f3c55f76c27e7abbe4db9c953b01f7581f..1702efb1c5117f3068e1c8c6421ebbdd7be05a89 100644 (file)
@@ -42,6 +42,7 @@ struct clk_branch {
 #define BRANCH_HALT_ENABLE             1 /* pol: 0 = halt */
 #define BRANCH_HALT_ENABLE_VOTED       (BRANCH_HALT_ENABLE | BRANCH_VOTED)
 #define BRANCH_HALT_DELAY              2 /* No bit to check; just delay */
+#define BRANCH_HALT_SKIP               3 /* Don't check halt bit */
 
        struct clk_regmap clkr;
 };