Skip to content

Commit 7d99ced

Browse files
Amit Nischalbebarino
authored andcommitted
clk: qcom: Add support for BRANCH_HALT_SKIP flag for branch clocks
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>
1 parent 88051f5 commit 7d99ced

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/clk/qcom/clk-branch.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,11 @@ static int clk_branch_wait(const struct clk_branch *br, bool enabling,
7777
bool voted = br->halt_check & BRANCH_VOTED;
7878
const char *name = clk_hw_get_name(&br->clkr.hw);
7979

80-
/* Skip checking halt bit if the clock is in hardware gated mode */
81-
if (clk_branch_in_hwcg_mode(br))
80+
/*
81+
* Skip checking halt bit if we're explicitly ignoring the bit or the
82+
* clock is in hardware gated mode
83+
*/
84+
if (br->halt_check == BRANCH_HALT_SKIP || clk_branch_in_hwcg_mode(br))
8285
return 0;
8386

8487
if (br->halt_check == BRANCH_HALT_DELAY || (!enabling && voted)) {

drivers/clk/qcom/clk-branch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ struct clk_branch {
4242
#define BRANCH_HALT_ENABLE 1 /* pol: 0 = halt */
4343
#define BRANCH_HALT_ENABLE_VOTED (BRANCH_HALT_ENABLE | BRANCH_VOTED)
4444
#define BRANCH_HALT_DELAY 2 /* No bit to check; just delay */
45+
#define BRANCH_HALT_SKIP 3 /* Don't check halt bit */
4546

4647
struct clk_regmap clkr;
4748
};

0 commit comments

Comments
 (0)