diff mbox series

[v2,1/2] dt-bindings: leds: Add bindings for Intel LGM SoC

Message ID bce27bce2df36e04c5b9b688b1defd9c4fc9b191.1605526923.git.mallikarjunax.reddy@linux.intel.com
State Changes Requested, archived
Headers show
Series [v2,1/2] dt-bindings: leds: Add bindings for Intel LGM SoC | expand

Checks

Context Check Description
robh/checkpatch success
robh/dt-meta-schema success

Commit Message

Amireddy Mallikarjuna reddy Nov. 16, 2020, 11:42 a.m. UTC
Add DT bindings YAML schema for SSO controller driver
of Lightning Mountain (LGM) SoC.

Signed-off-by: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com>
---
v1:
- Initial version

v2:
- Fix bot errors (wrong indentation).
- Spell out LGM and SSO.
- Remove vendor specific name for LED properites.
- removed deprecating property "label"
- Include 'reg', 'function' & 'color' properties.
---
 .../devicetree/bindings/leds/leds-lgm.yaml         | 130 +++++++++++++++++++++
 1 file changed, 130 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-lgm.yaml

Comments

Rob Herring (Arm) Dec. 7, 2020, 7:29 p.m. UTC | #1
On Mon, Nov 16, 2020 at 07:42:51PM +0800, Amireddy Mallikarjuna reddy wrote:
> Add DT bindings YAML schema for SSO controller driver
> of Lightning Mountain (LGM) SoC.
> 
> Signed-off-by: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com>
> ---
> v1:
> - Initial version
> 
> v2:
> - Fix bot errors (wrong indentation).
> - Spell out LGM and SSO.
> - Remove vendor specific name for LED properites.
> - removed deprecating property "label"
> - Include 'reg', 'function' & 'color' properties.
> ---
>  .../devicetree/bindings/leds/leds-lgm.yaml         | 130 +++++++++++++++++++++
>  1 file changed, 130 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/leds-lgm.yaml
> 
> diff --git a/Documentation/devicetree/bindings/leds/leds-lgm.yaml b/Documentation/devicetree/bindings/leds/leds-lgm.yaml
> new file mode 100644
> index 000000000000..d9c53ec30ad1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-lgm.yaml
> @@ -0,0 +1,130 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/leds-lgm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Intel Lightning Mountain (LGM) SoC LED Serial Shift Output (SSO) Controller driver
> +
> +maintainers:
> +  - Yixin.zhu@intel.com
> +  - mallikarjunax.reddy@intel.com

Full names please.

> +
> +properties:
> +  compatible:
> +    const: intel,sso-led

Needs to be SoC specific.

> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 2
> +
> +  clock-names:
> +    maxItems: 2

Drop, redundant.

> +    items:
> +      - const: sso
> +      - const: fpid
> +
> +  gpio-controller: true
> +
> +  '#gpio-cells':
> +    const: 2
> +
> +  intel,sso-gpio-base:
> +    $ref: /schemas/types.yaml#definitions/uint32
> +    description:
> +      Identifies the first gpio handled.

gpio-reserved-ranges doesn't work for you?

> +
> +  ngpios:
> +    minimum: 0
> +    maximum: 32
> +    description:
> +      Number of GPIOs this controller provides.
> +
> +  intel,sso-update-rate:
> +    $ref: /schemas/types.yaml#definitions/uint32
> +    description:
> +      Blink frequency for SOUTs in Hz.

Needs a unit suffix and with that you can drop the $ref.

> +
> +  ssoled:

led-controller

> +    type: object
> +    description:
> +      This sub-node must contain a sub-node for each leds.

       additionalProperties: false

> +
> +    patternProperties:
> +      "^led@[0-23]$":
> +        type: object
> +
> +        properties:
> +          reg:
> +            description: Index of the LED.
> +            minimum: 0
> +            maximum: 2
> +
> +          sso-hw-trigger:

Needs vendor prefix.

> +            type: boolean
> +            description: This property indicates Hardware driven/control LED.
> +
> +          sso-hw-blink:

And here...

> +            type: boolean
> +            description: This property indicates Enable LED blink by Hardware.
> +
> +          sso-blink-rate:
> +            $ref: /schemas/types.yaml#/definitions/uint32
> +            description: LED HW blink frequency.

Needs vendor prefix and unit suffix.

