|
| 1 | +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 | +%YAML 1.2 |
| 3 | +--- |
| 4 | +$id: http://devicetree.org/schemas/clock/qcom,clk-gp-mnd.yaml# |
| 5 | +$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | + |
| 7 | +title: Qualcomm Peripheral Web's PDM GP_MN Clock Divider |
| 8 | + |
| 9 | +maintainers: |
| 10 | + - Taniya Das <taniya.das@oss.qualcomm.com> |
| 11 | + |
| 12 | +description: | |
| 13 | + The Peripheral Web's PDM GP_MN clock divider receives an input clock |
| 14 | + (TCXO4) with frequency Fin and generates an output clock with |
| 15 | + frequency Fout = Fin * (M / N) and a duty cycle controlled by D |
| 16 | + and routed over a gpio pin. |
| 17 | +
|
| 18 | + The divider is configured using three registers: |
| 19 | +
|
| 20 | + - GP_MN_CLK_MDIV: holds the M value. |
| 21 | + - GP_MN_CLK_NDIV: holds the ones complement of (N - M). |
| 22 | + - GP_MN_CLK_DUTY: holds the D value. |
| 23 | +
|
| 24 | + For every N input clock cycles the GP_MN produces M output clock |
| 25 | + cycles. D is the number of native clock cycles in which the GP_MN |
| 26 | + output is low, counted over 2^13 native clock cycles. |
| 27 | +
|
| 28 | + Hardware constraints: |
| 29 | +
|
| 30 | + M <= 511 |
| 31 | + N <= 8191 |
| 32 | + N > 2 * M |
| 33 | + M < D < (N - M) |
| 34 | + M and N must be coprime (no common divisor) |
| 35 | +
|
| 36 | +properties: |
| 37 | + compatible: |
| 38 | + const: qcom,clk-gp-mnd |
| 39 | + |
| 40 | + reg: |
| 41 | + maxItems: 1 |
| 42 | + |
| 43 | + clocks: |
| 44 | + items: |
| 45 | + - description: PDM XO4 source clock |
| 46 | + - description: PDM AHB bus clock for register access |
| 47 | + |
| 48 | + clock-names: |
| 49 | + items: |
| 50 | + - const: pdm_clk |
| 51 | + - const: ahb_clk |
| 52 | + |
| 53 | + '#clock-cells': |
| 54 | + const: 0 |
| 55 | + |
| 56 | + clock-output-names: |
| 57 | + maxItems: 1 |
| 58 | + |
| 59 | + pinctrl-0: |
| 60 | + description: Pin configuration for the GP_MN output in the active state. |
| 61 | + |
| 62 | + pinctrl-names: |
| 63 | + items: |
| 64 | + - const: active |
| 65 | + |
| 66 | + assigned-clocks: |
| 67 | + maxItems: 1 |
| 68 | + description: Parent clock phandle used to set the input frequency. |
| 69 | + |
| 70 | + assigned-clock-rates: |
| 71 | + maxItems: 1 |
| 72 | + description: | |
| 73 | + Rate for the parent clock in Hz. |
| 74 | + Supported rates: 19200000, 9600000, 6400000, 4800000. |
| 75 | +
|
| 76 | +required: |
| 77 | + - compatible |
| 78 | + - reg |
| 79 | + - clocks |
| 80 | + - clock-names |
| 81 | + - '#clock-cells' |
| 82 | + - clock-output-names |
| 83 | + - pinctrl-0 |
| 84 | + - pinctrl-names |
| 85 | + - assigned-clocks |
| 86 | + - assigned-clock-rates |
| 87 | + |
| 88 | +additionalProperties: false |
| 89 | + |
| 90 | +examples: |
| 91 | + - | |
| 92 | + #include <dt-bindings/clock/qcom,gcc-sdm845.h> |
| 93 | + gp_mn: clock-controller@88d3000 { |
| 94 | + compatible = "qcom,clk-gp-mnd"; |
| 95 | + reg = <0x88d3000 0xc>; |
| 96 | + clocks = <&gcc GCC_PDM_XO4_CLK>, |
| 97 | + <&gcc GCC_PDM_AHB_CLK>; |
| 98 | + clock-names = "pdm_clk", "ahb_clk"; |
| 99 | + clock-output-names = "gp_mn_clk"; |
| 100 | + pinctrl-0 = <&gp_mn_pin_active>; |
| 101 | + pinctrl-names = "active"; |
| 102 | + assigned-clocks = <&gcc GCC_PDM_XO4_CLK>; |
| 103 | + assigned-clock-rates = <4800000>; |
| 104 | + #clock-cells = <0>; |
| 105 | + }; |
0 commit comments