linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Cc: pavel@ucw.cz, krzk+dt@kernel.org, linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] dt-bindings: leds: Add bindings for the TLC5925 controller
Date: Sun, 5 Jun 2022 18:00:34 -0500	[thread overview]
Message-ID: <20220605230034.GA3683670-robh@kernel.org> (raw)
In-Reply-To: <20220603155332.112272-2-jjhiblot@traphandler.com>

On Fri, Jun 03, 2022 at 05:53:30PM +0200, Jean-Jacques Hiblot wrote:
> Add bindings documentation for the TLC5925 LED controller.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> ---
>  .../devicetree/bindings/leds/ti,tlc5925.yaml  | 106 ++++++++++++++++++
>  1 file changed, 106 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/ti,tlc5925.yaml
> 
> diff --git a/Documentation/devicetree/bindings/leds/ti,tlc5925.yaml b/Documentation/devicetree/bindings/leds/ti,tlc5925.yaml
> new file mode 100644
> index 000000000000..379ade094fd3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/ti,tlc5925.yaml
> @@ -0,0 +1,106 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/ti,tlc5925.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LEDs connected to TI TLC5925 controller
> +
> +maintainers:
> +  - Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> +
> +description: |
> +  The TLC5925 is a low-power 16-channel constant-current LED sink driver.
> +  It is controlled through a SPI interface.
> +  It is built around a shift register and latches which convert serial
> +  input data into a parallel output. Several TLC5925 can be chained to
> +  control more than 16 LEDs with a single chip-select.
> +  The brightness level cannot be controlled, each LED is either on or off.
> +
> +  Each LED is represented as a sub-node of the ti,tlc5925 device.
> +
> +$ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +properties:
> +  compatible:
> +    const: ti,tlc5925
> +
> +  shift-register-length:

Not a common property. Needs a vendor prefix and type.

> +    minimum: 8
> +    description: |
> +      The length of the shift register. If several TLC5925 are chained,
> +      shift_register_length should be set to 16 times the number of TLC5925.
> +      The value must be a multiple of 8.
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +  output-enable-b-gpios:
> +    description: |
> +      Optional GPIO pins to enable/disable the parallel output. They describe
> +      the GPIOs connected to the OE/ pin of the TLC5925s.
> +
> +patternProperties:
> +  "@[0-9a-z]+$":

Unit addresses are typically hex (a-f).

> +    type: object
> +    $ref: common.yaml#
> +
> +    description: |
> +      LED pin number (must be lower than shift_register_length).
> +      The furthest LED down the chain has the pin number 0.
> +
> +    properties:
> +      reg:
> +        minimum: 0

0 is always the minimum.

> +
> +    required:
> +      - reg
> +
> +additionalProperties: true

Not allowed except for common schemas. Must be false. Since you have a 
$ref, you probably want 'unevaluatedProperties: false' instead.


> +
> +required:
> +  - "#address-cells"
> +  - "#size-cells"
> +  - shift_register_length
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    #include <dt-bindings/leds/common.h>
> +
> +    spi0 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        leds@2 {
> +            compatible = "ti,tlc5925";
> +            reg = <0x02>;
> +            spi-max-frequency = <30000000>;
> +            shift_register_length = <32>;
> +            output-enable-b-gpios = <&gpio0b 9 GPIO_ACTIVE_HIGH>, <&gpio0b 7 GPIO_ACTIVE_HIGH>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            led@0 {
> +                reg = <0>;
> +                function = LED_FUNCTION_STATUS;
> +                color = <LED_COLOR_ID_GREEN>;
> +            };
> +
> +            led@4 {
> +                reg = <4>;
> +                function = LED_FUNCTION_STATUS;
> +                color = <LED_COLOR_ID_RED>;
> +            };
> +
> +            led@1f {
> +                reg = <31>;
> +                function = LED_FUNCTION_PANIC;
> +                color = <LED_COLOR_ID_RED>;
> +            };
> +        };
> +
> +    };
> -- 
> 2.25.1
> 
> 

  reply	other threads:[~2022-06-05 23:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03 15:53 [PATCH v2 0/3] Add support for the TLC5925 Jean-Jacques Hiblot
2022-06-03 15:53 ` [PATCH v2 1/3] dt-bindings: leds: Add bindings for the TLC5925 controller Jean-Jacques Hiblot
2022-06-05 23:00   ` Rob Herring [this message]
2022-06-03 15:53 ` [PATCH v2 2/3] leds: Add driver for the TLC5925 LED controller Jean-Jacques Hiblot
2022-06-06  2:41   ` kernel test robot
2022-06-06  9:20   ` kernel test robot
2022-06-03 15:53 ` [PATCH v2 3/3] leds: tlc5925: Add support for non blocking operations Jean-Jacques Hiblot

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=20220605230034.GA3683670-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jjhiblot@traphandler.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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).