Add DT bindings YAML schema for SSO controller driver
of Lightning Mountain(LGM) SoC.
Signed-off-by: Amireddy Mallikarjuna reddy <[email protected]>
---
.../devicetree/bindings/leds/leds-lgm.yaml | 116 +++++++++++++++++++++
1 file changed, 116 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..1acf1fa9643b
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-lgm.yaml
@@ -0,0 +1,116 @@
+# 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 LGM Soc LED SSO driver
+
+maintainers:
+ - [email protected]
+ - [email protected]
+
+properties:
+ compatible:
+ const: intel,sso-led
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 2
+
+ 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:
+ intel,led-pin:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ This indicates the LED pin number.
+
+ intel,sso-brightness:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: brightness level of the LED.
+ minimum: 0
+ maximum: 255
+
+ intel,sso-hw-trigger:
+ type: boolean
+ description: This property indicates Hardware driven/control LED.
+
+ intel,sso-hw-blink:
+ type: boolean
+ description: This property indicates Enable LED blink by Hardware.
+
+ intel,sso-blink-rate:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: LED HW blink frequency.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - "#gpio-cells"
+ - gpio-controller
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/intel,lgm-clk.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 {
+ led0 {
+ label = "led0:green:gphy";
+ led-gpio = <&ssogpio 0 0>;
+ intel,led-pin = <0>;
+ };
+
+ led23 {
+ label = "led23:green:power_led";
+ led-gpio = <&ssogpio 23 0>;
+ intel,led-pin = <23>;
+ intel,sso-brightness = <0x255>;
+ };
+ };
+ };
--
2.11.0
On Thu 2020-11-05 17:43:50, Amireddy Mallikarjuna reddy wrote:
> Add DT bindings YAML schema for SSO controller driver
> of Lightning Mountain(LGM) SoC.
>
intel -> Intel in the title.
"Lightning Mountain(LGM)" -> 'Lightning Mountain (LGM)"
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/leds-lgm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Intel LGM Soc LED SSO driver
Please spell out LGM and SSO here. Soc -> SoC?
> + intel,sso-brightness:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: brightness level of the LED.
> + minimum: 0
> + maximum: 255
?
> + intel,sso-hw-trigger:
> + type: boolean
> + description: This property indicates Hardware driven/control LED.
Why is this intel specific?
> + intel,sso-hw-blink:
> + type: boolean
> + description: This property indicates Enable LED blink by Hardware.
?
> + intel,sso-blink-rate:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: LED HW blink frequency.
?
Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
On Thu, 05 Nov 2020 17:43:50 +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 <[email protected]>
> ---
> .../devicetree/bindings/leds/leds-lgm.yaml | 116 +++++++++++++++++++++
> 1 file changed, 116 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/leds/leds-lgm.yaml
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:14:2: [warning] wrong indentation: expected 2 but found 1 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:18:3: [warning] wrong indentation: expected 3 but found 2 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:21:3: [warning] wrong indentation: expected 3 but found 2 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:29:3: [warning] wrong indentation: expected 3 but found 2 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:34:3: [warning] wrong indentation: expected 3 but found 2 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:40:3: [warning] wrong indentation: expected 3 but found 2 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:45:5: [warning] wrong indentation: expected 3 but found 4 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:47:8: [warning] wrong indentation: expected 6 but found 7 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:57:16: [warning] wrong indentation: expected 14 but found 15 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:78:2: [warning] wrong indentation: expected 2 but found 1 (indentation)
./Documentation/devicetree/bindings/leds/leds-lgm.yaml:87:2: [warning] wrong indentation: expected 2 but found 1 (indentation)
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/leds-lgm.example.dt.yaml: ssogpio@E0D40000: 'clock-names' does not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/leds-lgm.yaml
See https://patchwork.ozlabs.org/patch/1394849
The base for the patch is generally the last rc1. Any dependencies
should be noted.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit.
Hi Pavel,
Thanks for your valuable comments, Please see my comments inline.
On 11/5/2020 5:52 PM, Pavel Machek wrote:
> On Thu 2020-11-05 17:43:50, Amireddy Mallikarjuna reddy wrote:
>> Add DT bindings YAML schema for SSO controller driver
>> of Lightning Mountain(LGM) SoC.
>>
> intel -> Intel in the title.
> "Lightning Mountain(LGM)" -> 'Lightning Mountain (LGM)"
ok.
>
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/leds/leds-lgm.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Intel LGM Soc LED SSO driver
> Please spell out LGM and SSO here. Soc -> SoC?
ok.
>
>
>> + intel,sso-brightness:
>> + $ref: /schemas/types.yaml#/definitions/uint32
>> + description: brightness level of the LED.
>> + minimum: 0
>> + maximum: 255
> ?
In case of using "default-state" property, it is redundant.
>
>> + intel,sso-hw-trigger:
>> + type: boolean
>> + description: This property indicates Hardware driven/control LED.
> Why is this intel specific?
This is not common property, so i used vendor name.
do you suggest only property name without vendor name?
>
>> + intel,sso-hw-blink:
>> + type: boolean
>> + description: This property indicates Enable LED blink by Hardware.
> ?
This is not common property, so i used vendor name.
do you suggest only property name without vendor name?
>
>> + intel,sso-blink-rate:
>> + $ref: /schemas/types.yaml#/definitions/uint32
>> + description: LED HW blink frequency.
> ?
This is not common property, so i used vendor name.
do you suggest only property name without vendor name?
>
> Best regards,
> Pavel