0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Richtek RT8515 1.5A dual channel LED driver
0008
0009 maintainers:
0010 - Linus Walleij <linus.walleij@linaro.org>
0011
0012 description: |
0013 The Richtek RT8515 is a dual channel (two mode) LED driver that
0014 supports driving a white LED in flash or torch mode. The maximum
0015 current for each mode is defined in hardware using two resistors
0016 RFS and RTS.
0017
0018 properties:
0019 compatible:
0020 const: richtek,rt8515
0021
0022 enf-gpios:
0023 maxItems: 1
0024 description: A connection to the 'ENF' (enable flash) pin.
0025
0026 ent-gpios:
0027 maxItems: 1
0028 description: A connection to the 'ENT' (enable torch) pin.
0029
0030 richtek,rfs-ohms:
0031 minimum: 7680
0032 maximum: 367000
0033 description: The resistance value of the RFS resistor. This
0034 resistors limits the maximum flash current. This must be set
0035 for the property flash-max-microamp to work, the RFS resistor
0036 defines the range of the dimmer setting (brightness) of the
0037 flash LED.
0038
0039 richtek,rts-ohms:
0040 minimum: 7680
0041 maximum: 367000
0042 description: The resistance value of the RTS resistor. This
0043 resistors limits the maximum torch current. This must be set
0044 for the property torch-max-microamp to work, the RTS resistor
0045 defines the range of the dimmer setting (brightness) of the
0046 torch LED.
0047
0048 led:
0049 type: object
0050 $ref: common.yaml#
0051 properties:
0052 function: true
0053 color: true
0054 flash-max-timeout-us: true
0055
0056 flash-max-microamp:
0057 maximum: 700000
0058 description: The maximum current for flash mode
0059 is hardwired to the component using the RFS resistor to
0060 ground. The maximum hardware current setting is calculated
0061 according to the formula Imax = 5500 / RFS. The lowest
0062 allowed resistance value is 7.86 kOhm giving an absolute
0063 maximum current of 700mA. By setting this attribute in
0064 the device tree, you can further restrict the maximum
0065 current below the hardware limit. This requires the RFS
0066 to be defined as it defines the maximum range.
0067
0068 led-max-microamp:
0069 maximum: 700000
0070 description: The maximum current for torch mode
0071 is hardwired to the component using the RTS resistor to
0072 ground. The maximum hardware current setting is calculated
0073 according to the formula Imax = 5500 / RTS. The lowest
0074 allowed resistance value is 7.86 kOhm giving an absolute
0075 maximum current of 700mA. By setting this attribute in
0076 the device tree, you can further restrict the maximum
0077 current below the hardware limit. This requires the RTS
0078 to be defined as it defines the maximum range.
0079
0080 additionalProperties: false
0081
0082 required:
0083 - compatible
0084 - ent-gpios
0085 - enf-gpios
0086 - led
0087
0088 additionalProperties: false
0089
0090 examples:
0091 - |
0092 #include <dt-bindings/gpio/gpio.h>
0093 #include <dt-bindings/leds/common.h>
0094
0095 led-controller {
0096 compatible = "richtek,rt8515";
0097 enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
0098 ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
0099 richtek,rfs-ohms = <16000>;
0100 richtek,rts-ohms = <100000>;
0101
0102 led {
0103 function = LED_FUNCTION_FLASH;
0104 color = <LED_COLOR_ID_WHITE>;
0105 flash-max-timeout-us = <250000>;
0106 flash-max-microamp = <150000>;
0107 led-max-microamp = <25000>;
0108 };
0109 };
0110
0111 ...