Skip to content

Commit aa788d3

Browse files
taniyadas20andersson
authored andcommitted
clk: qcom: branch: Extend invert logic for branch2 mem clocks
Some clock branches require inverted logic for memory gating, where disabling the memory involves setting a bit and enabling it involves clearing the same bit. This behavior differs from the standard approach memory branch clocks ops where enabling typically sets the bit. The mem_enable_invert to allow conditional handling of these sequences of the inverted control logic for memory operations required on those memory clock branches. Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com> Reviewed-by: Imran Shaik <imran.shaik@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20251118-sm8750-videocc-v2-v4-3-049882a70c9f@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 53a1895 commit aa788d3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/clk/qcom/clk-branch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ static int clk_branch2_mem_enable(struct clk_hw *hw)
142142
u32 val;
143143
int ret;
144144

145-
regmap_update_bits(branch.clkr.regmap, mem_br->mem_enable_reg,
146-
mem_br->mem_enable_ack_mask, mem_br->mem_enable_ack_mask);
145+
regmap_assign_bits(branch.clkr.regmap, mem_br->mem_enable_reg,
146+
mem_br->mem_enable_mask, !mem_br->mem_enable_invert);
147147

148148
ret = regmap_read_poll_timeout(branch.clkr.regmap, mem_br->mem_ack_reg,
149149
val, val & mem_br->mem_enable_ack_mask, 0, 200);
@@ -159,8 +159,8 @@ static void clk_branch2_mem_disable(struct clk_hw *hw)
159159
{
160160
struct clk_mem_branch *mem_br = to_clk_mem_branch(hw);
161161

162-
regmap_update_bits(mem_br->branch.clkr.regmap, mem_br->mem_enable_reg,
163-
mem_br->mem_enable_ack_mask, 0);
162+
regmap_assign_bits(mem_br->branch.clkr.regmap, mem_br->mem_enable_reg,
163+
mem_br->mem_enable_mask, mem_br->mem_enable_invert);
164164

165165
return clk_branch2_disable(hw);
166166
}

0 commit comments

Comments
 (0)