Lines Matching refs:br
16 static bool clk_branch_in_hwcg_mode(const struct clk_branch *br) in clk_branch_in_hwcg_mode() argument
20 if (!br->hwcg_reg) in clk_branch_in_hwcg_mode()
23 regmap_read(br->clkr.regmap, br->hwcg_reg, &val); in clk_branch_in_hwcg_mode()
25 return !!(val & BIT(br->hwcg_bit)); in clk_branch_in_hwcg_mode()
28 static bool clk_branch_check_halt(const struct clk_branch *br, bool enabling) in clk_branch_check_halt() argument
30 bool invert = (br->halt_check == BRANCH_HALT_ENABLE); in clk_branch_check_halt()
33 regmap_read(br->clkr.regmap, br->halt_reg, &val); in clk_branch_check_halt()
35 val &= BIT(br->halt_bit); in clk_branch_check_halt()
47 static bool clk_branch2_check_halt(const struct clk_branch *br, bool enabling) in clk_branch2_check_halt() argument
55 regmap_read(br->clkr.regmap, br->halt_reg, &val); in clk_branch2_check_halt()
66 static int clk_branch_wait(const struct clk_branch *br, bool enabling, in clk_branch_wait() argument
69 bool voted = br->halt_check & BRANCH_VOTED; in clk_branch_wait()
70 const char *name = clk_hw_get_name(&br->clkr.hw); in clk_branch_wait()
76 if (br->halt_check == BRANCH_HALT_SKIP || clk_branch_in_hwcg_mode(br)) in clk_branch_wait()
79 if (br->halt_check == BRANCH_HALT_DELAY || (!enabling && voted)) { in clk_branch_wait()
81 } else if (br->halt_check == BRANCH_HALT_ENABLE || in clk_branch_wait()
82 br->halt_check == BRANCH_HALT || in clk_branch_wait()
87 if (check_halt(br, enabling)) in clk_branch_wait()
101 struct clk_branch *br = to_clk_branch(hw); in clk_branch_toggle() local
112 return clk_branch_wait(br, en, check_halt); in clk_branch_toggle()