Re: [PATCH v3 1/3] dt-bindings: leds: Add LP5812 LED driver
From: Krzysztof Kozlowski
Date: Tue Mar 18 2025 - 15:00:23 EST
On 18/03/2025 14:56, Nam Tran wrote:
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/leds/ti,lp5812.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +$ref: /schemas/leds/common.yaml#
>> +
>> +title: Linux driver for LP5812 LED from Texas Instruments
>
> Nothing improved.
>
> Nam: Do you mean the title should focus on the LP5812 hardware itself? If so, I will update it accordingly to better describe the device.
No, I mean you should say what this device is, not what the driver is
for. Bindings are about hardware, not drivers.
>
>> +
>> +maintainers:
>> + - Nam Tran <trannamatk@xxxxxxxxx>
>> +
>> +description: |
>> + The LP5812 is an I2C LED Driver that can support LED matrix 4x3.
>> + For more product information please see the link below:
>> + https://www.ti.com/product/LP5812#tech-docs
>> +
>> +properties:
>> + compatible:
>> + const: ti,lp5812
>> +
>> + reg:
>> + maxItems: 1
>
>
> This improved... but:
>
>> +
>> + "#address-cells":
>> + const: 1
>> +
>> + "#size-cells":
>> + const: 0
>
> What are these?
>
> Nam: I included the #address-cells and #size-cells properties to resolve a warning encountered when running:
> make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/ti,lp5812.yaml
> The specific warning was:
> Documentation/devicetree/bindings/leds/ti,lp5812.example.dts:23.17-30: Warning (reg_format): /example-0/i2c/led-controller@1b:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
This makes no sense.
> This warning suggests that the default values for #address-cells and #size-cells in the schema context are not aligned with the LP5812's expected usage. To explicitly define the correct values, I set these properties as mentioned.
> This ensures that the binding schema validation passes without warnings. If you believe a different approach is more appropriate, I’m happy to adjust the binding accordingly.
I can barely parse your messages. They are neither properly quoting my
replies, nor wrapped according to email style. Use standard format,
expressed in countless guides bout netiquette and mailing lists.
You added properties to hide warning, instead of fixing the warning, but
these properties make nos sense here.
>
>> +
>> +required:
>> + - compatible
>> + - reg
>> +
>
> Nothing improved here.
> Your previous comment
> No ref to LED common schema? No other properties? This is too incomplete
>
> Nam: I have chosen not to reference common.yaml in the LP5812 binding because the LP5812 does not fully align with the standard LED properties defined in the common schema. Since the driver does
That's a no go.
> not use standard properties like function, color, or max-brightness, I believe referencing the common schema would introduce unnecessary constraints.
Driver? Please describe hardware, not driver.
> Currently, I have included compatible and reg as required properties, as they are essential for describing the LP5812 device. Are there additional properties that should be marked as required? Or if you have specific improvements in mind, I would appreciate your guidance.
Look at other bindings and do not re-invent.
>
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + i2c {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + led-controller@1b {
>> + compatible = "ti,lp5812";
>> + reg = <0x1b>;
>> + };
>> + };
>> +
>> +...
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 8e0736dc2ee0..2bd9f5132cab 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -23506,6 +23506,12 @@ S: Maintained
>> F: Documentation/devicetree/bindings/leds/backlight/ti,lp8864.yaml
>> F: drivers/leds/leds-lp8864.c
>>
>> +TEXAS INSTRUMENTS' LP5812 LED DRIVER
>
> Nothing improved.
> Your previous comment
> 5 is before 8, so this does not look sorted.
>
> Nam: I have reviewed the sorting order in MAINTAINERS, and I believe the current placement of LP5812 is correct. Since "LB" comes before "LP" alphabetically, "TEXAS INSTRUMENTS' LB8864 LED DRIVER" is correctly listed before "TEXAS INSTRUMENTS' LP5812 LED BACKLIGHT DRIVER".
Indeed, existing entry has typo, so code is fine. Is it such a big deal
to answer to reviewer to his comment?
Best regards,
Krzysztof