* [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support
@ 2026-10-26 11:29 Taniya Das
2026-10-26 11:29 ` [PATCH v2 01/12] dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider Taniya Das
` (11 more replies)
0 siblings, 12 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das, Konrad Dybcio
The Peripheral Web PDM block on several Qualcomm SoCs contains a GP_MN
fractional divider that generates a clock output from the PDM XO4 clock.
The output can be routed to a dedicated GPIO pin for use as an external
reference clock.
This series adds the binding, a runtime PM-aware GP_MN divider driver,
and the GCC, pinctrl, and DT support needed on QCS615, QCS8300, SA8775P,
and SC7280. GP_MN controller nodes are disabled by default so boards must
explicitly opt in before the output pin is muxed.
Changes in v2:
- Add SoC-specific compatible strings with a qcom,sc7280-gp-mnd
fallback, map the 0x1000-byte register region, and document the PDM
source rates. [#Konrad Dybcio]
- Use runtime PM and pm_clk for AHB register-access clock management,
rely on the pinctrl core's default-state selection, and generate the
output-clock name. [#Dmitry Baryshkov]
- Enforce valid GP_MN duty-cycle constraints and report high-phase duty
cycles through the common clock framework.
- Add and register configurable PDM XO4 divider clocks and their public
IDs for all supported SoCs, allowing the source rate to be configured.
- Split the pinctrl changes by SoC, retain Reviewed-by tags, and combine
each SoC's pin state and controller node into one DTS patch.
[#Konrad Dybcio]
- Correct the SC7280 output to gpio60 and disable every GP_MN controller
node by default. Add QCS615 support as well. [#Luca Weiss]
- Link[v1]: https://lore.kernel.org/lkml/20260602-pdm_clk_gp_mnd_v1-v1-0-1522662b6c53@oss.qualcomm.com/
The series is organized as follows:
1. DT binding for the PDM GP_MN divider
2. GCC PDM XO4 divider clock IDs
3. PDM GP_MN divider driver
4. GCC PDM XO4 divider clocks
5-8. GP_MN pin mux support for QCS8300, SA8775P, SC7280, and QCS615
9-12. GP_MN DT support for QCS8300, SA8775P, SC7280, and QCS615
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
Taniya Das (12):
dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider
dt-bindings: clock: qcom: Add PDM XO4 divider clock IDs
clk: qcom: Add a driver for PDM GP_MN fractional clock divider
clk: qcom: gcc: Add configurable PDM XO4 div clocks across targets
pinctrl: qcom: qcs8300: Add gp_mn mux function
pinctrl: qcom: sa8775p: Add gp_mn mux function
pinctrl: qcom: sc7280: Add gp_mn mux function
pinctrl: qcom: qcs615: Add gp_mn mux function
arm64: dts: qcom: qcs8300: Add GP M/N clock controller
arm64: dts: qcom: sa8775p: Add GP M/N clock controller
arm64: dts: qcom: sc7280: Add GP M/N clock controller
arm64: dts: qcom: qcs615: Add GP M/N clock controller
.../devicetree/bindings/clock/qcom,clk-gp-mnd.yaml | 98 ++++++
arch/arm64/boot/dts/qcom/kodiak.dtsi | 21 ++
arch/arm64/boot/dts/qcom/lemans.dtsi | 21 ++
arch/arm64/boot/dts/qcom/monaco.dtsi | 21 ++
arch/arm64/boot/dts/qcom/talos.dtsi | 21 ++
drivers/clk/qcom/Kconfig | 15 +
drivers/clk/qcom/Makefile | 1 +
drivers/clk/qcom/clk-gp-mnd.c | 333 +++++++++++++++++++++
drivers/clk/qcom/gcc-qcs615.c | 20 ++
drivers/clk/qcom/gcc-qcs8300.c | 20 ++
drivers/clk/qcom/gcc-sa8775p.c | 20 ++
drivers/clk/qcom/gcc-sc7280.c | 20 ++
drivers/pinctrl/qcom/pinctrl-qcs615.c | 8 +-
drivers/pinctrl/qcom/pinctrl-qcs8300.c | 9 +-
drivers/pinctrl/qcom/pinctrl-sa8775p.c | 8 +-
drivers/pinctrl/qcom/pinctrl-sc7280.c | 8 +-
include/dt-bindings/clock/qcom,gcc-sc7280.h | 1 +
include/dt-bindings/clock/qcom,qcs615-gcc.h | 2 +
include/dt-bindings/clock/qcom,qcs8300-gcc.h | 1 +
include/dt-bindings/clock/qcom,sa8775p-gcc.h | 1 +
20 files changed, 645 insertions(+), 4 deletions(-)
---
base-commit: 4eb2586bd40db27d77cc5b724ca9386ed0c71d53
change-id: 20261013-b4-pdm_clk_gp_mnd_v2-993396fc6cac
Best regards,
--
Taniya Das <taniya.das@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 01/12] dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-27 18:47 ` Krzysztof Kozlowski
2026-10-26 11:29 ` [PATCH v2 02/12] dt-bindings: clock: qcom: Add PDM XO4 divider clock IDs Taniya Das
` (10 subsequent siblings)
11 siblings, 1 reply; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
Add device tree bindings for the Qualcomm Peripheral Web's PDM GP_MN
clock divider. The hardware generates a fractional output frequency
from a fixed input clock (typically TCXO4) using the relation
Fout = Fin * (M / N), with duty cycle controlled by a separate D
register. The clock output is routed over a gpio controlled pin.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
.../devicetree/bindings/clock/qcom,clk-gp-mnd.yaml | 98 ++++++++++++++++++++++
1 file changed, 98 insertions(+)
diff --git a/Documentation/devicetree/bindings/clock/qcom,clk-gp-mnd.yaml b/Documentation/devicetree/bindings/clock/qcom,clk-gp-mnd.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..8141f392c5d70acfc42cf1ff4b1722e1eff23afa
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,clk-gp-mnd.yaml
@@ -0,0 +1,98 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,clk-gp-mnd.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Peripheral Web's PDM GP_MN Clock Divider
+
+maintainers:
+ - Taniya Das <taniya.das@oss.qualcomm.com>
+
+description: |
+ The Peripheral Web's PDM GP_MN clock divider receives an input clock
+ (TCXO4) with frequency Fin and generates an output clock with
+ frequency Fout = Fin * (M / N) and a duty cycle controlled by D
+ and routed over a gpio pin.
+
+ The divider is configured using three registers:
+
+ - GP_MN_CLK_MDIV: holds the M value.
+ - GP_MN_CLK_NDIV: holds the ones complement of (N - M).
+ - GP_MN_CLK_DUTY: holds the D value.
+
+ For every N input clock cycles the GP_MN produces M output clock
+ cycles. D is the number of native clock cycles in which the GP_MN
+ output is low, counted over 2^13 native clock cycles.
+
+ Hardware constraints:
+
+ M <= 511
+ N <= 8191
+ N > 2 * M
+ M < D < (N - M)
+ M and N must be coprime (no common divisor)
+
+properties:
+ compatible:
+ oneOf:
+ - const: qcom,sc7280-gp-mnd
+ - items:
+ - enum:
+ - qcom,sa8775p-gp-mnd
+ - qcom,qcs8300-gp-mnd
+ - qcom,qcs615-gp-mnd
+ - const: qcom,sc7280-gp-mnd
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: PDM XO4 source clock
+ - description: PDM AHB bus clock for register access
+
+ clock-names:
+ items:
+ - const: pdm_clk
+ - const: ahb_clk
+
+ '#clock-cells':
+ const: 0
+
+ assigned-clocks:
+ maxItems: 1
+ description: Parent clock phandle used to set the input frequency.
+
+ assigned-clock-rates:
+ maxItems: 1
+ description: |
+ Rate for the parent clock in Hz.
+ Supported rates: 19200000, 9600000, 6400000, 4800000.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - '#clock-cells'
+ - assigned-clocks
+ - assigned-clock-rates
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/qcom,gcc-sc7280.h>
+ gp_mn: clock-controller@88d3000 {
+ compatible = "qcom,sc7280-gp-mnd";
+ reg = <0x88d3000 0x1000>;
+ clocks = <&gcc GCC_PDM_XO4_CLK>,
+ <&gcc GCC_PDM_AHB_CLK>;
+ clock-names = "pdm_clk", "ahb_clk";
+ pinctrl-0 = <&gp_mn_pin_active>;
+ pinctrl-names = "default";
+ assigned-clocks = <&gcc GCC_PDM_XO4_CLK>;
+ assigned-clock-rates = <4800000>;
+ #clock-cells = <0>;
+ };
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 02/12] dt-bindings: clock: qcom: Add PDM XO4 divider clock IDs
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
2026-10-26 11:29 ` [PATCH v2 01/12] dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 11:29 ` [PATCH v2 03/12] clk: qcom: Add a driver for PDM GP_MN fractional clock divider Taniya Das
` (9 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
Add clock IDs for the PDM XO4 divider sources on QCS615, QCS8300,
SA8775P, and SC7280. The corresponding GCC drivers use these IDs to
register the divider clocks.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
include/dt-bindings/clock/qcom,gcc-sc7280.h | 1 +
include/dt-bindings/clock/qcom,qcs615-gcc.h | 2 ++
include/dt-bindings/clock/qcom,qcs8300-gcc.h | 1 +
include/dt-bindings/clock/qcom,sa8775p-gcc.h | 1 +
4 files changed, 5 insertions(+)
diff --git a/include/dt-bindings/clock/qcom,gcc-sc7280.h b/include/dt-bindings/clock/qcom,gcc-sc7280.h
index 3d5724b79bff18a858bdbb5c1654c5174e8cb23b..68dfd6616ce4b1c1e41f11603be639685301129f 100644
--- a/include/dt-bindings/clock/qcom,gcc-sc7280.h
+++ b/include/dt-bindings/clock/qcom,gcc-sc7280.h
@@ -192,6 +192,7 @@
#define GCC_WPSS_RSCP_CLK 182
#define GCC_EDP_CLKREF_EN 183
#define GCC_SEC_CTRL_CLK_SRC 184
+#define GCC_PDM_XO4_DIV_CLK_SRC 185
/* GCC power domains */
#define GCC_PCIE_0_GDSC 0
diff --git a/include/dt-bindings/clock/qcom,qcs615-gcc.h b/include/dt-bindings/clock/qcom,qcs615-gcc.h
index 9704091636b87108a2a8c5ccc4a6b293829d8272..cddf21466a96a2990f1aaaf7c655fa6a4369ccbd 100644
--- a/include/dt-bindings/clock/qcom,qcs615-gcc.h
+++ b/include/dt-bindings/clock/qcom,qcs615-gcc.h
@@ -175,6 +175,8 @@
#define GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK 165
#define GCC_UFS_PHY_UNIPRO_CORE_HW_CTL_CLK 166
+#define GCC_PDM_XO4_DIV_CLK_SRC 167
+
/* GCC Resets */
#define GCC_EMAC_BCR 0
#define GCC_QUSB2PHY_PRIM_BCR 1
diff --git a/include/dt-bindings/clock/qcom,qcs8300-gcc.h b/include/dt-bindings/clock/qcom,qcs8300-gcc.h
index 3c674c7baaba91815b13450e647b41053bd7330d..cee26f50092044f4a0b4cead6f669f0ccf7343c0 100644
--- a/include/dt-bindings/clock/qcom,qcs8300-gcc.h
+++ b/include/dt-bindings/clock/qcom,qcs8300-gcc.h
@@ -196,6 +196,7 @@
#define GCC_TSCSS_CNTR_CLK_SRC 186
#define GCC_TSCSS_ETU_CLK 187
#define GCC_TSCSS_GLOBAL_CNTR_CLK 188
+#define GCC_PDM_XO4_DIV_CLK_SRC 189
/* GCC power domains */
#define GCC_EMAC0_GDSC 0
diff --git a/include/dt-bindings/clock/qcom,sa8775p-gcc.h b/include/dt-bindings/clock/qcom,sa8775p-gcc.h
index 01f54234963d6a531926103f8658307d4e0662f2..e101c9b565d650495e63f5f97b3458375d0e85ec 100644
--- a/include/dt-bindings/clock/qcom,sa8775p-gcc.h
+++ b/include/dt-bindings/clock/qcom,sa8775p-gcc.h
@@ -257,6 +257,7 @@
#define GCC_UFS_PHY_ICE_CORE_HW_CTL_CLK 246
#define GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK 247
#define GCC_UFS_PHY_UNIPRO_CORE_HW_CTL_CLK 248
+#define GCC_PDM_XO4_DIV_CLK_SRC 249
/* GCC resets */
#define GCC_CAMERA_BCR 0
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 03/12] clk: qcom: Add a driver for PDM GP_MN fractional clock divider
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
2026-10-26 11:29 ` [PATCH v2 01/12] dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider Taniya Das
2026-10-26 11:29 ` [PATCH v2 02/12] dt-bindings: clock: qcom: Add PDM XO4 divider clock IDs Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 11:29 ` [PATCH v2 04/12] clk: qcom: gcc: Add configurable PDM XO4 div clocks across targets Taniya Das
` (8 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
The PDM (Pulse Density Modulation) hardware block on Qualcomm SoCs
contains a GP_MN clock divider that produces a fractional output
frequency from a fixed input clock (typically TCXO4):
Fout = Fin * (M / N)
The hardware encodes the period in the NDIV register as the 1's
complement of (N - M), and controls the duty cycle via a separate
DUTY register that counts the number of low-phase native clock
cycles over the period N.
Add a standalone platform driver for this block that uses
rational_best_approximation() to find the closest M/N pair within
the 9-bit M and 13-bit N hardware limits. Reject ratios which cannot
support a valid duty cycle, and program the MDIV, NDIV, and DUTY
registers via regmap. Implement determine_rate, set_rate,
recalc_rate, get_duty_cycle, and set_duty_cycle operations. The PDM
AHB bus clock is gated around every register access.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
drivers/clk/qcom/Kconfig | 15 ++
drivers/clk/qcom/Makefile | 1 +
drivers/clk/qcom/clk-gp-mnd.c | 333 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 349 insertions(+)
diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
index 27d0ab24d50a4ca5587ed8d6085c4d6fcd57eb8c..d9f1df77b715b08a32c164a6d25d88fc545f59cb 100644
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
@@ -2148,4 +2148,19 @@ config SM_VIDEOCC_8450
SM8450 or SM8475 devices.
Say Y if you want to support video devices and functionality such as
video encode/decode.
+
+config QCOM_CLK_GP_MND
+ tristate "Qualcomm PDM GP_MN clock divider"
+ depends on ARM64 || COMPILE_TEST
+ help
+ Support for the Qualcomm PDM GP_MN clock divider found in PDM
+ (Pulse Density Modulation) hardware blocks.
+ Given an input clock of frequency Fin (TCXO4), the output
+ frequency is Fout = Fin * (M / N). For every N input cycles
+ the divider produces M output cycles. D controls the duty
+ cycle: it is the number of native clock cycles in which the
+ GP_MN output is low, counted over 8192 native clock cycles.
+
+ Say Y or M if you want to support GP_MN-based frequency and
+ duty-cycle configuration on Qualcomm SoCs.
endif
diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
index 6affb5073f269d18f1b78d6c7f92e14baeade1e5..4e8563be8e1b99aef48b227ff0c5dc04dc092d0a 100644
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
@@ -227,6 +227,7 @@ obj-$(CONFIG_SM_VIDEOCC_8550) += videocc-sm8550.o
obj-$(CONFIG_SM_VIDEOCC_8750) += videocc-sm8750.o
obj-$(CONFIG_SM_VIDEOCC_MILOS) += videocc-milos.o
obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o
+obj-$(CONFIG_QCOM_CLK_GP_MND) += clk-gp-mnd.o
obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o
obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
obj-$(CONFIG_KRAITCC) += krait-cc.o
diff --git a/drivers/clk/qcom/clk-gp-mnd.c b/drivers/clk/qcom/clk-gp-mnd.c
new file mode 100644
index 0000000000000000000000000000000000000000..818726c02b615689928cf09b4b34f0889d4246d8
--- /dev/null
+++ b/drivers/clk/qcom/clk-gp-mnd.c
@@ -0,0 +1,333 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/pm_clock.h>
+#include <linux/pm_runtime.h>
+#include <linux/rational.h>
+#include <linux/regmap.h>
+
+/*
+ * PDM GP_MND clock divider register offsets.
+ *
+ * The hardware computes:
+ * Fout = Fin * (M / N)
+ *
+ * with duty cycle controlled by D, where M < D < (N - M).
+ *
+ * Register encoding:
+ * MDIV = M
+ * NDIV = ~(N - M) [1's complement of (N - M), masked to N_REG_WIDTH bits]
+ * DUTY = D
+ */
+#define GP_MND_MDIV_REG 0x0
+#define GP_MND_NDIV_REG 0x4
+#define GP_MND_DUTY_REG 0x8
+
+#define GP_MND_M_WIDTH 9
+#define GP_MND_N_WIDTH 13
+
+#define GP_MND_MAX_M GENMASK(GP_MND_M_WIDTH - 1, 0)
+#define GP_MND_MAX_N GENMASK(GP_MND_N_WIDTH - 1, 0)
+
+/**
+ * struct clk_gp_mnd - GP_MND fractional clock divider
+ * @dev: device for runtime PM
+ * @regmap: register map for the PDM block
+ * @hw: handle between common and hardware-specific interfaces
+ * @m_val: M value (numerator)
+ * @n_val: N value (period)
+ */
+struct clk_gp_mnd {
+ struct device *dev;
+ struct regmap *regmap;
+ struct clk_hw hw;
+ unsigned int m_val;
+ unsigned int n_val;
+};
+
+#define to_clk_gp_mnd(_hw) container_of(_hw, struct clk_gp_mnd, hw)
+
+static int gp_mnd_clk_runtime_resume(struct clk_gp_mnd *gp)
+{
+ return pm_runtime_resume_and_get(gp->dev);
+}
+
+static void gp_mnd_clk_runtime_put(struct clk_gp_mnd *gp)
+{
+ pm_runtime_put(gp->dev);
+}
+
+static int gp_mnd_clk_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
+{
+ unsigned long m = 0, n = 0;
+
+ rational_best_approximation(req->rate, req->best_parent_rate,
+ (unsigned long)GP_MND_MAX_M,
+ (unsigned long)GP_MND_MAX_N,
+ &m, &n);
+ if (!m || !n)
+ return -EINVAL;
+
+ if (n <= 2 * m + 1)
+ return -EINVAL;
+
+ req->rate = DIV_ROUND_CLOSEST_ULL((u64)req->best_parent_rate * m, n);
+
+ return 0;
+}
+
+static int gp_mnd_clk_set_rate(struct clk_hw *hw, unsigned long rate,
+ unsigned long parent_rate)
+{
+ struct clk_gp_mnd *gp = to_clk_gp_mnd(hw);
+ unsigned long m = 0, n = 0;
+ unsigned int d_val, n_val;
+ int ret;
+
+ rational_best_approximation(rate, parent_rate,
+ (unsigned long)GP_MND_MAX_M,
+ (unsigned long)GP_MND_MAX_N,
+ &m, &n);
+ if (!m || !n)
+ return -EINVAL;
+
+ if (n <= 2 * m + 1)
+ return -EINVAL;
+
+ ret = gp_mnd_clk_runtime_resume(gp);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(gp->regmap, GP_MND_MDIV_REG, m);
+ if (ret)
+ goto err_runtime_put;
+
+ /* N divider holds the 1's complement of (N - M), N_WIDTH bits wide */
+ n_val = ~(n - m) & GP_MND_MAX_N;
+ ret = regmap_write(gp->regmap, GP_MND_NDIV_REG, n_val);
+ if (ret)
+ goto err_runtime_put;
+
+ /* Program the closest-to-50% duty cycle. */
+ d_val = n / 2;
+ ret = regmap_write(gp->regmap, GP_MND_DUTY_REG, d_val);
+ if (ret)
+ goto err_runtime_put;
+
+ gp->m_val = m;
+ gp->n_val = n;
+
+err_runtime_put:
+ gp_mnd_clk_runtime_put(gp);
+
+ return ret;
+}
+
+static unsigned long gp_mnd_clk_recalc_rate(struct clk_hw *hw,
+ unsigned long parent_rate)
+{
+ struct clk_gp_mnd *gp = to_clk_gp_mnd(hw);
+ unsigned int m_val, n_val;
+ int ret;
+
+ ret = gp_mnd_clk_runtime_resume(gp);
+ if (ret)
+ return 0;
+
+ ret = regmap_read(gp->regmap, GP_MND_MDIV_REG, &m_val);
+ if (ret)
+ goto out_runtime_put;
+
+ m_val &= GP_MND_MAX_M;
+
+ ret = regmap_read(gp->regmap, GP_MND_NDIV_REG, &n_val);
+ if (ret)
+ goto out_runtime_put;
+
+ /* Reverse the 1's complement encoding: N = ~NDIV_REG + M */
+ n_val = (~n_val & GP_MND_MAX_N) + m_val;
+
+out_runtime_put:
+ gp_mnd_clk_runtime_put(gp);
+
+ if (ret)
+ return 0;
+
+ if (!n_val)
+ return 0;
+
+ gp->m_val = m_val;
+ gp->n_val = n_val;
+
+ return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * m_val, n_val);
+}
+
+static int gp_mnd_clk_get_duty_cycle(struct clk_hw *hw, struct clk_duty *duty)
+{
+ struct clk_gp_mnd *gp = to_clk_gp_mnd(hw);
+ unsigned int d_val;
+ int ret;
+
+ if (!gp->n_val) {
+ duty->num = 1;
+ duty->den = 2;
+ return 0;
+ }
+
+ ret = gp_mnd_clk_runtime_resume(gp);
+ if (ret)
+ return ret;
+
+ ret = regmap_read(gp->regmap, GP_MND_DUTY_REG, &d_val);
+
+ gp_mnd_clk_runtime_put(gp);
+
+ if (ret)
+ return ret;
+
+ if (d_val >= gp->n_val)
+ return -EINVAL;
+
+ /* DUTY stores the low-phase count; report the high-phase duty cycle. */
+ duty->num = gp->n_val - d_val;
+ duty->den = gp->n_val;
+
+ return 0;
+}
+
+static int gp_mnd_clk_set_duty_cycle(struct clk_hw *hw, struct clk_duty *duty)
+{
+ struct clk_gp_mnd *gp = to_clk_gp_mnd(hw);
+ unsigned int d_val;
+ int ret;
+
+ if (!gp->n_val || !gp->m_val || !duty->den || duty->num > duty->den)
+ return -EINVAL;
+
+ /* D = (1 - duty) * N, giving the low-phase count */
+ d_val = DIV_ROUND_UP((u64)(duty->den - duty->num) * gp->n_val, duty->den);
+
+ /* Hardware constraint: M < D < (N - M) */
+ if (d_val <= gp->m_val || d_val >= (gp->n_val - gp->m_val))
+ return -EINVAL;
+
+ ret = gp_mnd_clk_runtime_resume(gp);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(gp->regmap, GP_MND_DUTY_REG, d_val);
+
+ gp_mnd_clk_runtime_put(gp);
+
+ return ret;
+}
+
+static const struct clk_ops clk_gp_mnd_ops = {
+ .determine_rate = gp_mnd_clk_determine_rate,
+ .set_rate = gp_mnd_clk_set_rate,
+ .recalc_rate = gp_mnd_clk_recalc_rate,
+ .get_duty_cycle = gp_mnd_clk_get_duty_cycle,
+ .set_duty_cycle = gp_mnd_clk_set_duty_cycle,
+};
+
+static const struct regmap_config gp_mnd_regmap_config = {
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+ .fast_io = true,
+};
+
+static int clk_gp_mnd_probe(struct platform_device *pdev)
+{
+ struct clk_parent_data parent_data = { .index = 0 };
+ struct clk_init_data init = {
+ .name = "gp_mn_clk",
+ .ops = &clk_gp_mnd_ops,
+ .parent_data = &parent_data,
+ .num_parents = 1,
+ .flags = CLK_GET_RATE_NOCACHE,
+ };
+ struct device *dev = &pdev->dev;
+ struct clk_gp_mnd *gp;
+ struct clk *clk;
+ void __iomem *base;
+ int ret;
+
+ gp = devm_kzalloc(dev, sizeof(*gp), GFP_KERNEL);
+ if (!gp)
+ return -ENOMEM;
+
+ gp->dev = dev;
+
+ ret = devm_pm_runtime_enable(dev);
+ if (ret)
+ return ret;
+
+ ret = devm_pm_clk_create(dev);
+ if (ret)
+ return ret;
+
+ ret = pm_clk_add(dev, "ahb_clk");
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to get ahb_clk\n");
+
+ clk = devm_clk_get(dev, "pdm_clk");
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
+
+ /* Set default rate if not already configured */
+ if (!clk_get_rate(clk)) {
+ ret = clk_set_rate(clk, 19200000);
+ if (ret)
+ dev_warn(dev, "failed to set default pdm_clk rate\n");
+ }
+
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return dev_err_probe(dev, PTR_ERR(base),
+ "failed to map PDM registers\n");
+
+ gp->regmap = devm_regmap_init_mmio(dev, base, &gp_mnd_regmap_config);
+ if (IS_ERR(gp->regmap))
+ return dev_err_probe(dev, PTR_ERR(gp->regmap),
+ "failed to init regmap\n");
+
+ gp->hw.init = &init;
+
+ ret = devm_clk_hw_register(dev, &gp->hw);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "failed to register gp_mnd clock\n");
+
+ return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &gp->hw);
+}
+
+static const struct of_device_id clk_gp_mnd_match_table[] = {
+ { .compatible = "qcom,sc7280-gp-mnd" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, clk_gp_mnd_match_table);
+
+static const struct dev_pm_ops clk_gp_mnd_pm_ops = {
+ SET_RUNTIME_PM_OPS(pm_clk_suspend, pm_clk_resume, NULL)
+};
+
+static struct platform_driver clk_gp_mnd_driver = {
+ .probe = clk_gp_mnd_probe,
+ .driver = {
+ .name = "qcom-clk-gp-mnd",
+ .of_match_table = clk_gp_mnd_match_table,
+ .pm = pm_ptr(&clk_gp_mnd_pm_ops),
+ },
+};
+module_platform_driver(clk_gp_mnd_driver);
+
+MODULE_DESCRIPTION("Qualcomm PDM GP_MND clock divider driver");
+MODULE_LICENSE("GPL");
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 04/12] clk: qcom: gcc: Add configurable PDM XO4 div clocks across targets
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (2 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 03/12] clk: qcom: Add a driver for PDM GP_MN fractional clock divider Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 15:04 ` Abel Vesa
2026-10-26 11:29 ` [PATCH v2 05/12] pinctrl: qcom: qcs8300: Add gp_mn mux function Taniya Das
` (7 subsequent siblings)
11 siblings, 1 reply; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
Add PDM XO4 divider clocks and make the PDM XO4 branches propagate rate
requests to them on QCS615, QCS8300, SA8775P, and SC7280. This lets
GP_MND select the supported PDM source clock rates.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
drivers/clk/qcom/gcc-qcs615.c | 20 ++++++++++++++++++++
drivers/clk/qcom/gcc-qcs8300.c | 20 ++++++++++++++++++++
drivers/clk/qcom/gcc-sa8775p.c | 20 ++++++++++++++++++++
drivers/clk/qcom/gcc-sc7280.c | 20 ++++++++++++++++++++
4 files changed, 80 insertions(+)
diff --git a/drivers/clk/qcom/gcc-qcs615.c b/drivers/clk/qcom/gcc-qcs615.c
index e096af7d82bf558bedf524eb2ca959f3e9e5c22e..9b558ea023ad62e6d465155e21c54376d7b99732 100644
--- a/drivers/clk/qcom/gcc-qcs615.c
+++ b/drivers/clk/qcom/gcc-qcs615.c
@@ -1654,6 +1654,20 @@ static struct clk_branch gcc_pdm_ahb_clk = {
},
};
+static struct clk_regmap_div gcc_pdm_xo4_div_clk_src = {
+ .reg = 0x33028,
+ .shift = 0,
+ .width = 4,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "gcc_pdm_xo4_div_clk_src",
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_BI_TCXO,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_div_ops,
+ },
+};
+
static struct clk_branch gcc_pdm_xo4_clk = {
.halt_reg = 0x33008,
.halt_check = BRANCH_HALT,
@@ -1662,6 +1676,11 @@ static struct clk_branch gcc_pdm_xo4_clk = {
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_pdm_xo4_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &gcc_pdm_xo4_div_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
@@ -2802,6 +2821,7 @@ static struct clk_regmap *gcc_qcs615_clocks[] = {
[GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr,
[GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
[GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
+ [GCC_PDM_XO4_DIV_CLK_SRC] = &gcc_pdm_xo4_div_clk_src.clkr,
[GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
[GCC_QMIP_CAMERA_NRT_AHB_CLK] = &gcc_qmip_camera_nrt_ahb_clk.clkr,
[GCC_QMIP_DISP_AHB_CLK] = &gcc_qmip_disp_ahb_clk.clkr,
diff --git a/drivers/clk/qcom/gcc-qcs8300.c b/drivers/clk/qcom/gcc-qcs8300.c
index 916617a001c854c1a0349c1793a427a2822acfab..4a152e95aa997bdcc7ec56a6ae96c61b3575cd88 100644
--- a/drivers/clk/qcom/gcc-qcs8300.c
+++ b/drivers/clk/qcom/gcc-qcs8300.c
@@ -2280,6 +2280,20 @@ static struct clk_branch gcc_pdm_ahb_clk = {
},
};
+static struct clk_regmap_div gcc_pdm_xo4_div_clk_src = {
+ .reg = 0x3f028,
+ .shift = 0,
+ .width = 4,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "gcc_pdm_xo4_div_clk_src",
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_BI_TCXO,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_div_ops,
+ },
+};
+
static struct clk_branch gcc_pdm_xo4_clk = {
.halt_reg = 0x3f008,
.halt_check = BRANCH_HALT,
@@ -2288,6 +2302,11 @@ static struct clk_branch gcc_pdm_xo4_clk = {
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_pdm_xo4_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &gcc_pdm_xo4_div_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
@@ -3501,6 +3520,7 @@ static struct clk_regmap *gcc_qcs8300_clocks[] = {
[GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr,
[GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
[GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
+ [GCC_PDM_XO4_DIV_CLK_SRC] = &gcc_pdm_xo4_div_clk_src.clkr,
[GCC_QMIP_CAMERA_NRT_AHB_CLK] = &gcc_qmip_camera_nrt_ahb_clk.clkr,
[GCC_QMIP_CAMERA_RT_AHB_CLK] = &gcc_qmip_camera_rt_ahb_clk.clkr,
[GCC_QMIP_DISP_AHB_CLK] = &gcc_qmip_disp_ahb_clk.clkr,
diff --git a/drivers/clk/qcom/gcc-sa8775p.c b/drivers/clk/qcom/gcc-sa8775p.c
index 0e02af686614162dd7d5d9ab9f3a20c390ed0512..5ed3ec74b210807813f97120a4a19773f3f67d0d 100644
--- a/drivers/clk/qcom/gcc-sa8775p.c
+++ b/drivers/clk/qcom/gcc-sa8775p.c
@@ -2712,6 +2712,20 @@ static struct clk_branch gcc_pdm_ahb_clk = {
},
};
+static struct clk_regmap_div gcc_pdm_xo4_div_clk_src = {
+ .reg = 0x3f028,
+ .shift = 0,
+ .width = 4,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "gcc_pdm_xo4_div_clk_src",
+ .parent_data = &(const struct clk_parent_data){
+ .index = DT_BI_TCXO,
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_div_ops,
+ },
+};
+
static struct clk_branch gcc_pdm_xo4_clk = {
.halt_reg = 0x3f008,
.halt_check = BRANCH_HALT,
@@ -2720,6 +2734,11 @@ static struct clk_branch gcc_pdm_xo4_clk = {
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data){
.name = "gcc_pdm_xo4_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &gcc_pdm_xo4_div_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
@@ -4406,6 +4425,7 @@ static struct clk_regmap *gcc_sa8775p_clocks[] = {
[GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr,
[GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
[GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
+ [GCC_PDM_XO4_DIV_CLK_SRC] = &gcc_pdm_xo4_div_clk_src.clkr,
[GCC_QMIP_CAMERA_NRT_AHB_CLK] = &gcc_qmip_camera_nrt_ahb_clk.clkr,
[GCC_QMIP_CAMERA_RT_AHB_CLK] = &gcc_qmip_camera_rt_ahb_clk.clkr,
[GCC_QMIP_DISP1_AHB_CLK] = &gcc_qmip_disp1_ahb_clk.clkr,
diff --git a/drivers/clk/qcom/gcc-sc7280.c b/drivers/clk/qcom/gcc-sc7280.c
index 78399993cdcee225d2f21f39844b056193bdfca3..dc7a855be0234f6135d461175099862f2d486d9a 100644
--- a/drivers/clk/qcom/gcc-sc7280.c
+++ b/drivers/clk/qcom/gcc-sc7280.c
@@ -1913,6 +1913,20 @@ static struct clk_branch gcc_pdm_ahb_clk = {
},
};
+static struct clk_regmap_div gcc_pdm_xo4_div_clk_src = {
+ .reg = 0x33028,
+ .shift = 0,
+ .width = 4,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "gcc_pdm_xo4_div_clk_src",
+ .parent_data = &(const struct clk_parent_data){
+ .fw_name = "bi_tcxo",
+ },
+ .num_parents = 1,
+ .ops = &clk_regmap_div_ops,
+ },
+};
+
static struct clk_branch gcc_pdm_xo4_clk = {
.halt_reg = 0x33008,
.halt_check = BRANCH_HALT,
@@ -1921,6 +1935,11 @@ static struct clk_branch gcc_pdm_xo4_clk = {
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "gcc_pdm_xo4_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &gcc_pdm_xo4_div_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
@@ -3250,6 +3269,7 @@ static struct clk_regmap *gcc_sc7280_clocks[] = {
[GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr,
[GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
[GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
+ [GCC_PDM_XO4_DIV_CLK_SRC] = &gcc_pdm_xo4_div_clk_src.clkr,
[GCC_QMIP_CAMERA_NRT_AHB_CLK] = &gcc_qmip_camera_nrt_ahb_clk.clkr,
[GCC_QMIP_CAMERA_RT_AHB_CLK] = &gcc_qmip_camera_rt_ahb_clk.clkr,
[GCC_QMIP_DISP_AHB_CLK] = &gcc_qmip_disp_ahb_clk.clkr,
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 05/12] pinctrl: qcom: qcs8300: Add gp_mn mux function
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (3 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 04/12] clk: qcom: gcc: Add configurable PDM XO4 div clocks across targets Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 11:29 ` [PATCH v2 06/12] pinctrl: qcom: sa8775p: " Taniya Das
` (6 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das, Konrad Dybcio
Add the gp_mn pin mux function on gpio32 of QCS8300. This exposes the
GP M/N divider clock output on the dedicated GPIO pin.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
drivers/pinctrl/qcom/pinctrl-qcs8300.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-qcs8300.c b/drivers/pinctrl/qcom/pinctrl-qcs8300.c
index fec86818c51188a0949e268382fb0c5de3f66f1a..349369fcdf18342b27067b91414eacbe378224e7 100644
--- a/drivers/pinctrl/qcom/pinctrl-qcs8300.c
+++ b/drivers/pinctrl/qcom/pinctrl-qcs8300.c
@@ -424,6 +424,7 @@ enum qcs8300_functions {
msm_mux_gcc_gp3,
msm_mux_gcc_gp4,
msm_mux_gcc_gp5,
+ msm_mux_gp_mn,
msm_mux_hs0_mi2s,
msm_mux_hs1_mi2s,
msm_mux_hs2_mi2s,
@@ -651,6 +652,10 @@ static const char *const gcc_gp5_groups[] = {
"gpio76", "gpio77",
};
+static const char *const gp_mn_groups[] = {
+ "gpio32",
+};
+
static const char * const hs0_mi2s_groups[] = {
"gpio106", "gpio107", "gpio108", "gpio109",
};
@@ -955,6 +960,7 @@ static const struct pinfunction qcs8300_functions[] = {
MSM_PIN_FUNCTION(gcc_gp3),
MSM_PIN_FUNCTION(gcc_gp4),
MSM_PIN_FUNCTION(gcc_gp5),
+ MSM_PIN_FUNCTION(gp_mn),
MSM_PIN_FUNCTION(hs0_mi2s),
MSM_PIN_FUNCTION(hs1_mi2s),
MSM_PIN_FUNCTION(hs2_mi2s),
@@ -1062,7 +1068,8 @@ static const struct msm_pingroup qcs8300_groups[] = {
[30] = PINGROUP(30, qup0_se4, cci_i2c_scl, cci_async, emac0_ptp_pps,
tgu_ch3, _, _, _, _, _, _),
[31] = PINGROUP(31, qup0_se4, cci_i2c_sda, cci_async, emac0_ptp_aux, _, _, _, _, _, _, _),
- [32] = PINGROUP(32, qup0_se4, cci_i2c_scl, emac0_ptp_aux, mdp_vsync, _, _, _, _, _, _, _),
+ [32] = PINGROUP(32, qup0_se4, cci_i2c_scl, emac0_ptp_aux, mdp_vsync, gp_mn, _, _, _, _,
+ _, _),
[33] = PINGROUP(33, qup0_se2, qdss_gpio, _, _, _, _, _, _, _, _, _),
[34] = PINGROUP(34, qup0_se2, qdss_gpio, _, _, _, _, _, _, _, _, _),
[35] = PINGROUP(35, qup0_se2, gcc_gp1, _, _, _, _, _, _, _, _, _),
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 06/12] pinctrl: qcom: sa8775p: Add gp_mn mux function
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (4 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 05/12] pinctrl: qcom: qcs8300: Add gp_mn mux function Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 11:29 ` [PATCH v2 07/12] pinctrl: qcom: sc7280: " Taniya Das
` (5 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das, Konrad Dybcio
Add the gp_mn pin mux function on gpio35 of SA8775P. This exposes the
GP M/N divider clock output on the dedicated GPIO pin.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
drivers/pinctrl/qcom/pinctrl-sa8775p.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-sa8775p.c b/drivers/pinctrl/qcom/pinctrl-sa8775p.c
index 5dbaa50cbff008a2605876eb329496d305735700..d299f47a0bd4ab1a0cd0e553ba50f9ec1e035686 100644
--- a/drivers/pinctrl/qcom/pinctrl-sa8775p.c
+++ b/drivers/pinctrl/qcom/pinctrl-sa8775p.c
@@ -480,6 +480,7 @@ enum sa8775p_functions {
msm_mux_gcc_gp3,
msm_mux_gcc_gp4,
msm_mux_gcc_gp5,
+ msm_mux_gp_mn,
msm_mux_hs0_mi2s,
msm_mux_hs1_mi2s,
msm_mux_hs2_mi2s,
@@ -828,6 +829,10 @@ static const char * const gcc_gp5_groups[] = {
"gpio34", "gpio42",
};
+static const char * const gp_mn_groups[] = {
+ "gpio35",
+};
+
static const char * const hs0_mi2s_groups[] = {
"gpio114", "gpio115", "gpio116", "gpio117",
};
@@ -1230,6 +1235,7 @@ static const struct pinfunction sa8775p_functions[] = {
MSM_PIN_FUNCTION(gcc_gp3),
MSM_PIN_FUNCTION(gcc_gp4),
MSM_PIN_FUNCTION(gcc_gp5),
+ MSM_PIN_FUNCTION(gp_mn),
MSM_PIN_FUNCTION(hs0_mi2s),
MSM_PIN_FUNCTION(hs1_mi2s),
MSM_PIN_FUNCTION(hs2_mi2s),
@@ -1361,7 +1367,7 @@ static const struct msm_pingroup sa8775p_groups[] = {
[32] = PINGROUP(32, qup0_se4, phase_flag, _, _, _, _, _, _, _),
[33] = PINGROUP(33, qup0_se4, gcc_gp4, _, ddr_pxi0, _, _, _, _, _),
[34] = PINGROUP(34, qup0_se4, gcc_gp5, _, ddr_pxi0, _, _, _, _, _),
- [35] = PINGROUP(35, qup0_se4, phase_flag, _, _, _, _, _, _, _),
+ [35] = PINGROUP(35, qup0_se4, phase_flag, gp_mn, _, _, _, _, _, _),
[36] = PINGROUP(36, qup0_se2, qup0_se5, phase_flag, tgu_ch2, _, _, _, _, _),
[37] = PINGROUP(37, qup0_se2, qup0_se5, phase_flag, tgu_ch3, _, _, _, _, _),
[38] = PINGROUP(38, qup0_se5, qup0_se2, qdss_cti, phase_flag, tgu_ch4, _, _, _, _),
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 07/12] pinctrl: qcom: sc7280: Add gp_mn mux function
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (5 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 06/12] pinctrl: qcom: sa8775p: " Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 11:29 ` [PATCH v2 08/12] pinctrl: qcom: qcs615: " Taniya Das
` (4 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das, Konrad Dybcio
Add the gp_mn pin mux function on gpio60 of SC7280. This exposes the
GP M/N divider clock output on the dedicated GPIO pin.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
drivers/pinctrl/qcom/pinctrl-sc7280.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-sc7280.c b/drivers/pinctrl/qcom/pinctrl-sc7280.c
index bb32a56649df6faf1aecd470435d74558c20db27..5e210b399f88f5beb68e511bca9c0dd93a1b75dc 100644
--- a/drivers/pinctrl/qcom/pinctrl-sc7280.c
+++ b/drivers/pinctrl/qcom/pinctrl-sc7280.c
@@ -515,6 +515,7 @@ enum sc7280_functions {
msm_mux_gcc_gp1,
msm_mux_gcc_gp2,
msm_mux_gcc_gp3,
+ msm_mux_gp_mn,
msm_mux_gpio,
msm_mux_host2wlan_sol,
msm_mux_ibi_i3c,
@@ -788,6 +789,10 @@ static const char * const gcc_gp2_groups[] = {
static const char * const gcc_gp3_groups[] = {
"gpio78", "gpio107",
};
+
+static const char *const gp_mn_groups[] = {
+ "gpio60",
+};
static const char * const host2wlan_sol_groups[] = {
"gpio26",
};
@@ -1154,6 +1159,7 @@ static const struct pinfunction sc7280_functions[] = {
MSM_PIN_FUNCTION(gcc_gp1),
MSM_PIN_FUNCTION(gcc_gp2),
MSM_PIN_FUNCTION(gcc_gp3),
+ MSM_PIN_FUNCTION(gp_mn),
MSM_GPIO_PIN_FUNCTION(gpio),
MSM_PIN_FUNCTION(host2wlan_sol),
MSM_PIN_FUNCTION(ibi_i3c),
@@ -1325,7 +1331,7 @@ static const struct msm_pingroup sc7280_groups[] = {
[57] = PINGROUP(57, qup16, ddr_bist, phase_flag, _, _, _, _, _, _),
[58] = PINGROUP(58, qup16, ddr_bist, phase_flag, qdss, _, _, _, _, _),
[59] = PINGROUP(59, qup16, ddr_bist, phase_flag, qdss, _, _, _, _, _),
- [60] = PINGROUP(60, qup17, edp_hot, _, phase_flag, _, _, _, _, _),
+ [60] = PINGROUP(60, qup17, edp_hot, gp_mn, phase_flag, _, _, _, _, _),
[61] = PINGROUP(61, qup17, sd_write, phase_flag, tsense_pwm1, tsense_pwm2, _, _, _, _),
[62] = PINGROUP(62, qup17, qup16, phase_flag, _, _, _, _, _, _),
[63] = PINGROUP(63, qup17, qup16, phase_flag, _, _, _, _, _, _),
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 08/12] pinctrl: qcom: qcs615: Add gp_mn mux function
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (6 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 07/12] pinctrl: qcom: sc7280: " Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 11:29 ` [PATCH v2 09/12] arm64: dts: qcom: qcs8300: Add GP M/N clock controller Taniya Das
` (3 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
Add the gp_mn pin mux function on gpio29 of QCS615. This exposes the
GP M/N divider clock output on the dedicated GPIO pin.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
drivers/pinctrl/qcom/pinctrl-qcs615.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-qcs615.c b/drivers/pinctrl/qcom/pinctrl-qcs615.c
index 0e7df184122b5b94756a233a009ec0dd3675816f..169323635d39a7c3441560feb002e9e03a577515 100644
--- a/drivers/pinctrl/qcom/pinctrl-qcs615.c
+++ b/drivers/pinctrl/qcom/pinctrl-qcs615.c
@@ -404,6 +404,7 @@ enum qcs615_functions {
msm_mux_emac_phy_intr,
msm_mux_forced_usb,
msm_mux_gcc_gp,
+ msm_mux_gp_mn,
msm_mux_gp_pdm,
msm_mux_gps_tx,
msm_mux_hs0_mi2s,
@@ -581,6 +582,10 @@ static const char *const gcc_gp_groups[] = {
"gpio59", "gpio78",
};
+static const char *const gp_mn_groups[] = {
+ "gpio29",
+};
+
static const char *const gp_pdm_groups[] = {
"gpio8", "gpio54", "gpio63", "gpio66",
"gpio79", "gpio95",
@@ -840,6 +845,7 @@ static const struct pinfunction qcs615_functions[] = {
MSM_PIN_FUNCTION(emac_phy_intr),
MSM_PIN_FUNCTION(forced_usb),
MSM_PIN_FUNCTION(gcc_gp),
+ MSM_PIN_FUNCTION(gp_mn),
MSM_PIN_FUNCTION(gp_pdm),
MSM_PIN_FUNCTION(gps_tx),
MSM_PIN_FUNCTION(hs0_mi2s),
@@ -929,7 +935,7 @@ static const struct msm_pingroup qcs615_groups[] = {
[26] = PINGROUP(26, EAST, cci_async, hs1_mi2s, jitter_bist, _, _, _, _, _, _),
[27] = PINGROUP(27, EAST, hs1_mi2s, pll_bist, _, _, _, _, _, _, _),
[28] = PINGROUP(28, EAST, cam_mclk, agera_pll, qdss_gpio, _, _, _, _, _, _),
- [29] = PINGROUP(29, EAST, cam_mclk, _, qdss_gpio, atest_tsens, _, _, _, _, _),
+ [29] = PINGROUP(29, EAST, cam_mclk, gp_mn, qdss_gpio, atest_tsens, _, _, _, _, _),
[30] = PINGROUP(30, EAST, cam_mclk, qdss_gpio, _, _, _, _, _, _, _),
[31] = PINGROUP(31, EAST, cam_mclk, _, qdss_gpio, _, _, _, _, _, _),
[32] = PINGROUP(32, EAST, cci_i2c, _, qdss_gpio, _, _, _, _, _, _),
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 09/12] arm64: dts: qcom: qcs8300: Add GP M/N clock controller
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (7 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 08/12] pinctrl: qcom: qcs615: " Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 11:29 ` [PATCH v2 10/12] arm64: dts: qcom: sa8775p: " Taniya Das
` (2 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
Add the GP M/N clock controller and its pin configuration for QCS8300.
The controller uses the PDM XO4 and AHB clocks from GCC and routes its
output to gpio32.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/monaco.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/monaco.dtsi b/arch/arm64/boot/dts/qcom/monaco.dtsi
index 35fbee63d4c652005dae9b93bbb8f6a28b48be3b..e122f70eaf20c65df5854e644887ad16da94a7ec 100644
--- a/arch/arm64/boot/dts/qcom/monaco.dtsi
+++ b/arch/arm64/boot/dts/qcom/monaco.dtsi
@@ -4891,6 +4891,20 @@ sdhc_ice: crypto@87c8000 {
power-domains = <&rpmhpd RPMHPD_CX>;
};
+ gp_mn: clock-controller@88d3000 {
+ compatible = "qcom,qcs8300-gp-mnd", "qcom,sc7280-gp-mnd";
+ reg = <0x0 0x088d3000 0x0 0x1000>;
+ clocks = <&gcc GCC_PDM_XO4_CLK>,
+ <&gcc GCC_PDM_AHB_CLK>;
+ clock-names = "pdm_clk", "ahb_clk";
+ #clock-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&gp_mn_active>;
+ assigned-clocks = <&gcc GCC_PDM_XO4_CLK>;
+ assigned-clock-rates = <4800000>;
+ status = "disabled";
+ };
+
usb_1_hsphy: phy@8904000 {
compatible = "qcom,qcs8300-usb-hs-phy",
"qcom,usb-snps-hs-7nm-phy";
@@ -6457,6 +6471,13 @@ dp_hot_plug_det: dp-hot-plug-det-state {
bias-disable;
};
+ gp_mn_active: gp-mn-active-state {
+ pins = "gpio32";
+ function = "gp_mn";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
hs0_mi2s_active: hs0-mi2s-active-state {
pins = "gpio106", "gpio107", "gpio108", "gpio109";
function = "hs0_mi2s";
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 10/12] arm64: dts: qcom: sa8775p: Add GP M/N clock controller
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (8 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 09/12] arm64: dts: qcom: qcs8300: Add GP M/N clock controller Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 11:29 ` [PATCH v2 11/12] arm64: dts: qcom: sc7280: " Taniya Das
2026-10-26 11:29 ` [PATCH v2 12/12] arm64: dts: qcom: qcs615: " Taniya Das
11 siblings, 0 replies; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
Add the GP M/N clock controller and its pin configuration for SA8775P.
The controller uses the PDM XO4 and AHB clocks from GCC and routes its
output to gpio35.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/lemans.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/lemans.dtsi b/arch/arm64/boot/dts/qcom/lemans.dtsi
index 1fdb72fa5518446ba2ea582e8362e86bba75c379..4132d288e3a16ab0a6d8b6d0816e85671bd25c73 100644
--- a/arch/arm64/boot/dts/qcom/lemans.dtsi
+++ b/arch/arm64/boot/dts/qcom/lemans.dtsi
@@ -4348,6 +4348,20 @@ opp-384000000 {
};
};
+ gp_mn: clock-controller@88d3000 {
+ compatible = "qcom,sa8775p-gp-mnd", "qcom,sc7280-gp-mnd";
+ reg = <0x0 0x088d3000 0x0 0x1000>;
+ clocks = <&gcc GCC_PDM_XO4_CLK>,
+ <&gcc GCC_PDM_AHB_CLK>;
+ clock-names = "pdm_clk", "ahb_clk";
+ #clock-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&gp_mn_active>;
+ assigned-clocks = <&gcc GCC_PDM_XO4_CLK>;
+ assigned-clock-rates = <4800000>;
+ status = "disabled";
+ };
+
usb_0_hsphy: phy@88e4000 {
compatible = "qcom,sa8775p-usb-hs-phy",
"qcom,usb-snps-hs-5nm-phy";
@@ -6017,6 +6031,13 @@ dp1_hot_plug_det: dp1-hot-plug-det-state {
bias-disable;
};
+ gp_mn_active: gp-mn-active-state {
+ pins = "gpio35";
+ function = "gp_mn";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
hs0_mi2s_active: hs0-mi2s-active-state {
pins = "gpio114", "gpio115", "gpio116", "gpio117";
function = "hs0_mi2s";
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 11/12] arm64: dts: qcom: sc7280: Add GP M/N clock controller
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (9 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 10/12] arm64: dts: qcom: sa8775p: " Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 16:27 ` Abel Vesa
2026-10-26 11:29 ` [PATCH v2 12/12] arm64: dts: qcom: qcs615: " Taniya Das
11 siblings, 1 reply; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
Add the GP M/N clock controller and its pin configuration for SC7280.
The controller uses the PDM XO4 and AHB clocks from GCC and routes its
output to gpio60.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/kodiak.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
index 8c7523602d2719775b8f5c6a8cef138a93292721..de27a051ee3b0e9046ff97b8e6fe0164985d7b17 100644
--- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
+++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
@@ -4442,6 +4442,20 @@ usb2_role_switch: endpoint {
};
};
+ gp_mn: clock-controller@88d3000 {
+ compatible = "qcom,sc7280-gp-mnd";
+ reg = <0x0 0x088d3000 0x0 0x1000>;
+ clocks = <&gcc GCC_PDM_XO4_CLK>,
+ <&gcc GCC_PDM_AHB_CLK>;
+ clock-names = "pdm_clk", "ahb_clk";
+ #clock-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&gp_mn_active>;
+ assigned-clocks = <&gcc GCC_PDM_XO4_CLK>;
+ assigned-clock-rates = <4800000>;
+ status = "disabled";
+ };
+
qspi: spi@88dc000 {
compatible = "qcom,sc7280-qspi", "qcom,qspi-v1";
reg = <0 0x088dc000 0 0x1000>;
@@ -6653,6 +6667,13 @@ mi2s0_sclk: mi2s0-sclk-state {
function = "mi2s0_sck";
};
+ gp_mn_active: gp-mn-active-state {
+ pins = "gpio60";
+ function = "gp_mn";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
mi2s0_data0: mi2s0-data0-state {
pins = "gpio98";
function = "mi2s0_data0";
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 12/12] arm64: dts: qcom: qcs615: Add GP M/N clock controller
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
` (10 preceding siblings ...)
2026-10-26 11:29 ` [PATCH v2 11/12] arm64: dts: qcom: sc7280: " Taniya Das
@ 2026-10-26 11:29 ` Taniya Das
2026-10-26 16:27 ` Abel Vesa
11 siblings, 1 reply; 17+ messages in thread
From: Taniya Das @ 2026-10-26 11:29 UTC (permalink / raw)
To: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio
Cc: Ajit Pandey, Imran Shaik, Jagadeesh Kona, linux-arm-msm,
linux-clk, devicetree, linux-kernel, linux-gpio, netdev,
Taniya Das
Add the GP M/N clock controller and its pin configuration for QCS615.
The controller uses the PDM XO4 and AHB clocks from GCC and routes its
output to gpio29.
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/talos.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/talos.dtsi b/arch/arm64/boot/dts/qcom/talos.dtsi
index 8ed6f2755705c38796698747dfe7bba1afd1859e..c415e782804ca8c9d09670cb8c8cd2353d796b23 100644
--- a/arch/arm64/boot/dts/qcom/talos.dtsi
+++ b/arch/arm64/boot/dts/qcom/talos.dtsi
@@ -1611,6 +1611,13 @@ cam_mclk1_default: cam-mclk1-default-state {
bias-disable;
};
+ gp_mn_active: gp-mn-active-state {
+ pins = "gpio29";
+ function = "gp_mn";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
cam_mclk2_default: cam-mclk2-default-state {
pins = "gpio30";
function = "cam_mclk";
@@ -4028,6 +4035,20 @@ opp-202000000 {
};
};
+ gp_mn: clock-controller@88d3000 {
+ compatible = "qcom,qcs615-gp-mnd", "qcom,sc7280-gp-mnd";
+ reg = <0x0 0x088d3000 0x0 0x1000>;
+ clocks = <&gcc GCC_PDM_XO4_CLK>,
+ <&gcc GCC_PDM_AHB_CLK>;
+ clock-names = "pdm_clk", "ahb_clk";
+ #clock-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&gp_mn_active>;
+ assigned-clocks = <&gcc GCC_PDM_XO4_CLK>;
+ assigned-clock-rates = <19200000>;
+ status = "disabled";
+ };
+
qspi: spi@88df000 {
compatible = "qcom,qcs615-qspi",
"qcom,qspi-v1";
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 04/12] clk: qcom: gcc: Add configurable PDM XO4 div clocks across targets
2026-10-26 11:29 ` [PATCH v2 04/12] clk: qcom: gcc: Add configurable PDM XO4 div clocks across targets Taniya Das
@ 2026-10-26 15:04 ` Abel Vesa
0 siblings, 0 replies; 17+ messages in thread
From: Abel Vesa @ 2026-10-26 15:04 UTC (permalink / raw)
To: Taniya Das
Cc: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio, Ajit Pandey, Imran Shaik, Jagadeesh Kona,
linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-gpio,
netdev
On 26-10-26 16:59:30, Taniya Das wrote:
> Add PDM XO4 divider clocks and make the PDM XO4 branches propagate rate
> requests to them on QCS615, QCS8300, SA8775P, and SC7280. This lets
> GP_MND select the supported PDM source clock rates.
>
> Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 12/12] arm64: dts: qcom: qcs615: Add GP M/N clock controller
2026-10-26 11:29 ` [PATCH v2 12/12] arm64: dts: qcom: qcs615: " Taniya Das
@ 2026-10-26 16:27 ` Abel Vesa
0 siblings, 0 replies; 17+ messages in thread
From: Abel Vesa @ 2026-10-26 16:27 UTC (permalink / raw)
To: Taniya Das
Cc: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio, Ajit Pandey, Imran Shaik, Jagadeesh Kona,
linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-gpio,
netdev
On 26-10-26 16:59:38, Taniya Das wrote:
> Add the GP M/N clock controller and its pin configuration for QCS615.
> The controller uses the PDM XO4 and AHB clocks from GCC and routes its
> output to gpio29.
>
> Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
> ---
> arch/arm64/boot/dts/qcom/talos.dtsi | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/talos.dtsi b/arch/arm64/boot/dts/qcom/talos.dtsi
> index 8ed6f2755705c38796698747dfe7bba1afd1859e..c415e782804ca8c9d09670cb8c8cd2353d796b23 100644
> --- a/arch/arm64/boot/dts/qcom/talos.dtsi
> +++ b/arch/arm64/boot/dts/qcom/talos.dtsi
> @@ -1611,6 +1611,13 @@ cam_mclk1_default: cam-mclk1-default-state {
> bias-disable;
> };
>
> + gp_mn_active: gp-mn-active-state {
> + pins = "gpio29";
> + function = "gp_mn";
> + drive-strength = <2>;
> + bias-disable;
> + };
> +
> cam_mclk2_default: cam-mclk2-default-state {
> pins = "gpio30";
> function = "cam_mclk";
> @@ -4028,6 +4035,20 @@ opp-202000000 {
> };
> };
>
> + gp_mn: clock-controller@88d3000 {
> + compatible = "qcom,qcs615-gp-mnd", "qcom,sc7280-gp-mnd";
> + reg = <0x0 0x088d3000 0x0 0x1000>;
> + clocks = <&gcc GCC_PDM_XO4_CLK>,
> + <&gcc GCC_PDM_AHB_CLK>;
> + clock-names = "pdm_clk", "ahb_clk";
> + #clock-cells = <0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&gp_mn_active>;
pinctrl-0
pinctrl-names
> + assigned-clocks = <&gcc GCC_PDM_XO4_CLK>;
> + assigned-clock-rates = <19200000>;
> + status = "disabled";
> + };
> +
> qspi: spi@88df000 {
> compatible = "qcom,qcs615-qspi",
> "qcom,qspi-v1";
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 11/12] arm64: dts: qcom: sc7280: Add GP M/N clock controller
2026-10-26 11:29 ` [PATCH v2 11/12] arm64: dts: qcom: sc7280: " Taniya Das
@ 2026-10-26 16:27 ` Abel Vesa
0 siblings, 0 replies; 17+ messages in thread
From: Abel Vesa @ 2026-10-26 16:27 UTC (permalink / raw)
To: Taniya Das
Cc: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio, Ajit Pandey, Imran Shaik, Jagadeesh Kona,
linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-gpio,
netdev
On 26-10-26 16:59:37, Taniya Das wrote:
> Add the GP M/N clock controller and its pin configuration for SC7280.
> The controller uses the PDM XO4 and AHB clocks from GCC and routes its
> output to gpio60.
>
> Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
> ---
> arch/arm64/boot/dts/qcom/kodiak.dtsi | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
> index 8c7523602d2719775b8f5c6a8cef138a93292721..de27a051ee3b0e9046ff97b8e6fe0164985d7b17 100644
> --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
> +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
> @@ -4442,6 +4442,20 @@ usb2_role_switch: endpoint {
> };
> };
>
> + gp_mn: clock-controller@88d3000 {
> + compatible = "qcom,sc7280-gp-mnd";
> + reg = <0x0 0x088d3000 0x0 0x1000>;
> + clocks = <&gcc GCC_PDM_XO4_CLK>,
> + <&gcc GCC_PDM_AHB_CLK>;
> + clock-names = "pdm_clk", "ahb_clk";
> + #clock-cells = <0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&gp_mn_active>;
pinctrl-0
pinctrl-names
Same for all other patches.
> + assigned-clocks = <&gcc GCC_PDM_XO4_CLK>;
> + assigned-clock-rates = <4800000>;
> + status = "disabled";
> + };
> +
> qspi: spi@88dc000 {
> compatible = "qcom,sc7280-qspi", "qcom,qspi-v1";
> reg = <0 0x088dc000 0 0x1000>;
> @@ -6653,6 +6667,13 @@ mi2s0_sclk: mi2s0-sclk-state {
> function = "mi2s0_sck";
> };
>
> + gp_mn_active: gp-mn-active-state {
> + pins = "gpio60";
> + function = "gp_mn";
> + drive-strength = <2>;
> + bias-disable;
> + };
> +
> mi2s0_data0: mi2s0-data0-state {
> pins = "gpio98";
> function = "mi2s0_data0";
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 01/12] dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider
2026-10-26 11:29 ` [PATCH v2 01/12] dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider Taniya Das
@ 2026-10-27 18:47 ` Krzysztof Kozlowski
0 siblings, 0 replies; 17+ messages in thread
From: Krzysztof Kozlowski @ 2026-10-27 18:47 UTC (permalink / raw)
To: Taniya Das
Cc: Bjorn Andersson, Abel Vesa, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Bartosz Golaszewski, Linus Walleij, Richard Cochran,
Konrad Dybcio, Ajit Pandey, Imran Shaik, Jagadeesh Kona,
linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-gpio,
netdev
On Mon, Oct 26, 2026 at 04:59:27PM +0530, Taniya Das wrote:
> Add device tree bindings for the Qualcomm Peripheral Web's PDM GP_MN
> clock divider. The hardware generates a fractional output frequency
> from a fixed input clock (typically TCXO4) using the relation
> Fout = Fin * (M / N), with duty cycle controlled by a separate D
> register. The clock output is routed over a gpio controlled pin.
>
> Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
> ---
> .../devicetree/bindings/clock/qcom,clk-gp-mnd.yaml | 98 ++++++++++++++++++++++
> 1 file changed, 98 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/clock/qcom,clk-gp-mnd.yaml b/Documentation/devicetree/bindings/clock/qcom,clk-gp-mnd.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..8141f392c5d70acfc42cf1ff4b1722e1eff23afa
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/qcom,clk-gp-mnd.yaml
Use fallback as filename, so qcom,sc7280-gp-mnd.yaml
> @@ -0,0 +1,98 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/clock/qcom,clk-gp-mnd.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Peripheral Web's PDM GP_MN Clock Divider
> +
> +maintainers:
> + - Taniya Das <taniya.das@oss.qualcomm.com>
> +
> +description: |
> + The Peripheral Web's PDM GP_MN clock divider receives an input clock
> + (TCXO4) with frequency Fin and generates an output clock with
> + frequency Fout = Fin * (M / N) and a duty cycle controlled by D
> + and routed over a gpio pin.
> +
> + The divider is configured using three registers:
> +
> + - GP_MN_CLK_MDIV: holds the M value.
> + - GP_MN_CLK_NDIV: holds the ones complement of (N - M).
> + - GP_MN_CLK_DUTY: holds the D value.
> +
> + For every N input clock cycles the GP_MN produces M output clock
> + cycles. D is the number of native clock cycles in which the GP_MN
> + output is low, counted over 2^13 native clock cycles.
> +
> + Hardware constraints:
> +
> + M <= 511
> + N <= 8191
> + N > 2 * M
> + M < D < (N - M)
> + M and N must be coprime (no common divisor)
> +
> +properties:
> + compatible:
> + oneOf:
> + - const: qcom,sc7280-gp-mnd
> + - items:
> + - enum:
> + - qcom,sa8775p-gp-mnd
> + - qcom,qcs8300-gp-mnd
> + - qcom,qcs615-gp-mnd
> + - const: qcom,sc7280-gp-mnd
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + items:
> + - description: PDM XO4 source clock
> + - description: PDM AHB bus clock for register access
> +
> + clock-names:
> + items:
> + - const: pdm_clk
pdm
> + - const: ahb_clk
ahb
> +
> + '#clock-cells':
> + const: 0
> +
> + assigned-clocks:
> + maxItems: 1
> + description: Parent clock phandle used to set the input frequency.
> +
> + assigned-clock-rates:
> + maxItems: 1
> + description: |
> + Rate for the parent clock in Hz.
> + Supported rates: 19200000, 9600000, 6400000, 4800000.
Neither assigned-clocks nor assigned-clock-rates should be needed.
Parent clock is outside of scope of this binding.
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> + - clock-names
> + - '#clock-cells'
> + - assigned-clocks
> + - assigned-clock-rates
And these two should not be required, either.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-10-27 18:47 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 11:29 [PATCH v2 00/12] clk: qcom: Add PDM GP_MN fractional clock divider driver and DT support Taniya Das
2026-10-26 11:29 ` [PATCH v2 01/12] dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider Taniya Das
2026-10-27 18:47 ` Krzysztof Kozlowski
2026-10-26 11:29 ` [PATCH v2 02/12] dt-bindings: clock: qcom: Add PDM XO4 divider clock IDs Taniya Das
2026-10-26 11:29 ` [PATCH v2 03/12] clk: qcom: Add a driver for PDM GP_MN fractional clock divider Taniya Das
2026-10-26 11:29 ` [PATCH v2 04/12] clk: qcom: gcc: Add configurable PDM XO4 div clocks across targets Taniya Das
2026-10-26 15:04 ` Abel Vesa
2026-10-26 11:29 ` [PATCH v2 05/12] pinctrl: qcom: qcs8300: Add gp_mn mux function Taniya Das
2026-10-26 11:29 ` [PATCH v2 06/12] pinctrl: qcom: sa8775p: " Taniya Das
2026-10-26 11:29 ` [PATCH v2 07/12] pinctrl: qcom: sc7280: " Taniya Das
2026-10-26 11:29 ` [PATCH v2 08/12] pinctrl: qcom: qcs615: " Taniya Das
2026-10-26 11:29 ` [PATCH v2 09/12] arm64: dts: qcom: qcs8300: Add GP M/N clock controller Taniya Das
2026-10-26 11:29 ` [PATCH v2 10/12] arm64: dts: qcom: sa8775p: " Taniya Das
2026-10-26 11:29 ` [PATCH v2 11/12] arm64: dts: qcom: sc7280: " Taniya Das
2026-10-26 16:27 ` Abel Vesa
2026-10-26 11:29 ` [PATCH v2 12/12] arm64: dts: qcom: qcs615: " Taniya Das
2026-10-26 16:27 ` Abel Vesa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®