* [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515
@ 2020-08-12 9:07 Linus Walleij
2020-08-13 21:06 ` Jacek Anaszewski
0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2020-08-12 9:07 UTC (permalink / raw)
To: Jacek Anaszewski, Pavel Machek, Dan Murphy
Cc: linux-leds, Linus Walleij, newbytee, Stephan Gerhold, devicetree
Add a YAML devicetree binding for the Richtek RT8515
dual channel flash/torch LED driver.
Cc: newbytee@protonmail.com
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
.../bindings/leds/richtek,rt8515.yaml | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 Documentation/devicetree/bindings/leds/richtek,rt8515.yaml
diff --git a/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml b/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml
new file mode 100644
index 000000000000..579ef8a2e40a
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RT8515 1.5A dual channel LED driver
+
+maintainers:
+ - Linus Walleij <linus.walleij@linaro.org>
+
+description: |
+ The Richtek RT8515 is a dual channel (two mode) LED driver that
+ supports driving a white LED in flash or torch mode.
+
+properties:
+ compatible:
+ const: richtek,rt8515
+
+ enf-gpios:
+ maxItems: 1
+ description: A connection to the 'ENF' (enable flash) pin.
+
+ ent-gpios:
+ maxItems: 1
+ description: A connection to the 'ENT' (enable torch) pin.
+
+ led:
+ type: object
+ $ref: common.yaml#
+
+required:
+ - compatible
+ - ent-gpios
+ - enf-gpios
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/leds/common.h>
+
+ led-controller {
+ compatible = "richtek,rt8515";
+ enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
+ ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
+
+ led {
+ function = LED_FUNCTION_FLASH;
+ color = <LED_COLOR_ID_WHITE>;
+ flash-max-timeout-us = <250000>;
+ };
+ };
--
2.26.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515
2020-08-12 9:07 [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515 Linus Walleij
@ 2020-08-13 21:06 ` Jacek Anaszewski
2020-08-19 21:05 ` Linus Walleij
0 siblings, 1 reply; 5+ messages in thread
From: Jacek Anaszewski @ 2020-08-13 21:06 UTC (permalink / raw)
To: Linus Walleij, Pavel Machek, Dan Murphy
Cc: linux-leds, newbytee, Stephan Gerhold, devicetree
Hi Linus,
On 8/12/20 11:07 AM, Linus Walleij wrote:
> Add a YAML devicetree binding for the Richtek RT8515
> dual channel flash/torch LED driver.
>
> Cc: newbytee@protonmail.com
> Cc: Stephan Gerhold <stephan@gerhold.net>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> .../bindings/leds/richtek,rt8515.yaml | 54 +++++++++++++++++++
> 1 file changed, 54 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/leds/richtek,rt8515.yaml
>
> diff --git a/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml b/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml
> new file mode 100644
> index 000000000000..579ef8a2e40a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Richtek RT8515 1.5A dual channel LED driver
> +
> +maintainers:
> + - Linus Walleij <linus.walleij@linaro.org>
> +
> +description: |
> + The Richtek RT8515 is a dual channel (two mode) LED driver that
> + supports driving a white LED in flash or torch mode.
> +
> +properties:
> + compatible:
> + const: richtek,rt8515
> +
> + enf-gpios:
> + maxItems: 1
> + description: A connection to the 'ENF' (enable flash) pin.
> +
> + ent-gpios:
> + maxItems: 1
> + description: A connection to the 'ENT' (enable torch) pin.
> +
> + led:
> + type: object
> + $ref: common.yaml#
> +
> +required:
> + - compatible
> + - ent-gpios
> + - enf-gpios
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/leds/common.h>
> +
> + led-controller {
> + compatible = "richtek,rt8515";
> + enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
> + ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
> +
> + led {
> + function = LED_FUNCTION_FLASH;
> + color = <LED_COLOR_ID_WHITE>;
> + flash-max-timeout-us = <250000>;
Constraints for this property are needed above.
> + };
> + };
>
--
Best regards,
Jacek Anaszewski
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515
2020-08-13 21:06 ` Jacek Anaszewski
@ 2020-08-19 21:05 ` Linus Walleij
2020-08-19 21:20 ` Jacek Anaszewski
0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2020-08-19 21:05 UTC (permalink / raw)
To: Jacek Anaszewski
Cc: Pavel Machek, Dan Murphy, Linux LED Subsystem, newbytee,
Stephan Gerhold,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On Thu, Aug 13, 2020 at 11:06 PM Jacek Anaszewski
<jacek.anaszewski@gmail.com> wrote:
> > + led:
> > + type: object
> > + $ref: common.yaml#
(...)
> > + led {
> > + function = LED_FUNCTION_FLASH;
> > + color = <LED_COLOR_ID_WHITE>;
> > + flash-max-timeout-us = <250000>;
>
> Constraints for this property are needed above.
Can you elaborate on what you expect this to look like?
The property is from common.yaml, so should that be
extended with a constraint?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515
2020-08-19 21:05 ` Linus Walleij
@ 2020-08-19 21:20 ` Jacek Anaszewski
2020-09-09 8:37 ` Pavel Machek
0 siblings, 1 reply; 5+ messages in thread
From: Jacek Anaszewski @ 2020-08-19 21:20 UTC (permalink / raw)
To: Linus Walleij
Cc: Pavel Machek, Dan Murphy, Linux LED Subsystem, newbytee,
Stephan Gerhold,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On 8/19/20 11:05 PM, Linus Walleij wrote:
> On Thu, Aug 13, 2020 at 11:06 PM Jacek Anaszewski
> <jacek.anaszewski@gmail.com> wrote:
>
>>> + led:
>>> + type: object
>>> + $ref: common.yaml#
> (...)
>>> + led {
>>> + function = LED_FUNCTION_FLASH;
>>> + color = <LED_COLOR_ID_WHITE>;
>>> + flash-max-timeout-us = <250000>;
>>
>> Constraints for this property are needed above.
>
> Can you elaborate on what you expect this to look like?
> The property is from common.yaml, so should that be
> extended with a constraint?
Constraints are specific to the hardware, so those should
be provided in the related bindings.
Generally it is customary in similar cases to give min, max
and step values.
I don't have json-schema example, but see old txt DT bindings:
- Documentation/devicetree/bindings/leds/leds-lm3601x.txt
- Documentation/devicetree/bindings/mfd/max77693.txt
--
Best regards,
Jacek Anaszewski
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515
2020-08-19 21:20 ` Jacek Anaszewski
@ 2020-09-09 8:37 ` Pavel Machek
0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2020-09-09 8:37 UTC (permalink / raw)
To: Jacek Anaszewski
Cc: Linus Walleij, Dan Murphy, Linux LED Subsystem, newbytee,
Stephan Gerhold,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]
Hi!
> >>>+ led {
> >>>+ function = LED_FUNCTION_FLASH;
> >>>+ color = <LED_COLOR_ID_WHITE>;
> >>>+ flash-max-timeout-us = <250000>;
> >>
> >>Constraints for this property are needed above.
> >
> >Can you elaborate on what you expect this to look like?
> >The property is from common.yaml, so should that be
> >extended with a constraint?
>
> Constraints are specific to the hardware, so those should
> be provided in the related bindings.
> Generally it is customary in similar cases to give min, max
> and step values.
This looks okay to me.
Driver already knows what the step is, so there's no need to specify
it in the device tree. I was always wondering why minimum is useful. I
guess most hardware can just use first step as a minimum, again no
need to specify that.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-09 8:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-12 9:07 [PATCH 1/2] dt-bindings: leds: Add DT binding for Richtek RT8515 Linus Walleij
2020-08-13 21:06 ` Jacek Anaszewski
2020-08-19 21:05 ` Linus Walleij
2020-08-19 21:20 ` Jacek Anaszewski
2020-09-09 8:37 ` Pavel Machek
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).