richtek,rt8515.yaml 3.5 KB

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