diff mbox series

leds: qcom,pm8058-led: Convert to DT schema

Message ID 20221201131505.42292-1-krzysztof.kozlowski@linaro.org
State New
Headers show
Series leds: qcom,pm8058-led: Convert to DT schema | expand

Commit Message

Krzysztof Kozlowski Dec. 1, 2022, 1:15 p.m. UTC
Convert the Qualcomm PM8058 PMIC LED bindings to DT schema.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/leds/leds-pm8058.txt  | 67 -------------------
 .../bindings/leds/qcom,pm8058-led.yaml        | 57 ++++++++++++++++
 .../devicetree/bindings/mfd/qcom-pm8xxx.yaml  |  4 ++
 3 files changed, 61 insertions(+), 67 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/leds/leds-pm8058.txt
 create mode 100644 Documentation/devicetree/bindings/leds/qcom,pm8058-led.yaml

Comments

Lee Jones Dec. 2, 2022, 8:07 a.m. UTC | #1
On Thu, 01 Dec 2022, Krzysztof Kozlowski wrote:

> On 01/12/2022 14:15, Krzysztof Kozlowski wrote:
> > Convert the Qualcomm PM8058 PMIC LED bindings to DT schema.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  .../devicetree/bindings/leds/leds-pm8058.txt  | 67 -------------------
> >  .../bindings/leds/qcom,pm8058-led.yaml        | 57 ++++++++++++++++
> >  .../devicetree/bindings/mfd/qcom-pm8xxx.yaml  |  4 ++
> >  3 files changed, 61 insertions(+), 67 deletions(-)
> 
> Note to myself:
> 
> Use subject prefixes matching the subsystem (git log --oneline -- ...).

=:-D
Pavel Machek Dec. 7, 2022, 8:11 p.m. UTC | #2
On Thu 2022-12-01 18:08:58, Rob Herring wrote:
> On Thu, Dec 01, 2022 at 02:15:05PM +0100, Krzysztof Kozlowski wrote:
> > Convert the Qualcomm PM8058 PMIC LED bindings to DT schema.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  .../devicetree/bindings/leds/leds-pm8058.txt  | 67 -------------------
> >  .../bindings/leds/qcom,pm8058-led.yaml        | 57 ++++++++++++++++
> >  .../devicetree/bindings/mfd/qcom-pm8xxx.yaml  |  4 ++
> >  3 files changed, 61 insertions(+), 67 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/leds/leds-pm8058.txt
> >  create mode 100644 Documentation/devicetree/bindings/leds/qcom,pm8058-led.yaml
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> 
> Or should I apply it?

Thanks for ACK, let me take it, I guess.

Best regards,
								Pavel
Pavel Machek Dec. 7, 2022, 8:12 p.m. UTC | #3
On Thu 2022-12-01 14:15:05, Krzysztof Kozlowski wrote:
> Convert the Qualcomm PM8058 PMIC LED bindings to DT schema.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thank you, applied.

BR,
									Pavel
Lee Jones Dec. 8, 2022, 10:09 a.m. UTC | #4
On Wed, 07 Dec 2022, Pavel Machek wrote:

> On Thu 2022-12-01 18:08:58, Rob Herring wrote:
> > On Thu, Dec 01, 2022 at 02:15:05PM +0100, Krzysztof Kozlowski wrote:
> > > Convert the Qualcomm PM8058 PMIC LED bindings to DT schema.
> > > 
> > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > ---
> > >  .../devicetree/bindings/leds/leds-pm8058.txt  | 67 -------------------
> > >  .../bindings/leds/qcom,pm8058-led.yaml        | 57 ++++++++++++++++
> > >  .../devicetree/bindings/mfd/qcom-pm8xxx.yaml  |  4 ++
> > >  3 files changed, 61 insertions(+), 67 deletions(-)
> > >  delete mode 100644 Documentation/devicetree/bindings/leds/leds-pm8058.txt
> > >  create mode 100644 Documentation/devicetree/bindings/leds/qcom,pm8058-led.yaml
> > 
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > 
> > Or should I apply it?
> 
> Thanks for ACK, let me take it, I guess.

Did you see Krzysztof's replies to this patch?

