Lines Matching +full:invert +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0
12 #include <linux/clk-provider.h>
15 #include "clk-branch.h"
21 if (!br->hwcg_reg) in clk_branch_in_hwcg_mode()
24 regmap_read(br->clkr.regmap, br->hwcg_reg, &val); in clk_branch_in_hwcg_mode()
26 return !!(val & BIT(br->hwcg_bit)); in clk_branch_in_hwcg_mode()
31 bool invert = (br->halt_check == BRANCH_HALT_ENABLE); in clk_branch_check_halt() local
34 regmap_read(br->clkr.regmap, br->halt_reg, &val); in clk_branch_check_halt()
36 val &= BIT(br->halt_bit); in clk_branch_check_halt()
37 if (invert) in clk_branch_check_halt()
47 bool invert = (br->halt_check == BRANCH_HALT_ENABLE); in clk_branch2_check_halt() local
52 regmap_read(br->clkr.regmap, br->halt_reg, &val); in clk_branch2_check_halt()
56 return (val & CBCR_CLK_OFF) == (invert ? CBCR_CLK_OFF : 0) || in clk_branch2_check_halt()
59 return (val & CBCR_CLK_OFF) == (invert ? 0 : CBCR_CLK_OFF); in clk_branch2_check_halt()
65 bool voted = br->halt_check & BRANCH_VOTED; in clk_branch_wait()
66 const char *name = clk_hw_get_name(&br->clkr.hw); in clk_branch_wait()
72 if (br->halt_check == BRANCH_HALT_SKIP || clk_branch_in_hwcg_mode(br)) in clk_branch_wait()
75 if (br->halt_check == BRANCH_HALT_DELAY || (!enabling && voted)) { in clk_branch_wait()
77 } else if (br->halt_check == BRANCH_HALT_ENABLE || in clk_branch_wait()
78 br->halt_check == BRANCH_HALT || in clk_branch_wait()
82 while (count-- > 0) { in clk_branch_wait()
89 return -EBUSY; in clk_branch_wait()
122 .enable = clk_branch_enable,
141 struct clk_branch branch = mem_br->branch; in clk_branch2_mem_enable()
145 regmap_update_bits(branch.clkr.regmap, mem_br->mem_enable_reg, in clk_branch2_mem_enable()
146 mem_br->mem_enable_ack_mask, mem_br->mem_enable_ack_mask); in clk_branch2_mem_enable()
148 ret = regmap_read_poll_timeout(branch.clkr.regmap, mem_br->mem_ack_reg, in clk_branch2_mem_enable()
149 val, val & mem_br->mem_enable_ack_mask, 0, 200); in clk_branch2_mem_enable()
151 WARN(1, "%s mem enable failed\n", clk_hw_get_name(&branch.clkr.hw)); in clk_branch2_mem_enable()
162 regmap_update_bits(mem_br->branch.clkr.regmap, mem_br->mem_enable_reg, in clk_branch2_mem_disable()
163 mem_br->mem_enable_ack_mask, 0); in clk_branch2_mem_disable()
169 .enable = clk_branch2_mem_enable,
176 .enable = clk_branch2_enable,
183 .enable = clk_branch2_enable,
189 .enable = clk_enable_regmap,