diff mbox series

[v2,1/4] dt-bindings: clock: separate SDM845 GCC clock bindings

Message ID 20210406231909.3035267-2-dmitry.baryshkov@linaro.org
State Superseded
Headers show
Series clk: qcom: convert gcc-sdm845 to use platform data | expand

Commit Message

Dmitry Baryshkov April 6, 2021, 11:19 p.m. UTC
Separate qcom,gcc-sdm845 clock bindings, adding required clocks and
clock-names properties.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 .../bindings/clock/qcom,gcc-sdm845.yaml       | 84 +++++++++++++++++++
 .../devicetree/bindings/clock/qcom,gcc.yaml   |  2 -
 2 files changed, 84 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml

Comments

Stephen Boyd April 8, 2021, 12:19 a.m. UTC | #1
Quoting Dmitry Baryshkov (2021-04-06 16:19:06)
> Separate qcom,gcc-sdm845 clock bindings, adding required clocks and
> clock-names properties.

Yes, but why?

> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  .../bindings/clock/qcom,gcc-sdm845.yaml       | 84 +++++++++++++++++++
>  .../devicetree/bindings/clock/qcom,gcc.yaml   |  2 -
>  2 files changed, 84 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml
> 
> diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml b/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml
> new file mode 100644
> index 000000000000..4808fa7a6b8c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/clock/qcom,gcc-sdm845.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Global Clock & Reset Controller Binding
> +
> +maintainers:
> +  - Stephen Boyd <sboyd@kernel.org>
> +  - Taniya Das <tdas@codeaurora.org>
> +
> +description: |
> +  Qualcomm global clock control module which supports the clocks, resets and
> +  power domains on SDM845
> +
> +  See also:
> +  - dt-bindings/clock/qcom,gcc-sdm845.h
> +
> +properties:
> +  compatible:
> +    const: qcom,gcc-sdm845
> +
> +  clocks:
> +    items:
> +      - description: Board XO source
> +      - description: Board active XO source
> +      - description: Sleep clock source
> +      - description: PCIE 0 Pipe clock source (Optional clock)
> +      - description: PCIE 1 Pipe clock source (Optional clock)

Can we make them not optional?

> +    minItems: 3
> +    maxItems: 5

And remove this? Because in reality the clks are always going there so
we can put a <0> element in the clocks array if we don't care to
actually specify it.

> +
> +  clock-names:
> +    items:
> +      - const: bi_tcxo
> +      - const: bi_tcxo_ao
> +      - const: sleep_clk
> +      - const: pcie_0_pipe_clk # Optional clock
> +      - const: pcie_1_pipe_clk # Optional clock
> +    minItems: 3
> +    maxItems: 5
> +
Dmitry Baryshkov April 8, 2021, 12:38 a.m. UTC | #2
Hello,

On Thu, 8 Apr 2021 at 03:20, Stephen Boyd <sboyd@kernel.org> wrote:
>

> Quoting Dmitry Baryshkov (2021-04-06 16:19:06)

> > Separate qcom,gcc-sdm845 clock bindings, adding required clocks and

> > clock-names properties.

>

> Yes, but why?


Why separate or why add required clocks? Consider the rest of
bindings, where qcom,gcc.yaml defines older bindings, which do not use
clocks/clock-names and for newer bindings we have one file per binding
(qcom,gcc-apq8064.yaml, qcom,gcc-qcs404.yaml, qcom,gcc-sdx55.yaml,
qcom,gcc-sm8150.yaml, etc).

Do you suggest merging all of them back into a single yaml file?

>

> >

> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> > ---

> >  .../bindings/clock/qcom,gcc-sdm845.yaml       | 84 +++++++++++++++++++

> >  .../devicetree/bindings/clock/qcom,gcc.yaml   |  2 -

> >  2 files changed, 84 insertions(+), 2 deletions(-)

> >  create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml

> >

> > diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml b/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml

> > new file mode 100644

> > index 000000000000..4808fa7a6b8c

> > --- /dev/null

> > +++ b/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml

> > @@ -0,0 +1,84 @@

> > +# SPDX-License-Identifier: GPL-2.0-only

> > +%YAML 1.2

> > +---

> > +$id: http://devicetree.org/schemas/clock/qcom,gcc-sdm845.yaml#

> > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > +

> > +title: Qualcomm Global Clock & Reset Controller Binding

> > +

> > +maintainers:

> > +  - Stephen Boyd <sboyd@kernel.org>

> > +  - Taniya Das <tdas@codeaurora.org>

> > +

> > +description: |

> > +  Qualcomm global clock control module which supports the clocks, resets and

> > +  power domains on SDM845

> > +

> > +  See also:

> > +  - dt-bindings/clock/qcom,gcc-sdm845.h

> > +

> > +properties:

> > +  compatible:

> > +    const: qcom,gcc-sdm845

> > +

> > +  clocks:

> > +    items:

> > +      - description: Board XO source

> > +      - description: Board active XO source

> > +      - description: Sleep clock source

> > +      - description: PCIE 0 Pipe clock source (Optional clock)