Sounded like he was going to re-work it, which is why I left it.
Pavel Machek Dec. 8, 2022, 10:29 a.m. UTC | #5
On Thu 2022-12-08 11:19:47, Krzysztof Kozlowski wrote:
> On 08/12/2022 11:09, Lee Jones wrote:
> > On Wed, 07 Dec 2022, Pavel Machek wrote:
> > 
> >> On Thu 2022-12-01 18:08:58, Rob Herring wrote:
> >>> On Thu, Dec 01, 2022 at 02:15:05PM +0100, Krzysztof Kozlowski wrote:
> >>>> Convert the Qualcomm PM8058 PMIC LED bindings to DT schema.
> >>>>
> >>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>> ---
> >>>>  .../devicetree/bindings/leds/leds-pm8058.txt  | 67 -------------------
> >>>>  .../bindings/leds/qcom,pm8058-led.yaml        | 57 ++++++++++++++++
> >>>>  .../devicetree/bindings/mfd/qcom-pm8xxx.yaml  |  4 ++
> >>>>  3 files changed, 61 insertions(+), 67 deletions(-)
> >>>>  delete mode 100644 Documentation/devicetree/bindings/leds/leds-pm8058.txt
> >>>>  create mode 100644 Documentation/devicetree/bindings/leds/qcom,pm8058-led.yaml
> >>>
> >>> Reviewed-by: Rob Herring <robh@kernel.org>
> >>>
> >>> Or should I apply it?
> >>
> >> Thanks for ACK, let me take it, I guess.
> > 
> > Did you see Krzysztof's replies to this patch?
> > 
> > Sounded like he was going to re-work it, which is why I left it.
> 
> The only rework needed was to add "dt-bindings:" prefix in the subject.
> If you could add it while applying/amending commit, that would be great
> and spare me resend. Otherwise, let me know if you dropped this patch
> and expect a resend.

Lets not do anything if the patch is otherwise correct.

Best regards,
							Pavel
Lee Jones Dec. 8, 2022, 10:57 a.m. UTC | #6
On Thu, 08 Dec 2022, Krzysztof Kozlowski wrote:

> On 08/12/2022 11:09, Lee Jones wrote:
> > On Wed, 07 Dec 2022, Pavel Machek wrote:
> > 
> >> On Thu 2022-12-01 18:08:58, Rob Herring wrote:
> >>> On Thu, Dec 01, 2022 at 02:15:05PM +0100, Krzysztof Kozlowski wrote:
> >>>> Convert the Qualcomm PM8058 PMIC LED bindings to DT schema.
> >>>>
> >>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>> ---
> >>>>  .../devicetree/bindings/leds/leds-pm8058.txt  | 67 -------------------
> >>>>  .../bindings/leds/qcom,pm8058-led.yaml        | 57 ++++++++++++++++
> >>>>  .../devicetree/bindings/mfd/qcom-pm8xxx.yaml  |  4 ++
> >>>>  3 files changed, 61 insertions(+), 67 deletions(-)
> >>>>  delete mode 100644 Documentation/devicetree/bindings/leds/leds-pm8058.txt
> >>>>  create mode 100644 Documentation/devicetree/bindings/leds/qcom,pm8058-led.yaml
> >>>
> >>> Reviewed-by: Rob Herring <robh@kernel.org>
> >>>
> >>> Or should I apply it?
> >>
> >> Thanks for ACK, let me take it, I guess.
> > 
> > Did you see Krzysztof's replies to this patch?
> > 
> > Sounded like he was going to re-work it, which is why I left it.
> 
> The only rework needed was to add "dt-bindings:" prefix in the subject.
> If you could add it while applying/amending commit, that would be great
> and spare me resend. Otherwise, let me know if you dropped this patch
> and expect a resend.

Sounds good:

