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