> > +      - description: PCIE 1 Pipe clock source (Optional clock)

>

> Can we make them not optional?


Sure,

>

> > +    minItems: 3

> > +    maxItems: 5

>

> And remove this? Because in reality the clks are always going there so

> we can put a <0> element in the clocks array if we don't care to

> actually specify it.


Fine with me.

>

> > +

> > +  clock-names:

> > +    items:

> > +      - const: bi_tcxo

> > +      - const: bi_tcxo_ao

> > +      - const: sleep_clk

> > +      - const: pcie_0_pipe_clk # Optional clock

> > +      - const: pcie_1_pipe_clk # Optional clock

> > +    minItems: 3

> > +    maxItems: 5

> > +




-- 
With best wishes
Dmitry
Dmitry Baryshkov April 8, 2021, 1:16 a.m. UTC | #3
On Thu, 8 Apr 2021 at 04:08, Stephen Boyd <sboyd@kernel.org> wrote:
>

> Quoting Dmitry Baryshkov (2021-04-07 17:38:06)

> > Hello,

> >

> > On Thu, 8 Apr 2021 at 03:20, Stephen Boyd <sboyd@kernel.org> wrote:

> > >

> > > Quoting Dmitry Baryshkov (2021-04-06 16:19:06)

> > > > Separate qcom,gcc-sdm845 clock bindings, adding required clocks and

> > > > clock-names properties.

> > >

> > > Yes, but why?

> >

> > Why separate or why add required clocks? Consider the rest of

>

> Why separate the binding from the overall gcc one.

>

> > bindings, where qcom,gcc.yaml defines older bindings, which do not use

> > clocks/clock-names and for newer bindings we have one file per binding

> > (qcom,gcc-apq8064.yaml, qcom,gcc-qcs404.yaml, qcom,gcc-sdx55.yaml,

> > qcom,gcc-sm8150.yaml, etc).

> >

> > Do you suggest merging all of them back into a single yaml file?

>

> No. Please add the "why" part to the commit text. The "how" and "what"

> should be clear from the patch itself. I guess "so we can add required

> clocks and clock-names properties to the binding" should be sufficient.


Ah, got you. Sorry for the confusion. Will send v3 shortly.

-- 
With best wishes
Dmitry
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml b/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml
new file mode 100644
index 000000000000..4808fa7a6b8c
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml
@@ -0,0 +1,84 @@ 
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,gcc-sdm845.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Global Clock & Reset Controller Binding
+
+maintainers:
+  - Stephen Boyd <sboyd@kernel.org>
+  - Taniya Das <tdas@codeaurora.org>
+
+description: |
+  Qualcomm global clock control module which supports the clocks, resets and
+  power domains on SDM845
+
+  See also:
+  - dt-bindings/clock/qcom,gcc-sdm845.h
+
+properties:
+  compatible:
+    const: qcom,gcc-sdm845
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: Board active XO source
+      - description: Sleep clock source
+      - description: PCIE 0 Pipe clock source (Optional clock)
+      - description: PCIE 1 Pipe clock source (Optional clock)
+    minItems: 3
+    maxItems: 5
+
+  clock-names:
+    items:
+      - const: bi_tcxo
+      - const: bi_tcxo_ao
+      - const: sleep_clk
+      - const: pcie_0_pipe_clk # Optional clock
+      - const: pcie_1_pipe_clk # Optional clock
+    minItems: 3
+    maxItems: 5
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  reg:
+    maxItems: 1
+
+  protected-clocks:
+    description:
+      Protected clock specifier list as per common clock binding.
+
+required:
+  - compatible
+  - reg
+  - '#clock-cells'
+  - '#reset-cells'
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  # Example for GCC for MSM8960:
+  - |
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    clock-controller@100000 {
+      compatible = "qcom,gcc-sdm845";
+      reg = <0x100000 0x1f0000>;
+      clocks = <&rpmhcc RPMH_CXO_CLK>,
+               <&rpmhcc RPMH_CXO_CLK_A>,
+               <&sleep_clk>;
+      clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk";
+      #clock-cells = <1>;
+      #reset-cells = <1>;
+      #power-domain-cells = <1>;
+    };
+...
diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc.yaml b/Documentation/devicetree/bindings/clock/qcom,gcc.yaml
index ee0467fb5e31..490edad25830 100644
--- a/Documentation/devicetree/bindings/clock/qcom,gcc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,gcc.yaml
@@ -32,7 +32,6 @@  description: |
   - dt-bindings/clock/qcom,gcc-mdm9615.h
   - dt-bindings/reset/qcom,gcc-mdm9615.h
   - dt-bindings/clock/qcom,gcc-sdm660.h  (qcom,gcc-sdm630 and qcom,gcc-sdm660)
-  - dt-bindings/clock/qcom,gcc-sdm845.h
 
 properties:
   compatible:
@@ -52,7 +51,6 @@  properties:
       - qcom,gcc-mdm9615
       - qcom,gcc-sdm630
       - qcom,gcc-sdm660
-      - qcom,gcc-sdm845
 
   '#clock-cells':
     const: 1