leds-mt6370-rgb.rst 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .. SPDX-License-Identifier: GPL-2.0
  2. =========================================
  3. The device for Mediatek MT6370 RGB LED
  4. =========================================
  5. Description
  6. -----------
  7. The MT6370 integrates a four-channel RGB LED driver, designed to provide a
  8. variety of lighting effect for mobile device applications. The RGB LED devices
  9. includes a smart LED string controller and it can drive 3 channels of LEDs with
  10. a sink current up to 24mA and a CHG_VIN power good indicator LED with sink
  11. current up to 6mA. It provides three operation modes for RGB LEDs:
  12. PWM Dimming mode, breath pattern mode, and constant current mode. The device
  13. can increase or decrease the brightness of the RGB LED via an I2C interface.
  14. The breath pattern for a channel can be programmed using the "pattern" trigger,
  15. using the hw_pattern attribute.
  16. /sys/class/leds/<led>/hw_pattern
  17. --------------------------------
  18. Specify a hardware breath pattern for a MT6370 RGB LED.
  19. The breath pattern is a series of timing pairs, with the hold-time expressed in
  20. milliseconds. And the brightness is controlled by
  21. '/sys/class/leds/<led>/brightness'. The pattern doesn't include the brightness
  22. setting. Hardware pattern only controls the timing for each pattern stage
  23. depending on the current brightness setting.
  24. Pattern diagram::
  25. "0 Tr1 0 Tr2 0 Tf1 0 Tf2 0 Ton 0 Toff" --> '0' for dummy brightness code
  26. ^
  27. | ============
  28. | / \ /
  29. Icurr | / \ /
  30. | / \ /
  31. | / \ / .....repeat
  32. | / \ /
  33. | --- --- ---
  34. |--- --- ---
  35. +----------------------------------============------------> Time
  36. < Tr1><Tr2>< Ton ><Tf1><Tf2 >< Toff >< Tr1><Tr2>
  37. Timing description:
  38. * Tr1: First rising time for 0% - 30% load.
  39. * Tr2: Second rising time for 31% - 100% load.
  40. * Ton: On time for 100% load.
  41. * Tf1: First falling time for 100% - 31% load.
  42. * Tf2: Second falling time for 30% to 0% load.
  43. * Toff: Off time for 0% load.
  44. * Tr1/Tr2/Tf1/Tf2/Ton: 125ms to 3125ms, 200ms per step.
  45. * Toff: 250ms to 6250ms, 400ms per step.
  46. Pattern example::
  47. "0 125 0 125 0 125 0 125 0 625 0 1050"
  48. This Will configure Tr1/Tr2/Tf1/Tf2 to 125m, Ton to 625ms, and Toff to 1050ms.