> +
> +          retain-state-suspended:
> +            type: boolean
> +            description: The suspend state of LED can be retained.
> +
> +          retain-state-shutdown:
> +            type: boolean
> +            description: Retain the state of the LED on shutdown.
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - clock-names
> +  - "#gpio-cells"
> +  - gpio-controller
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/intel,lgm-clk.h>
> +    #include <dt-bindings/leds/common.h>
> +
> +    ssogpio: ssogpio@E0D40000 {

gpio@e0d40000

> +      compatible = "intel,sso-led";
> +      reg = <0xE0D40000 0x2E4>;
> +      gpio-controller;
> +      #gpio-cells = <2>;
> +      ngpios = <32>;
> +      pinctrl-names = "default";
> +      pinctrl-0 = <&pinctrl_ledc>;
> +      clocks = <&cgu0 LGM_GCLK_LEDC0>, <&afeclk>;
> +      clock-names = "sso", "fpid";
> +      intel,sso-update-rate = <250000>;
> +
> +      ssoled {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        led@0 {
> +          reg = <0>;
> +          function = "gphy";
> +          color = <LED_COLOR_ID_GREEN>;
> +          led-gpio = <&ssogpio 0 0>;
> +        };
> +
> +        led@23 {
> +          reg = <23>;
> +          function = LED_FUNCTION_POWER;
> +          color = <LED_COLOR_ID_GREEN>;
> +          led-gpio = <&ssogpio 23 0>;
> +        };
> +      };
> +    };
> -- 
> 2.11.0
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/leds-lgm.yaml b/Documentation/devicetree/bindings/leds/leds-lgm.yaml
new file mode 100644
index 000000000000..d9c53ec30ad1
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-lgm.yaml
@@ -0,0 +1,130 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/leds-lgm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Lightning Mountain (LGM) SoC LED Serial Shift Output (SSO) Controller driver
+
+maintainers:
+  - Yixin.zhu@intel.com
+  - mallikarjunax.reddy@intel.com
+
+properties:
+  compatible:
+    const: intel,sso-led
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 2
+
+  clock-names:
+    maxItems: 2
+    items:
+      - const: sso
+      - const: fpid
+
+  gpio-controller: true
+
+  '#gpio-cells':
+    const: 2
+
+  intel,sso-gpio-base:
+    $ref: /schemas/types.yaml#definitions/uint32
+    description:
+      Identifies the first gpio handled.
+
+  ngpios:
+    minimum: 0
+    maximum: 32
+    description:
+      Number of GPIOs this controller provides.
+
+  intel,sso-update-rate:
+    $ref: /schemas/types.yaml#definitions/uint32
+    description:
+      Blink frequency for SOUTs in Hz.
+
+  ssoled:
+    type: object
+    description:
+      This sub-node must contain a sub-node for each leds.
+
+    patternProperties:
+      "^led@[0-23]$":
+        type: object
+
+        properties:
+          reg:
+            description: Index of the LED.
+            minimum: 0
+            maximum: 2
+
+          sso-hw-trigger:
+            type: boolean
+            description: This property indicates Hardware driven/control LED.
+
+          sso-hw-blink:
+            type: boolean
+            description: This property indicates Enable LED blink by Hardware.
+
+          sso-blink-rate:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            description: LED HW blink frequency.
+
+          retain-state-suspended:
+            type: boolean
+            description: The suspend state of LED can be retained.
+
+          retain-state-shutdown:
+            type: boolean
+            description: Retain the state of the LED on shutdown.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - "#gpio-cells"
+  - gpio-controller
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/intel,lgm-clk.h>
+    #include <dt-bindings/leds/common.h>
+
+    ssogpio: ssogpio@E0D40000 {
+      compatible = "intel,sso-led";
+      reg = <0xE0D40000 0x2E4>;
+      gpio-controller;
+      #gpio-cells = <2>;
+      ngpios = <32>;
+      pinctrl-names = "default";
+      pinctrl-0 = <&pinctrl_ledc>;
+      clocks = <&cgu0 LGM_GCLK_LEDC0>, <&afeclk>;
+      clock-names = "sso", "fpid";
+      intel,sso-update-rate = <250000>;
+
+      ssoled {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led@0 {
+          reg = <0>;
+          function = "gphy";
+          color = <LED_COLOR_ID_GREEN>;
+          led-gpio = <&ssogpio 0 0>;
+        };
+
+        led@23 {
+          reg = <23>;
+          function = LED_FUNCTION_POWER;
+          color = <LED_COLOR_ID_GREEN>;
+          led-gpio = <&ssogpio 23 0>;
+        };
+      };
+    };