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