diff mbox series

[V4,5/5] dt-bindings: power: reset: qcom-pon: Convert qcom PON binding to yaml

Message ID 1620800053-26405-6-git-send-email-skakit@codeaurora.org
State Not Applicable, archived
Headers show
Series Add support for PMK8350 PON_HLOS PMIC peripheral | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 2 warnings, 80 lines checked
robh/dt-meta-schema success
robh/dtbs-check success

Commit Message

Satya Priya May 12, 2021, 6:14 a.m. UTC
Convert qcom PON binding from .txt to .yaml format.

Signed-off-by: satya priya <skakit@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
---
Changes in V2:
 - As per Rob's comments, converted the main PON binding and added in V2.
   Dropped example here to have one full example in qcom,pm8941-pwrkey.yaml

Changes in V3:
 - As per Sebastian's comments, added allOf to refer reboot-mode.yaml and
   used unevaluatedProperties = false. Added maxItems for reg.

Changes in V4:
 - Added the example back. Removed it in qcom,pm8941-pwrkey.yaml

 .../devicetree/bindings/power/reset/qcom,pon.txt   | 49 -------------
 .../devicetree/bindings/power/reset/qcom,pon.yaml  | 80 ++++++++++++++++++++++
 2 files changed, 80 insertions(+), 49 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/power/reset/qcom,pon.txt
 create mode 100644 Documentation/devicetree/bindings/power/reset/qcom,pon.yaml

Comments

Sebastian Reichel May 12, 2021, 8:24 a.m. UTC | #1
Hi,

On Wed, May 12, 2021 at 11:44:13AM +0530, satya priya wrote:
> Convert qcom PON binding from .txt to .yaml format.
> 
> Signed-off-by: satya priya <skakit@codeaurora.org>
> Reviewed-by: Rob Herring <robh@kernel.org>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>

-- Sebastian