Acked-by: Lee Jones <lee@kernel.org>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/leds-pm8058.txt b/Documentation/devicetree/bindings/leds/leds-pm8058.txt
deleted file mode 100644
index 89584c49aab2..000000000000
--- a/Documentation/devicetree/bindings/leds/leds-pm8058.txt
+++ /dev/null
@@ -1,67 +0,0 @@ 
-Qualcomm PM8058 LED driver
-
-The Qualcomm PM8058 is a multi-functional device which contains
-an LED driver block for up to six LEDs: three normal LEDs, two
-"flash" LEDs and one "keypad backlight" LED. The names are
-quoted because sometimes these LED drivers are used for wildly
-different things than flash or keypad backlight: their names
-are more of a suggestion than a hard-wired usecase.
-
-Hardware-wise the different LEDs support slightly different
-output currents. The "flash" LEDs do not need to charge nor
-do they support external triggers. They are just powerful LED
-drivers.
-
-The LEDs appear as children to the PM8058 device, with the
-proper compatible string. For the PM8058 bindings see:
-mfd/qcom-pm8xxx.txt.
-
-Each LED is represented as a sub-node of the syscon device. Each
-node's name represents the name of the corresponding LED.
-
-LED sub-node properties:
-
-Required properties:
-- compatible: one of
-  "qcom,pm8058-led" (for the normal LEDs at 0x131, 0x132 and 0x133)
-  "qcom,pm8058-keypad-led" (for the "keypad" LED at 0x48)
-  "qcom,pm8058-flash-led" (for the "flash" LEDs at 0x49 and 0xFB)
-
-Optional properties:
-- label: see Documentation/devicetree/bindings/leds/common.txt
-- default-state: see Documentation/devicetree/bindings/leds/common.txt
-- linux,default-trigger: see Documentation/devicetree/bindings/leds/common.txt
-
-Example:
-
-qcom,ssbi@500000 {
-	pmicintc: pmic@0 {
-		compatible = "qcom,pm8058";
-		led@48 {
-			compatible = "qcom,pm8058-keypad-led";
-			reg = <0x48>;
-			label = "pm8050:white:keypad";
-			default-state = "off";
-		};
-		led@131 {
-			compatible = "qcom,pm8058-led";
-			reg = <0x131>;
-			label = "pm8058:red";
-			default-state = "off";
-		};
-		led@132 {
-			compatible = "qcom,pm8058-led";
-			reg = <0x132>;
-			label = "pm8058:yellow";
-			default-state = "off";
-			linux,default-trigger = "mmc0";
-		};
-		led@133 {
-			compatible = "qcom,pm8058-led";
-			reg = <0x133>;
-			label = "pm8058:green";
-			default-state = "on";
-			linux,default-trigger = "heartbeat";
-		};
-	};
-};
diff --git a/Documentation/devicetree/bindings/leds/qcom,pm8058-led.yaml b/Documentation/devicetree/bindings/leds/qcom,pm8058-led.yaml
new file mode 100644
index 000000000000..fa03e73622d4
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/qcom,pm8058-led.yaml
@@ -0,0 +1,57 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/qcom,pm8058-led.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm PM8058 PMIC LED
+
+maintainers:
+  - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+
+description: |
+  The Qualcomm PM8058 contains an LED block for up to six LEDs:: three normal
+  LEDs, two "flash" LEDs and one "keypad backlight" LED. The names are quoted
+  because sometimes these LED drivers are used for wildly different things than
+  flash or keypad backlight:: their names are more of a suggestion than a
+  hard-wired usecase.
+
+  Hardware-wise the different LEDs support slightly different output currents.
+  The "flash" LEDs do not need to charge nor do they support external triggers.
+  They are just powerful LED drivers.
+
+allOf:
+  - $ref: common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - qcom,pm8058-led
+      - qcom,pm8058-keypad-led
+      - qcom,pm8058-flash-led
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    pmic {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led@131 {
+            compatible = "qcom,pm8058-led";
+            reg = <0x131>;
+            label = "pm8058:red";
+            color = <LED_COLOR_ID_RED>;
+            default-state = "off";
+        };
+    };
diff --git a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
index 84b87f01e029..9acad9d326eb 100644
--- a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml
@@ -43,6 +43,10 @@  properties:
   interrupt-controller: true
 
 patternProperties:
+  "led@[0-9a-f]+$":
+    type: object
+    $ref: /schemas/leds/qcom,pm8058-led.yaml#
+
   "rtc@[0-9a-f]+$":
     type: object
     $ref: "../rtc/qcom-pm8xxx-rtc.yaml"