112 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)2%YAML 1.23---4$id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: Richtek RT8515 1.5A dual channel LED driver8 9maintainers:10 - Linus Walleij <linus.walleij@linaro.org>11 12description: |13 The Richtek RT8515 is a dual channel (two mode) LED driver that14 supports driving a white LED in flash or torch mode. The maximum15 current for each mode is defined in hardware using two resistors16 RFS and RTS.17 18properties:19 compatible:20 const: richtek,rt851521 22 enf-gpios:23 maxItems: 124 description: A connection to the 'ENF' (enable flash) pin.25 26 ent-gpios:27 maxItems: 128 description: A connection to the 'ENT' (enable torch) pin.29 30 richtek,rfs-ohms:31 minimum: 768032 maximum: 36700033 description: The resistance value of the RFS resistor. This34 resistors limits the maximum flash current. This must be set35 for the property flash-max-microamp to work, the RFS resistor36 defines the range of the dimmer setting (brightness) of the37 flash LED.38 39 richtek,rts-ohms:40 minimum: 768041 maximum: 36700042 description: The resistance value of the RTS resistor. This43 resistors limits the maximum torch current. This must be set44 for the property torch-max-microamp to work, the RTS resistor45 defines the range of the dimmer setting (brightness) of the46 torch LED.47 48 led:49 type: object50 $ref: common.yaml#51 properties:52 function: true53 color: true54 flash-max-timeout-us: true55 56 flash-max-microamp:57 maximum: 70000058 description: The maximum current for flash mode59 is hardwired to the component using the RFS resistor to60 ground. The maximum hardware current setting is calculated61 according to the formula Imax = 5500 / RFS. The lowest62 allowed resistance value is 7.86 kOhm giving an absolute63 maximum current of 700mA. By setting this attribute in64 the device tree, you can further restrict the maximum65 current below the hardware limit. This requires the RFS66 to be defined as it defines the maximum range.67 68 led-max-microamp:69 maximum: 70000070 description: The maximum current for torch mode71 is hardwired to the component using the RTS resistor to72 ground. The maximum hardware current setting is calculated73 according to the formula Imax = 5500 / RTS. The lowest74 allowed resistance value is 7.86 kOhm giving an absolute75 maximum current of 700mA. By setting this attribute in76 the device tree, you can further restrict the maximum77 current below the hardware limit. This requires the RTS78 to be defined as it defines the maximum range.79 80 additionalProperties: false81 82required:83 - compatible84 - ent-gpios85 - enf-gpios86 - led87 88additionalProperties: false89 90examples:91 - |92 #include <dt-bindings/gpio/gpio.h>93 #include <dt-bindings/leds/common.h>94 95 led-controller {96 compatible = "richtek,rt8515";97 enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;98 ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;99 richtek,rfs-ohms = <16000>;100 richtek,rts-ohms = <100000>;101 102 led {103 function = LED_FUNCTION_FLASH;104 color = <LED_COLOR_ID_WHITE>;105 flash-max-timeout-us = <250000>;106 flash-max-microamp = <150000>;107 led-max-microamp = <25000>;108 };109 };110 111...112