> Changes in V2:
>  - As per Rob's comments, converted the main PON binding and added in V2.
>    Dropped example here to have one full example in qcom,pm8941-pwrkey.yaml
> 
> Changes in V3:
>  - As per Sebastian's comments, added allOf to refer reboot-mode.yaml and
>    used unevaluatedProperties = false. Added maxItems for reg.
> 
> Changes in V4:
>  - Added the example back. Removed it in qcom,pm8941-pwrkey.yaml
> 
>  .../devicetree/bindings/power/reset/qcom,pon.txt   | 49 -------------
>  .../devicetree/bindings/power/reset/qcom,pon.yaml  | 80 ++++++++++++++++++++++
>  2 files changed, 80 insertions(+), 49 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/power/reset/qcom,pon.txt
>  create mode 100644 Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt
> deleted file mode 100644
> index 0c0dc3a..0000000
> --- a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt
> +++ /dev/null
> @@ -1,49 +0,0 @@
> -Qualcomm PON Device
> -
> -The Power On device for Qualcomm PM8xxx is MFD supporting pwrkey
> -and resin along with the Android reboot-mode.
> -
> -This DT node has pwrkey and resin as sub nodes.
> -
> -Required Properties:
> --compatible: Must be one of:
> -	"qcom,pm8916-pon"
> -	"qcom,pms405-pon"
> -	"qcom,pm8998-pon"
> -
> --reg: Specifies the physical address of the pon register
> -
> -Optional subnode:
> --pwrkey: Specifies the subnode pwrkey and should follow the
> - qcom,pm8941-pwrkey.txt description.
> --resin: Specifies the subnode resin and should follow the
> - qcom,pm8xxx-pwrkey.txt description.
> -
> -The rest of the properties should follow the generic reboot-mode description
> -found in reboot-mode.txt
> -
> -Example:
> -
> -	pon@800 {
> -		compatible = "qcom,pm8916-pon";
> -
> -		reg = <0x800>;
> -		mode-bootloader = <0x2>;
> -		mode-recovery = <0x1>;
> -
> -		pwrkey {
> -			compatible = "qcom,pm8941-pwrkey";
> -			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> -			debounce = <15625>;
> -			bias-pull-up;
> -			linux,code = <KEY_POWER>;
> -		};
> -
> -		resin {
> -			compatible = "qcom,pm8941-resin";
> -			interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> -			debounce = <15625>;
> -			bias-pull-up;
> -			linux,code = <KEY_VOLUMEDOWN>;
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> new file mode 100644
> index 0000000..353f155
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> @@ -0,0 +1,80 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/reset/qcom,pon.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm PON Device
> +
> +maintainers:
> +  - Vinod Koul <vkoul@kernel.org>
> +
> +description: |
> +  The Power On device for Qualcomm PM8xxx is MFD supporting pwrkey
> +  and resin along with the Android reboot-mode.
> +
> +  This DT node has pwrkey and resin as sub nodes.
> +
> +allOf:
> +  - $ref: reboot-mode.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - qcom,pm8916-pon
> +      - qcom,pms405-pon
> +      - qcom,pm8998-pon
> +
> +  reg:
> +    maxItems: 1
> +
> +  pwrkey:
> +    type: object
> +    $ref: "../../input/qcom,pm8941-pwrkey.yaml#"
> +
> +  resin:
> +    type: object
> +    $ref: "../../input/qcom,pm8941-pwrkey.yaml#"
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +   #include <dt-bindings/interrupt-controller/irq.h>
> +   #include <dt-bindings/input/linux-event-codes.h>
> +   #include <dt-bindings/spmi/spmi.h>
> +   spmi_bus: spmi@c440000 {
> +     reg = <0x0c440000 0x1100>;
> +     #address-cells = <2>;
> +     #size-cells = <0>;
> +     pmk8350: pmic@0 {
> +       reg = <0x0 SPMI_USID>;
> +       #address-cells = <1>;
> +       #size-cells = <0>;
> +       pmk8350_pon: pon_hlos@1300 {
> +         reg = <0x1300>;
> +         compatible = "qcom,pm8998-pon";
> +
> +         pwrkey {
> +            compatible = "qcom,pm8941-pwrkey";
> +            interrupts = < 0x0 0x8 0 IRQ_TYPE_EDGE_BOTH >;
> +            debounce = <15625>;
> +            bias-pull-up;
> +            linux,code = <KEY_POWER>;
> +         };
> +
> +         resin {
> +            compatible = "qcom,pm8941-resin";
> +            interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> +            debounce = <15625>;
> +            bias-pull-up;
> +            linux,code = <KEY_VOLUMEDOWN>;
> +         };
> +       };
> +     };
> +   };
> +...
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
> of Code Aurora Forum, hosted by The Linux Foundation
>
Stephen Boyd July 21, 2021, 11:12 p.m. UTC | #2
Quoting satya priya (2021-05-11 23:14:13)
> Convert qcom PON binding from .txt to .yaml format.
>
> Signed-off-by: satya priya <skakit@codeaurora.org>
> Reviewed-by: Rob Herring <robh@kernel.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Dmitry Torokhov July 23, 2021, 7:37 p.m. UTC | #3
On Wed, May 12, 2021 at 11:44:13AM +0530, satya priya wrote:
> Convert qcom PON binding from .txt to .yaml format.
> 
> Signed-off-by: satya priya <skakit@codeaurora.org>
> Reviewed-by: Rob Herring <robh@kernel.org>

Applied, thank you.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt b/Documentation/devicetree/bindings/power/reset/qcom,pon.txt
deleted file mode 100644
index 0c0dc3a..0000000
--- a/Documentation/devicetree/bindings/power/reset/qcom,pon.txt
+++ /dev/null
@@ -1,49 +0,0 @@ 
-Qualcomm PON Device
-
-The Power On device for Qualcomm PM8xxx is MFD supporting pwrkey
-and resin along with the Android reboot-mode.
-
-This DT node has pwrkey and resin as sub nodes.
-
-Required Properties:
--compatible: Must be one of:
-	"qcom,pm8916-pon"
-	"qcom,pms405-pon"
-	"qcom,pm8998-pon"
-
--reg: Specifies the physical address of the pon register
-
-Optional subnode:
--pwrkey: Specifies the subnode pwrkey and should follow the
- qcom,pm8941-pwrkey.txt description.
--resin: Specifies the subnode resin and should follow the
- qcom,pm8xxx-pwrkey.txt description.
-
-The rest of the properties should follow the generic reboot-mode description
-found in reboot-mode.txt
-
-Example:
-
-	pon@800 {
-		compatible = "qcom,pm8916-pon";
-
-		reg = <0x800>;
-		mode-bootloader = <0x2>;
-		mode-recovery = <0x1>;
-
-		pwrkey {
-			compatible = "qcom,pm8941-pwrkey";
-			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
-			debounce = <15625>;
-			bias-pull-up;
-			linux,code = <KEY_POWER>;
-		};
-
-		resin {
-			compatible = "qcom,pm8941-resin";
-			interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
-			debounce = <15625>;
-			bias-pull-up;
-			linux,code = <KEY_VOLUMEDOWN>;
-		};
-	};
diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
new file mode 100644
index 0000000..353f155
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
@@ -0,0 +1,80 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/reset/qcom,pon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm PON Device
+
+maintainers:
+  - Vinod Koul <vkoul@kernel.org>
+
+description: |
+  The Power On device for Qualcomm PM8xxx is MFD supporting pwrkey
+  and resin along with the Android reboot-mode.
+
+  This DT node has pwrkey and resin as sub nodes.
+
+allOf:
+  - $ref: reboot-mode.yaml#
+
+properties:
+  compatible:
+    enum:
+      - qcom,pm8916-pon
+      - qcom,pms405-pon
+      - qcom,pm8998-pon
+
+  reg:
+    maxItems: 1
+
+  pwrkey:
+    type: object
+    $ref: "../../input/qcom,pm8941-pwrkey.yaml#"
+
+  resin:
+    type: object
+    $ref: "../../input/qcom,pm8941-pwrkey.yaml#"
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+   #include <dt-bindings/interrupt-controller/irq.h>
+   #include <dt-bindings/input/linux-event-codes.h>
+   #include <dt-bindings/spmi/spmi.h>
+   spmi_bus: spmi@c440000 {
+     reg = <0x0c440000 0x1100>;
+     #address-cells = <2>;
+     #size-cells = <0>;
+     pmk8350: pmic@0 {
+       reg = <0x0 SPMI_USID>;
+       #address-cells = <1>;
+       #size-cells = <0>;
+       pmk8350_pon: pon_hlos@1300 {
+         reg = <0x1300>;
+         compatible = "qcom,pm8998-pon";
+
+         pwrkey {
+            compatible = "qcom,pm8941-pwrkey";
+            interrupts = < 0x0 0x8 0 IRQ_TYPE_EDGE_BOTH >;
+            debounce = <15625>;
+            bias-pull-up;
+            linux,code = <KEY_POWER>;
+         };
+
+         resin {
+            compatible = "qcom,pm8941-resin";
+            interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+            debounce = <15625>;
+            bias-pull-up;
+            linux,code = <KEY_VOLUMEDOWN>;
+         };
+       };
+     };
+   };
+...