2021-05-12 06:16:40

by Satya Priya

[permalink] [raw]
Subject: [PATCH V4 4/5] dt-bindings: input: pm8941-pwrkey: Convert pm8941 power key binding to yaml

Convert qcom pm8941 power key binding from .txt to .yaml format.

The example has been removed in favour of full example being
available in the qcom,pon.yaml binding.

Signed-off-by: satya priya <[email protected]>
---
Changes in V2:
- Fixed bot errors, took reference from input.yaml for "linux,code"
- Added one complete example for powerkey and resin, and referenced it
in main PON binding.
- Moved this patch to the end of the series.

Changes in V3:
- Moved this patch before PON binding patch.
- As per Rob's comments, added allOf at the beginning of binding.
Added maxItems for interrupts.
- Added 'unevaluatedProperties' instead of 'additionalProperties' as
we are using allOf.

Changes in V4:
- Removed the example and added in qcom,pon.yaml

.../bindings/input/qcom,pm8941-pwrkey.txt | 55 ----------------------
.../bindings/input/qcom,pm8941-pwrkey.yaml | 51 ++++++++++++++++++++
2 files changed, 51 insertions(+), 55 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
create mode 100644 Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml

diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
deleted file mode 100644
index 6cd08bc..0000000
--- a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-Qualcomm PM8941 PMIC Power Key
-
-PROPERTIES
-
-- compatible:
- Usage: required
- Value type: <string>
- Definition: must be one of:
- "qcom,pm8941-pwrkey"
- "qcom,pm8941-resin"
- "qcom,pmk8350-pwrkey"
- "qcom,pmk8350-resin"
-
-- reg:
- Usage: required
- Value type: <prop-encoded-array>
- Definition: base address of registers for block
-
-- interrupts:
- Usage: required
- Value type: <prop-encoded-array>
- Definition: key change interrupt; The format of the specifier is
- defined by the binding document describing the node's
- interrupt parent.
-
-- debounce:
- Usage: optional
- Value type: <u32>
- Definition: time in microseconds that key must be pressed or released
- for state change interrupt to trigger.
-
-- bias-pull-up:
- Usage: optional
- Value type: <empty>
- Definition: presence of this property indicates that the KPDPWR_N pin
- should be configured for pull up.
-
-- linux,code:
- Usage: optional
- Value type: <u32>
- Definition: The input key-code associated with the power key.
- Use the linux event codes defined in
- include/dt-bindings/input/linux-event-codes.h
- When property is omitted KEY_POWER is assumed.
-
-EXAMPLE
-
- pwrkey@800 {
- compatible = "qcom,pm8941-pwrkey";
- reg = <0x800>;
- interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
- debounce = <15625>;
- bias-pull-up;
- linux,code = <KEY_POWER>;
- };
diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml
new file mode 100644
index 0000000..62314a5
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/qcom,pm8941-pwrkey.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm PM8941 PMIC Power Key
+
+maintainers:
+ - Courtney Cavin <[email protected]>
+ - Vinod Koul <[email protected]>
+
+allOf:
+ - $ref: input.yaml#
+
+properties:
+ compatible:
+ enum:
+ - qcom,pm8941-pwrkey
+ - qcom,pm8941-resin
+ - qcom,pmk8350-pwrkey
+ - qcom,pmk8350-resin
+
+ interrupts:
+ maxItems: 1
+
+ debounce:
+ description: |
+ Time in microseconds that key must be pressed or
+ released for state change interrupt to trigger.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ bias-pull-up:
+ description: |
+ Presence of this property indicates that the KPDPWR_N
+ pin should be configured for pull up.
+ $ref: /schemas/types.yaml#/definitions/flag
+
+ linux,code:
+ description: |
+ The input key-code associated with the power key.
+ Use the linux event codes defined in
+ include/dt-bindings/input/linux-event-codes.h
+ When property is omitted KEY_POWER is assumed.
+
+required:
+ - compatible
+ - interrupts
+
+unevaluatedProperties: false
+...
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


2021-05-19 09:44:05

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH V4 4/5] dt-bindings: input: pm8941-pwrkey: Convert pm8941 power key binding to yaml

On Wed, 12 May 2021 11:44:12 +0530, satya priya wrote:
> Convert qcom pm8941 power key binding from .txt to .yaml format.
>
> The example has been removed in favour of full example being
> available in the qcom,pon.yaml binding.
>
> Signed-off-by: satya priya <[email protected]>
> ---
> Changes in V2:
> - Fixed bot errors, took reference from input.yaml for "linux,code"
> - Added one complete example for powerkey and resin, and referenced it
> in main PON binding.
> - Moved this patch to the end of the series.
>
> Changes in V3:
> - Moved this patch before PON binding patch.
> - As per Rob's comments, added allOf at the beginning of binding.
> Added maxItems for interrupts.
> - Added 'unevaluatedProperties' instead of 'additionalProperties' as
> we are using allOf.
>
> Changes in V4:
> - Removed the example and added in qcom,pon.yaml
>
> .../bindings/input/qcom,pm8941-pwrkey.txt | 55 ----------------------
> .../bindings/input/qcom,pm8941-pwrkey.yaml | 51 ++++++++++++++++++++
> 2 files changed, 51 insertions(+), 55 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.txt
> create mode 100644 Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml
>

Reviewed-by: Rob Herring <[email protected]>

2021-07-21 23:14:39

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH V4 4/5] dt-bindings: input: pm8941-pwrkey: Convert pm8941 power key binding to yaml

Quoting satya priya (2021-05-11 23:14:12)
> Convert qcom pm8941 power key binding from .txt to .yaml format.
>
> The example has been removed in favour of full example being
> available in the qcom,pon.yaml binding.
>
> Signed-off-by: satya priya <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>

2021-07-23 19:39:29

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH V4 4/5] dt-bindings: input: pm8941-pwrkey: Convert pm8941 power key binding to yaml

On Wed, May 12, 2021 at 11:44:12AM +0530, satya priya wrote:
> Convert qcom pm8941 power key binding from .txt to .yaml format.
>
> The example has been removed in favour of full example being
> available in the qcom,pon.yaml binding.
>
> Signed-off-by: satya priya <[email protected]>

Applied, thank you.

--
Dmitry