[PATCH 2/2] clk: qcom: gcc-shikra: add PWM XO512 source clock
From: Taniya Das
Date: Mon Nov 16 2026 - 00:29:03 EST
Add the programmable PWM XO512 divider sourced from bi_tcxo and make
GCC_PWM0_XO512_CLK its child. This permits PWM consumers to select their
PWM core rate through the common clock framework.
Signed-off-by: Taniya Das <taniya.das@xxxxxxxxxxxxxxxx>
---
drivers/clk/qcom/gcc-shikra.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/clk/qcom/gcc-shikra.c b/drivers/clk/qcom/gcc-shikra.c
index 13c99a883e29877d9a929f26ca0b3b04b1ea0b11..93df784ba14376ecf2b60c5eb37e6d0b5cef9501 100644
--- a/drivers/clk/qcom/gcc-shikra.c
+++ b/drivers/clk/qcom/gcc-shikra.c
@@ -1888,6 +1888,21 @@ static struct clk_regmap_div gcc_usb30_prim_mock_utmi_postdiv_clk_src = {
},
};
+static struct clk_regmap_div gcc_pwm0_xo512_clk_src = {
+ .reg = 0x20030,
+ .shift = 0,
+ .width = 9,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "gcc_pwm0_xo512_clk_src",
+ .parent_data = &(const struct clk_parent_data) {
+ .index = DT_BI_TCXO
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_regmap_div_ops,
+ },
+};
+
static struct clk_branch gcc_ahb2phy_csi_clk = {
.halt_reg = 0x1d004,
.halt_check = BRANCH_HALT_DELAY,
@@ -3212,6 +3227,11 @@ static struct clk_branch gcc_pwm0_xo512_clk = {
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_pwm0_xo512_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &gcc_pwm0_xo512_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
@@ -4294,6 +4314,7 @@ static struct clk_regmap *gcc_shikra_clocks[] = {
[GPLL8_OUT_MAIN] = &gpll8_out_main.clkr,
[GPLL9] = &gpll9.clkr,
[GPLL9_OUT_MAIN] = &gpll9_out_main.clkr,
+ [GCC_PWM0_XO512_CLK_SRC] = &gcc_pwm0_xo512_clk_src.clkr,
};
static struct gdsc *gcc_shikra_gdscs[] = {
--
2.34.1