lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210324104031.10c6216c@thinkpad>
Date:   Wed, 24 Mar 2021 10:40:31 +0000
From:   Marek Behun <marek.behun@....cz>
To:     Hermes Zhang <chenhui.zhang@...s.com>
Cc:     <pavel@....cz>, <dmurphy@...com>, <robh+dt@...nel.org>,
        <linux-leds@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <chenhuiz@...s.com>,
        <lkml@...s.com>, <kernel@...s.com>
Subject: Re: [PATCH 2/2] dt-binding: leds: Document leds-multi-gpio bindings

On Wed, 24 Mar 2021 15:56:31 +0800
Hermes Zhang <chenhui.zhang@...s.com> wrote:

> From: Hermes Zhang <chenhuiz@...s.com>
> 
> Document the device tree bindings of the multiple GPIOs LED driver
> Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml.

The dt-binding should come before the actual driver. Otherwise there
will be a commit with the driver existing but no documentation for its
bindings.

> +description:
> +  This will support some LED made of multiple GPIOs and the brightness of the
> +  LED could map to different states of the GPIOs.

Don't use future tense. Don't mention drivers in device tree
binding documentation, if it can be helped. The device tree binding
documentation should describe devices and their nodes... (and I see
that I did a similar mistake for the cznic,turris-omnia-leds.yaml
binding, I will have to fix that).

Instead the description should be something like this:
  This binding represents LED devices which are controller with
  multiple GPIO lines in order to achieve more than two brightness
  states.
  

> +
> +properties:
> +  compatible:
> +    const: multi-gpio-led
> +
> +  led-gpios:
> +    description: Array of one or more GPIOs pins used to control the LED.
> +    minItems: 1
> +    maxItems: 8  # Should be enough
> +
> +  led-states:
> +    description: |
> +      The array list the supported states here which will map to brightness
> +      from 0 to maximum. Each item in the array will present all the GPIOs
> +      value by bit.

Again future tense...

> +    $ref: /schemas/types.yaml#/definitions/uint8-array
> +    minItems: 1
> +    maxItems: 16 # Should be enough
> +
> +required:
> +  - compatible
> +  - led-gpios
> +  - led-states
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    gpios-led {
> +      compatible = "multi-gpio-led";
> +
> +      led-gpios = <&gpio0 23 0x1>,
> +                  <&gpio0 24 0x1>;
> +      led-states = /bits/ 8 <0x00 0x01 0x02 0x03>;
> +    };
> +...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