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 --- .../bindings/clock/qcom,sc7280-gp-mnd.yaml | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/qcom,sc7280-gp-mnd.yaml b/Documentation/devicetree/bindings/clock/qcom,sc7280-gp-mnd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76fecc6f7cb376770bfec06f3e1fcafcd480286a --- /dev/null +++ b/Documentation/devicetree/bindings/clock/qcom,sc7280-gp-mnd.yaml @@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,sc7280-gp-mnd.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Peripheral Web's PDM GP_MN Clock Divider + +maintainers: + - Taniya Das + +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,qcs615-gp-mnd + - qcom,qcs8300-gp-mnd + - qcom,sa8775p-gp-mnd + - qcom,shikra-gp-mnd + - qcom,sm8750-gp-mnd + - const: qcom,sc7280-gp-mnd + + reg: + maxItems: 1 + + clocks: + items: + - description: | + PDM XO4 source clock. It is derived from the 19.2 MHz TCXO by an + integer divider of 1 to 16 programmed on the parent clock (for + example via assigned-clock-rates), giving supported input rates + from 19200000 Hz (divide by 1) down to 1200000 Hz (divide by 16). + - description: PDM AHB bus clock for register access + + clock-names: + items: + - const: pdm + - const: ahb + + '#clock-cells': + const: 0 + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + +additionalProperties: false + +examples: + - | + #include + 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", "ahb"; + 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