diff mbox series

[1/2] dt-bindings: soc: qcom: YAML-ify SSBI bindings

Message ID 20220930212052.894834-1-dmitry.baryshkov@linaro.org
State New
Headers show
Series [1/2] dt-bindings: soc: qcom: YAML-ify SSBI bindings | expand

Commit Message

Dmitry Baryshkov Sept. 30, 2022, 9:20 p.m. UTC
Convert arm/msm/ssbi.txt yo YAML, moving it to the directory with SoC
bindings (soc/qcom/).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 .../devicetree/bindings/arm/msm/ssbi.txt      | 18 ------
 .../bindings/soc/qcom/qcom,ssbi.yaml          | 63 +++++++++++++++++++
 2 files changed, 63 insertions(+), 18 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/msm/ssbi.txt
 create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,ssbi.yaml

Comments

Dmitry Baryshkov Oct. 2, 2022, 1:46 p.m. UTC | #1
On Sat, 1 Oct 2022 at 12:43, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 30/09/2022 23:20, Dmitry Baryshkov wrote:
> > Convert arm/msm/ssbi.txt yo YAML, moving it to the directory with SoC
> > bindings (soc/qcom/).
>
> I think this should go to "bus" instead. Actually we could put there as
> well GSBI and few others...

ack

>
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> >  .../devicetree/bindings/arm/msm/ssbi.txt      | 18 ------
> >  .../bindings/soc/qcom/qcom,ssbi.yaml          | 63 +++++++++++++++++++
> >  2 files changed, 63 insertions(+), 18 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/arm/msm/ssbi.txt
> >  create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,ssbi.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/arm/msm/ssbi.txt b/Documentation/devicetree/bindings/arm/msm/ssbi.txt
> > deleted file mode 100644
> > index 54fd5ced3401..000000000000
> > --- a/Documentation/devicetree/bindings/arm/msm/ssbi.txt
> > +++ /dev/null
> > @@ -1,18 +0,0 @@
> > -* Qualcomm SSBI
> > -
> > -Some Qualcomm MSM devices contain a point-to-point serial bus used to
> > -communicate with a limited range of devices (mostly power management
> > -chips).
> > -
> > -These require the following properties:
> > -
> > -- compatible: "qcom,ssbi"
> > -
> > -- qcom,controller-type
> > -  indicates the SSBI bus variant the controller should use to talk
> > -  with the slave device.  This should be one of "ssbi", "ssbi2", or
> > -  "pmic-arbiter".  The type chosen is determined by the attached
> > -  slave.
> > -
> > -The slave device should be the single child node of the ssbi device
> > -with a compatible field.
> > diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,ssbi.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,ssbi.yaml
> > new file mode 100644
> > index 000000000000..6154f7222899
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,ssbi.yaml
> > @@ -0,0 +1,63 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/soc/qcom/qcom,ssbi.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
>
> Drop quotes from both above.

ack

>
> > +
> > +title: Qualcomm Single-wire Serial Bus Interface (SSBI)
> > +
> > +description:
> > +  Some Qualcomm MSM devices contain a point-to-point serial bus used to
> > +  communicate with a limited range of devices (mostly power management
> > +  chips).
> > +
> > +maintainers:
> > +  - Andy Gross <agross@kernel.org>
> > +  - Bjorn Andersson <andersson@kernel.org>
> > +
> > +properties:
> > +  compatible:
> > +    const: qcom,ssbi
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  qcom,controller-type:
> > +    description:
> > +      Indicates the SSBI bus variant the controller should use to talk
> > +      with the slave device. The type chosen is determined by the attached
> > +      slave.
> > +    enum:
> > +      - ssbi
> > +      - ssbi2
> > +      - pmic-arbiter
> > +
> > +  pmic:
> > +    type: object
>
> This is quite unspecific... Can we make it a ref to some PMICs schemas?

Yes, I thought about listing all compats, but probably a $ref:
../mfd/qcom-pm8xxx.yaml# makes more sense.

