Re: [PATCH 2/7] dt-bindings: leds: leds-qcom-lpg: Add support for LUT through NVMEM devices

From: Krzysztof Kozlowski
Date: Sat Jun 24 2023 - 05:43:15 EST


On 21/06/2023 20:59, Anjelique Melendez wrote:
> Update leds-qcom-lpg bindings to support LUT patterns through NVMEM
> devices.
>
> Signed-off-by: Anjelique Melendez <quic_amelende@xxxxxxxxxxx>
> ---
> .../bindings/leds/leds-qcom-lpg.yaml | 85 +++++++++++++++++++
> 1 file changed, 85 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> index e6f1999cb22f..c9d53820bf83 100644
> --- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> @@ -63,6 +63,31 @@ properties:
> - description: dtest line to attach
> - description: flags for the attachment
>
> + nvmem:
> + description: >
> + Phandle(s) of the nvmem device(s) to access the LUT stored in the SDAM module(s).

It's the first time in this binding the "LUT" appears. Drop redundant
parts like "Phandle(s) of ...." and describe what do you expect there
and why the hardware needs it.

> + This property is required only when LUT mode is supported and the LUT pattern is
> + stored in SDAM modules instead of a LUT module.
> + minItems: 1
> + maxItems: 2
> +
> + nvmem-names:
> + description: >
> + The nvmem device name(s) for the SDAM module(s) where the LUT pattern data is stored.
> + This property is required only when LUT mode is supported with SDAM module instead of
> + LUT module.
> + minItems: 1
> + items:
> + - const: lpg_chan_sdam
> + - const: lut_sdam
> +
> + qcom,pbs-client:
> + $ref: /schemas/types.yaml#/definitions/phandle
> + description: >
> + Phandle of the PBS client used for sending the PBS trigger. This property is


You need to explain what is PBS and what this property is doing.

Phandle of PBS client? This is the PBS client! It does not make sense.



> + required when LUT mode is supported and the LUT pattern is stored in a single
> + SDAM module instead of a LUT module.

Which devices support LUT? Why this is not constrained per variant?

> +
> multi-led:
> type: object
> $ref: leds-class-multicolor.yaml#
> @@ -191,4 +216,64 @@ examples:
> compatible = "qcom,pm8916-pwm";
> #pwm-cells = <2>;
> };
> + - |
> + #include <dt-bindings/leds/common.h>
> +
> + led-controller {
> + compatible = "qcom,pm8350c-pwm";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #pwm-cells = <2>;
> + nvmem-names = "lpg_chan_sdam" , "lut_sdam";

Fix your whitespaces.

> + nvmem = <&pmk8550_sdam_21 &pmk8550_sdam_22>;

Two entries, not one.

Anyway, adding one property does not justify new example. Integrate it
into existing one.

> +
> + led@1 {
> + reg = <1>;
> + color = <LED_COLOR_ID_RED>;
> + label = "red";
> + };
> +
> + led@2 {
> + reg = <2>;
> + color = <LED_COLOR_ID_GREEN>;
> + label = "green";
> + };
> +
> + led@3 {
> + reg = <3>;
> + color = <LED_COLOR_ID_BLUE>;
> + label = "blue";
> + };
> + };
> + - |
> + #include <dt-bindings/leds/common.h>
> +
> + led-controller {
> + compatible = "qcom,pmi632-lpg";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #pwm-cells = <2>;
> + nvmem-names = "lpg_chan_sdam";
> + nvmem = <&pmi632_sdam7>;
> + qcom,pbs-client = <&pmi632_pbs_client3>;

One more example? Why?

Why do you have here only one NVMEM cell? Aren't you missing constraints
in the binding?

Best regards,
Krzysztof