Skip to content

Commit a58009d

Browse files
konradybcioandersson
authored andcommitted
clk: qcom: branch: Add a helper for setting the enable bit
We hardcode some clocks to be always-on, as they're essential to the functioning of the SoC / some peripherals. Add a helper to do so to make the writes less magic. Reviewed-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20240212-topic-clk_branch_en-v7-1-5b79eb7278b2@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 4297264 commit a58009d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/clk/qcom/clk-branch.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct clk_mem_branch {
6464
#define CBCR_FORCE_MEM_PERIPH_OFF BIT(12)
6565
#define CBCR_WAKEUP GENMASK(11, 8)
6666
#define CBCR_SLEEP GENMASK(7, 4)
67+
#define CBCR_CLOCK_ENABLE BIT(0)
6768

6869
static inline void qcom_branch_set_force_mem_core(struct regmap *regmap,
6970
struct clk_branch clk, bool on)
@@ -98,6 +99,11 @@ static inline void qcom_branch_set_sleep(struct regmap *regmap, struct clk_branc
9899
FIELD_PREP(CBCR_SLEEP, val));
99100
}
100101

102+
static inline void qcom_branch_set_clk_en(struct regmap *regmap, u32 cbcr)
103+
{
104+
regmap_update_bits(regmap, cbcr, CBCR_CLOCK_ENABLE, CBCR_CLOCK_ENABLE);
105+
}
106+
101107
extern const struct clk_ops clk_branch_ops;
102108
extern const struct clk_ops clk_branch2_ops;
103109
extern const struct clk_ops clk_branch_simple_ops;

0 commit comments

Comments
 (0)