linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Fenglin Wu <quic_fenglinw@quicinc.com>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pavel Machek <pavel@ucw.cz>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org
Cc: quic_collinsd@quicinc.com, quic_subbaram@quicinc.com
Subject: Re: [PATCH v1 2/2] dt-bindings: add bindings for QCOM flash LED
Date: Wed, 28 Sep 2022 10:21:19 +0200	[thread overview]
Message-ID: <6c0e5083-baae-3ed3-5eed-e08bbb9e7576@linaro.org> (raw)
In-Reply-To: <20220928024239.3843909-3-quic_fenglinw@quicinc.com>

On 28/09/2022 04:42, Fenglin Wu wrote:
> Add binding document for flash LED module inside Qualcomm Technologies,
> Inc. PMICs.
> 
> Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>

You did not Cc me on first patch, so difficult to say how much it
matches the driver... There is also no DTS.

> ---
>  .../bindings/leds/leds-qcom-flash.yaml        | 108 ++++++++++++++++++
>  1 file changed, 108 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/leds-qcom-flash.yaml
> 
> diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-flash.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-flash.yaml
> new file mode 100644
> index 000000000000..52a99182961b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-qcom-flash.yaml


Filename matching compatible if there is one fallback (e.g.
qcom,spmi-flash-led.yaml).

> @@ -0,0 +1,108 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/leds-qcom-flash.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Flash LED device inside Qualcomm Technologies, Inc. PMICs
> +
> +maintainers:
> +  - Fenglin Wu <quic_fenglinw@quicinc.com>
> +
> +description: |
> +  Flash LED controller is present inside some Qualcomm Technologies, Inc. PMICs.
> +  The flash LED module can have different number of LED channels supported
> +  e.g. 3 or 4. There are some different registers between them but they can
> +  both support maximum current up to 1.5 A per channel and they can also support
> +  ganging 2 channels together to supply maximum current up to 2 A. The current
> +  will be split symmetrically on each channel and they will be enabled and
> +  disabled at the same time.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - qcom,spmi-flash-led
> +          - qcom,pm8150c-flash-led
> +          - qcom,pm8150l-flash-led
> +          - qcom,pm8350c-flash-led

I doubt these are all different. You should use fallback, which also
will make use of the "items" you used...

> +
> +  reg:
> +    description: address offset of the flash LED controller
> +    maxItems: 1
> +
> +patternProperties:
> +  "^led@[0-3]$":
> +    type: object
> +    $ref: common.yaml#
> +    unevaluatedProperties: false
> +    description:
> +      Represents the physical LED components which are connected to the flash LED channels' output.

Does not look like wrapped at 80.

Other places as well.

> +
> +    properties:

Does not look like you tested the bindings...

You miss here reg.

> +      led-sources:
> +        description: The HW indices of the flash LED channels that connect to the physical LED
> +        allOf:
> +          - minItems: 1
> +            maxItems: 2
> +            items:
> +              enum: [1, 2, 3, 4]
> +
> +      led-max-microamp:
> +        description: |
> +          The maximum current value when LED is not operating in flash mode (i.e. torch mode)
> +          Valid values when an LED is connected to one flash LED channel:
> +            5000 - 500000, step by 5000> +          Valid values when an LED is connected to two flash LED
channels:
> +            10000 - 1000000, step by 10000

You need minimum and maximum.

> +
> +      flash-max-microamp:
> +        description: |
> +          The maximum current value when LED is operating in flash mode.
> +          Valid values when an LED is connected to one flash LED channel:
> +            12500 - 1500000, step by 12500
> +          Valid values when an LED is connected to two flash LED channels:
> +            25000 - 2000000, step by 12500

You need minimum and maximum.


> +
> +      flash-max-timeout-us:
> +        description: |
> +          The maximum timeout value when LED is operating in flash mode.
> +          Valid values: 10000 - 1280000, step by 10000

You need minimum and maximum.

> +
> +    required:
> +      - led-sources
> +      - led-max-microamp

reg.

> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/leds/common.h>
> +    flash-led@ee00 {

Node name: led-controller

> +            compatible = "qcom,spmi-flash-led";
> +            reg = <0xee00>;
> +
> +            led@0 {

Test your bindings...

> +                    function = LED_FUNCTION_FLASH;

Use 4 spaces for indentation of example.

> +                    color = <LED_COLOR_ID_WHITE>;
> +                    led-sources = <1>, <4>;
> +                    led-max-microamp = <300000>;
> +                    flash-max-microamp = <2000000>;
> +                    flash-max-timeout-us = <1280000>;
> +                    function-enumerator = <0>;
> +            };
> +

Best regards,
Krzysztof


  reply	other threads:[~2022-09-28  8:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220928024239.3843909-1-quic_fenglinw@quicinc.com>
2022-09-28  2:42 ` [PATCH v1 1/2] leds: flash: add driver to support flash LED module in QCOM PMICs Fenglin Wu
2022-09-28  2:42 ` [PATCH v1 2/2] dt-bindings: add bindings for QCOM flash LED Fenglin Wu
2022-09-28  8:21   ` Krzysztof Kozlowski [this message]
2022-09-29  2:20     ` Fenglin Wu
2022-09-29  7:06       ` Krzysztof Kozlowski
2022-09-29 10:56         ` Fenglin Wu
2022-09-29 11:13           ` Krzysztof Kozlowski
2022-09-28 12:38   ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c0e5083-baae-3ed3-5eed-e08bbb9e7576@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=quic_collinsd@quicinc.com \
    --cc=quic_fenglinw@quicinc.com \
    --cc=quic_subbaram@quicinc.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).