xref: /freebsd/sys/contrib/device-tree/Bindings/leds/richtek,rt8515.yaml (revision 5def4c47d4bd90b209b9b4a4ba9faec15846d8fd)
1*5def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*5def4c47SEmmanuel Vadot%YAML 1.2
3*5def4c47SEmmanuel Vadot---
4*5def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml#
5*5def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*5def4c47SEmmanuel Vadot
7*5def4c47SEmmanuel Vadottitle: Richtek RT8515 1.5A dual channel LED driver
8*5def4c47SEmmanuel Vadot
9*5def4c47SEmmanuel Vadotmaintainers:
10*5def4c47SEmmanuel Vadot  - Linus Walleij <linus.walleij@linaro.org>
11*5def4c47SEmmanuel Vadot
12*5def4c47SEmmanuel Vadotdescription: |
13*5def4c47SEmmanuel Vadot  The Richtek RT8515 is a dual channel (two mode) LED driver that
14*5def4c47SEmmanuel Vadot  supports driving a white LED in flash or torch mode. The maximum
15*5def4c47SEmmanuel Vadot  current for each mode is defined in hardware using two resistors
16*5def4c47SEmmanuel Vadot  RFS and RTS.
17*5def4c47SEmmanuel Vadot
18*5def4c47SEmmanuel Vadotproperties:
19*5def4c47SEmmanuel Vadot  compatible:
20*5def4c47SEmmanuel Vadot    const: richtek,rt8515
21*5def4c47SEmmanuel Vadot
22*5def4c47SEmmanuel Vadot  enf-gpios:
23*5def4c47SEmmanuel Vadot    maxItems: 1
24*5def4c47SEmmanuel Vadot    description: A connection to the 'ENF' (enable flash) pin.
25*5def4c47SEmmanuel Vadot
26*5def4c47SEmmanuel Vadot  ent-gpios:
27*5def4c47SEmmanuel Vadot    maxItems: 1
28*5def4c47SEmmanuel Vadot    description: A connection to the 'ENT' (enable torch) pin.
29*5def4c47SEmmanuel Vadot
30*5def4c47SEmmanuel Vadot  richtek,rfs-ohms:
31*5def4c47SEmmanuel Vadot    minimum: 7680
32*5def4c47SEmmanuel Vadot    maximum: 367000
33*5def4c47SEmmanuel Vadot    description: The resistance value of the RFS resistor. This
34*5def4c47SEmmanuel Vadot      resistors limits the maximum flash current. This must be set
35*5def4c47SEmmanuel Vadot      for the property flash-max-microamp to work, the RFS resistor
36*5def4c47SEmmanuel Vadot      defines the range of the dimmer setting (brightness) of the
37*5def4c47SEmmanuel Vadot      flash LED.
38*5def4c47SEmmanuel Vadot
39*5def4c47SEmmanuel Vadot  richtek,rts-ohms:
40*5def4c47SEmmanuel Vadot    minimum: 7680
41*5def4c47SEmmanuel Vadot    maximum: 367000
42*5def4c47SEmmanuel Vadot    description: The resistance value of the RTS resistor. This
43*5def4c47SEmmanuel Vadot      resistors limits the maximum torch current. This must be set
44*5def4c47SEmmanuel Vadot      for the property torch-max-microamp to work, the RTS resistor
45*5def4c47SEmmanuel Vadot      defines the range of the dimmer setting (brightness) of the
46*5def4c47SEmmanuel Vadot      torch LED.
47*5def4c47SEmmanuel Vadot
48*5def4c47SEmmanuel Vadot  led:
49*5def4c47SEmmanuel Vadot    type: object
50*5def4c47SEmmanuel Vadot    $ref: common.yaml#
51*5def4c47SEmmanuel Vadot    properties:
52*5def4c47SEmmanuel Vadot      function: true
53*5def4c47SEmmanuel Vadot      color: true
54*5def4c47SEmmanuel Vadot      flash-max-timeout-us: true
55*5def4c47SEmmanuel Vadot
56*5def4c47SEmmanuel Vadot      flash-max-microamp:
57*5def4c47SEmmanuel Vadot        maximum: 700000
58*5def4c47SEmmanuel Vadot        description: The maximum current for flash mode
59*5def4c47SEmmanuel Vadot          is hardwired to the component using the RFS resistor to
60*5def4c47SEmmanuel Vadot          ground. The maximum hardware current setting is calculated
61*5def4c47SEmmanuel Vadot          according to the formula Imax = 5500 / RFS. The lowest
62*5def4c47SEmmanuel Vadot          allowed resistance value is 7.86 kOhm giving an absolute
63*5def4c47SEmmanuel Vadot          maximum current of 700mA. By setting this attribute in
64*5def4c47SEmmanuel Vadot          the device tree, you can further restrict the maximum
65*5def4c47SEmmanuel Vadot          current below the hardware limit. This requires the RFS
66*5def4c47SEmmanuel Vadot          to be defined as it defines the maximum range.
67*5def4c47SEmmanuel Vadot
68*5def4c47SEmmanuel Vadot      led-max-microamp:
69*5def4c47SEmmanuel Vadot        maximum: 700000
70*5def4c47SEmmanuel Vadot        description: The maximum current for torch mode
71*5def4c47SEmmanuel Vadot          is hardwired to the component using the RTS resistor to
72*5def4c47SEmmanuel Vadot          ground. The maximum hardware current setting is calculated
73*5def4c47SEmmanuel Vadot          according to the formula Imax = 5500 / RTS. The lowest
74*5def4c47SEmmanuel Vadot          allowed resistance value is 7.86 kOhm giving an absolute
75*5def4c47SEmmanuel Vadot          maximum current of 700mA. By setting this attribute in
76*5def4c47SEmmanuel Vadot          the device tree, you can further restrict the maximum
77*5def4c47SEmmanuel Vadot          current below the hardware limit. This requires the RTS
78*5def4c47SEmmanuel Vadot          to be defined as it defines the maximum range.
79*5def4c47SEmmanuel Vadot
80*5def4c47SEmmanuel Vadot    additionalProperties: false
81*5def4c47SEmmanuel Vadot
82*5def4c47SEmmanuel Vadotrequired:
83*5def4c47SEmmanuel Vadot  - compatible
84*5def4c47SEmmanuel Vadot  - ent-gpios
85*5def4c47SEmmanuel Vadot  - enf-gpios
86*5def4c47SEmmanuel Vadot  - led
87*5def4c47SEmmanuel Vadot
88*5def4c47SEmmanuel VadotadditionalProperties: false
89*5def4c47SEmmanuel Vadot
90*5def4c47SEmmanuel Vadotexamples:
91*5def4c47SEmmanuel Vadot  - |
92*5def4c47SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
93*5def4c47SEmmanuel Vadot    #include <dt-bindings/leds/common.h>
94*5def4c47SEmmanuel Vadot
95*5def4c47SEmmanuel Vadot    led-controller {
96*5def4c47SEmmanuel Vadot        compatible = "richtek,rt8515";
97*5def4c47SEmmanuel Vadot        enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
98*5def4c47SEmmanuel Vadot        ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
99*5def4c47SEmmanuel Vadot        richtek,rfs-ohms = <16000>;
100*5def4c47SEmmanuel Vadot        richtek,rts-ohms = <100000>;
101*5def4c47SEmmanuel Vadot
102*5def4c47SEmmanuel Vadot        led {
103*5def4c47SEmmanuel Vadot            function = LED_FUNCTION_FLASH;
104*5def4c47SEmmanuel Vadot            color = <LED_COLOR_ID_WHITE>;
105*5def4c47SEmmanuel Vadot            flash-max-timeout-us = <250000>;
106*5def4c47SEmmanuel Vadot            flash-max-microamp = <150000>;
107*5def4c47SEmmanuel Vadot            led-max-microamp = <25000>;
108*5def4c47SEmmanuel Vadot        };
109*5def4c47SEmmanuel Vadot    };
110*5def4c47SEmmanuel Vadot
111*5def4c47SEmmanuel Vadot...
112