>
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - qcom,controller-type
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    ssbi@c00000 {
> > +        compatible = "qcom,ssbi";
> > +        reg = <0x00c00000 0x1000>;
> > +        qcom,controller-type = "pmic-arbiter";
> > +
> > +        pmic {
> > +            compatible = "qcom,pm8821";
> > +            interrupt-parent = <&msmgpio>;
> > +            interrupts = <76 IRQ_TYPE_LEVEL_LOW>;
> > +            #interrupt-cells = <2>;
> > +            interrupt-controller;
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +        };
> > +    };
> > +...
>
> Best regards,
> Krzysztof
>
Rob Herring Oct. 3, 2022, 5:17 p.m. UTC | #2
On Mon, Oct 03, 2022 at 08:46:09AM +0200, Krzysztof Kozlowski wrote:
> On 02/10/2022 15:46, Dmitry Baryshkov wrote:
> >>> +    enum:
> >>> +      - ssbi
> >>> +      - ssbi2
> >>> +      - pmic-arbiter
> >>> +
> >>> +  pmic:
> >>> +    type: object
> >>
> >> This is quite unspecific... Can we make it a ref to some PMICs schemas?
> > 
> > Yes, I thought about listing all compats, but probably a $ref:
> > ../mfd/qcom-pm8xxx.yaml# makes more sense.
> 
> Then full path - /schemas/mfd/qcom-....

While effectively it's always a QCom PMIC, this is a bus binding, so 
shouldn't it just be 'additionalProperties: { type: object }' without 
any reference to the type of device?

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/msm/ssbi.txt b/Documentation/devicetree/bindings/arm/msm/ssbi.txt
deleted file mode 100644
index 54fd5ced3401..000000000000
--- a/Documentation/devicetree/bindings/arm/msm/ssbi.txt
+++ /dev/null
@@ -1,18 +0,0 @@ 
-* Qualcomm SSBI
-
-Some Qualcomm MSM devices contain a point-to-point serial bus used to
-communicate with a limited range of devices (mostly power management
-chips).
-
-These require the following properties:
-
-- compatible: "qcom,ssbi"
-
-- qcom,controller-type
-  indicates the SSBI bus variant the controller should use to talk
-  with the slave device.  This should be one of "ssbi", "ssbi2", or
-  "pmic-arbiter".  The type chosen is determined by the attached
-  slave.
-
-The slave device should be the single child node of the ssbi device
-with a compatible field.
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,ssbi.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,ssbi.yaml
new file mode 100644
index 000000000000..6154f7222899
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,ssbi.yaml
@@ -0,0 +1,63 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/soc/qcom/qcom,ssbi.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Qualcomm Single-wire Serial Bus Interface (SSBI)
+
+description:
+  Some Qualcomm MSM devices contain a point-to-point serial bus used to
+  communicate with a limited range of devices (mostly power management
+  chips).
+
+maintainers:
+  - Andy Gross <agross@kernel.org>
+  - Bjorn Andersson <andersson@kernel.org>
+
+properties:
+  compatible:
+    const: qcom,ssbi
+
+  reg:
+    maxItems: 1
+
+  qcom,controller-type:
+    description:
+      Indicates the SSBI bus variant the controller should use to talk
+      with the slave device. The type chosen is determined by the attached
+      slave.
+    enum:
+      - ssbi
+      - ssbi2
+      - pmic-arbiter
+
+  pmic:
+    type: object
+
+required:
+  - compatible
+  - reg
+  - qcom,controller-type
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    ssbi@c00000 {
+        compatible = "qcom,ssbi";
+        reg = <0x00c00000 0x1000>;
+        qcom,controller-type = "pmic-arbiter";
+
+        pmic {
+            compatible = "qcom,pm8821";
+            interrupt-parent = <&msmgpio>;
+            interrupts = <76 IRQ_TYPE_LEVEL_LOW>;
+            #interrupt-cells = <2>;
+            interrupt-controller;
+            #address-cells = <1>;
+            #size-cells = <0>;
+        };
+    };
+...