On 8/29/25 12:15 PM, Taniya Das wrote: > 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. > > Introducing 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@xxxxxxxxxxxxxxxx> > --- > drivers/clk/qcom/clk-branch.c | 14 +++++++++++--- > drivers/clk/qcom/clk-branch.h | 4 ++++ > 2 files changed, 15 insertions(+), 3 deletions(-) > > diff --git a/drivers/clk/qcom/clk-branch.c b/drivers/clk/qcom/clk-branch.c > index 0f10090d4ae681babbdbbb1b6c68ffe77af7a784..90da1c94b4736f65c87aec92303d511c4aa9a173 100644 > --- a/drivers/clk/qcom/clk-branch.c > +++ b/drivers/clk/qcom/clk-branch.c > @@ -142,8 +142,12 @@ static int clk_branch2_mem_enable(struct clk_hw *hw) > u32 val; > int ret; > > - regmap_update_bits(branch.clkr.regmap, mem_br->mem_enable_reg, > - mem_br->mem_enable_ack_mask, mem_br->mem_enable_ack_mask); > + if (mem_br->mem_enable_invert) > + regmap_update_bits(branch.clkr.regmap, mem_br->mem_enable_reg, > + mem_br->mem_enable_mask, 0); > + else > + regmap_update_bits(branch.clkr.regmap, mem_br->mem_enable_reg, > + mem_br->mem_enable_ack_mask, mem_br->mem_enable_ack_mask); regmap_assign_bits() is your friend Konrad