The Peripheral Web's PDM hardware block on several Qualcomm SoCs
contains a GP_MN clock divider that generates a fractional output
frequency from a fixed input clock (typically TCXO4):
Fout = Fin * (M / N)
The output is routed to an external GPIO pin via a dedicated pin mux
function, making it useful as a reference clock for external devices.
The hardware uses three registers:
- MDIV: holds M (9-bit numerator)
- NDIV: holds the 1's complement of (N - M) (13-bit period)
- DUTY: holds D, the low-phase count, constrained to M < D < (N - M)
This series adds full upstream support for the block:
Patch 1: dt-bindings YAML schema for qcom,clk-gp-mnd
Patch 2: standalone platform driver using rational_best_approximation()
to find the closest M/N pair, with full clk_ops coverage
(determine_rate, set_rate, recalc_rate, get_duty_cycle,
set_duty_cycle) and AHB bus clock gating around register
accesses
Patch 3: gp_mn pin mux function for QCS8300, SA8775P and SC7280
TLMM pin controllers
Patch 4: pinctrl state nodes for the GP_MN output pin in the
kodiak (SA8775P), lemans (SA8775P) and monaco (QCS8300)
SoC device trees
Patch 5: GP_MN clock controller DT nodes for SA8775P (kodiak,
lemans) and QCS8300 (monaco), clocked from GCC PDM XO4
and AHB clocks with the XO4 pre-assigned to 4.8 MHz
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
Signed-off-by: Taniya Das <taniya.das@oss.qualcomm.com>
---
Taniya Das (5):
dt-bindings: clock: qcom: Add bindings for PDM GP_MN clock divider
clk: qcom: Add a driver for PDM GP_MN fractional clock divider
pinctrl: qcom: Add gp_mn mux function for QCS8300, SA8775P and SC7280
arm64: dts: qcom: Add gp_mn pin state for GP M/N clock output
arm64: dts: qcom: Add GP M/N clock controller node for SA8775P and QCS8300
.../devicetree/bindings/clock/qcom,clk-gp-mnd.yaml | 105 +++++++
arch/arm64/boot/dts/qcom/kodiak.dtsi | 21 ++
arch/arm64/boot/dts/qcom/lemans.dtsi | 21 ++
arch/arm64/boot/dts/qcom/monaco.dtsi | 21 ++
drivers/clk/qcom/Kconfig | 15 +
drivers/clk/qcom/Makefile | 1 +
drivers/clk/qcom/clk-gp-mnd.c | 333 +++++++++++++++++++++
drivers/pinctrl/qcom/pinctrl-qcs8300.c | 9 +-
drivers/pinctrl/qcom/pinctrl-sa8775p.c | 8 +-
drivers/pinctrl/qcom/pinctrl-sc7280.c | 8 +-
10 files changed, 539 insertions(+), 3 deletions(-)
---
base-commit: 08484c504b55a98bd100527fbe10a3caf55ff3ff
change-id: 20260602-pdm_clk_gp_mnd_v1-7e9c2c1b39ab
Best regards,
--
Taniya Das <taniya.das@oss.qualcomm.com>