From f797dbf9a1ac1c50de6c1fac7110e7f8213b6848 Mon Sep 17 00:00:00 2001 From: ChiYuan Huang Date: Fri, 10 Mar 2023 14:55:57 +0800 Subject: docs: leds: Add MT6370 RGB LED pattern document Document the MT6370 RGB LED pattern trigger. This simply describe how the pattern works, each timing period, and the pattern diagram for MT6370 RGB LED. Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/38f1e863b0f099158a63fb6f95056a1cb30d80a0.1678430444.git.chiaen_wu@richtek.com --- Documentation/leds/leds-mt6370-rgb.rst | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Documentation/leds/leds-mt6370-rgb.rst (limited to 'Documentation/leds') diff --git a/Documentation/leds/leds-mt6370-rgb.rst b/Documentation/leds/leds-mt6370-rgb.rst new file mode 100644 index 000000000000..abf739e44842 --- /dev/null +++ b/Documentation/leds/leds-mt6370-rgb.rst @@ -0,0 +1,64 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========================================= +The device for Mediatek MT6370 RGB LED +========================================= + +Description +----------- + +The MT6370 integrates a four-channel RGB LED driver, designed to provide a +variety of lighting effect for mobile device applications. The RGB LED devices +includes a smart LED string controller and it can drive 3 channels of LEDs with +a sink current up to 24mA and a CHG_VIN power good indicator LED with sink +current up to 6mA. It provides three operation modes for RGB LEDs: +PWM Dimming mode, breath pattern mode, and constant current mode. The device +can increase or decrease the brightness of the RGB LED via an I2C interface. + +The breath pattern for a channel can be programmed using the "pattern" trigger, +using the hw_pattern attribute. + +/sys/class/leds//hw_pattern +-------------------------------- + +Specify a hardware breath pattern for a MT6370 RGB LED. + +The breath pattern is a series of timing pairs, with the hold-time expressed in +milliseconds. And the brightness is controlled by +'/sys/class/leds//brightness'. The pattern doesn't include the brightness +setting. Hardware pattern only controls the timing for each pattern stage +depending on the current brightness setting. + +Pattern diagram:: + + "0 Tr1 0 Tr2 0 Tf1 0 Tf2 0 Ton 0 Toff" --> '0' for dummy brightness code + + ^ + | ============ + | / \ / +Icurr | / \ / + | / \ / + | / \ / .....repeat + | / \ / + | --- --- --- + |--- --- --- + +----------------------------------============------------> Time + < Tr1>< Ton >< Toff >< Tr1> + +Timing description:: + +Tr1: First rising time for duty 0 to 30%. +Tr2: Second rising time for duty 31% to 100%. +Ton: On time for duty 100%. +Tf1: First falling time for duty 100% to 31%. +Tf2: Second falling time for duty 30% to 0%. +Toff: Off time for duty 0%. + +Tr1/Tr2/Tf1/Tf2/Ton: 125ms to 3125ms, 200ms per step. +Toff: 250ms to 6250ms, 400ms per step. + +Pattern example:: + + "0 125 0 125 0 125 0 125 0 625 0 1050" + +This Will configure Tr1/Tr2/Tf1/Tf2 to 125m, Ton to 625ms, and Toff to 1050ms. -- cgit v1.2.3 From 1d105d6cddd03f97303fd4cbcf62834d6ed820c3 Mon Sep 17 00:00:00 2001 From: Bagas Sanjaya Date: Sun, 19 Mar 2023 14:49:01 +0700 Subject: Documentation: leds: Add MT6370 doc to the toctree Commit 4ba9df04b7ac66 ("docs: leds: Add MT6370 RGB LED pattern document") adds documentation for Mediatek MT6370 RGB LED device, but forgets to include it to leds toctree index. Add the missing entry. Link: https://lore.kernel.org/oe-kbuild-all/202303182310.tB1mUzU7-lkp@intel.com/ Fixes: 4ba9df04b7ac66 ("docs: leds: Add MT6370 RGB LED pattern document") Reported-by: kernel test robot Signed-off-by: Bagas Sanjaya Acked-by: Pavel Machek Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230319074903.13075-2-bagasdotme@gmail.com --- Documentation/leds/index.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation/leds') diff --git a/Documentation/leds/index.rst b/Documentation/leds/index.rst index b9ca081fac71..ce57254cb871 100644 --- a/Documentation/leds/index.rst +++ b/Documentation/leds/index.rst @@ -25,5 +25,6 @@ LEDs leds-lp5562 leds-lp55xx leds-mlxcpld + leds-mt6370-rgb leds-sc27xx leds-qcom-lpg -- cgit v1.2.3 From cc087c0b137e9e86457f84a7b5b1416938101a14 Mon Sep 17 00:00:00 2001 From: Bagas Sanjaya Date: Sun, 19 Mar 2023 14:49:02 +0700 Subject: Documentation: leds: mt6370: Properly wrap hw_pattern chart The pattern diagram (chart) of /sys/class/leds//hw_pattern is wrapped in literal code block. However, the block indentation is interrupted by Icurr axis label, hence below warnings: Documentation/leds/leds-mt6370-rgb.rst:39: WARNING: Literal block ends without a blank line; unexpected unindent. Documentation/leds/leds-mt6370-rgb.rst:41: WARNING: Line block ends without a blank line. Documentation/leds/leds-mt6370-rgb.rst:46: WARNING: Unexpected indentation. Documentation/leds/leds-mt6370-rgb.rst:44: WARNING: Inline substitution_reference start-string without end-string. Fix the chart indentation by adding 4 more spaces so that the axis label is in the code block. Link: https://lore.kernel.org/oe-kbuild-all/202303182310.tB1mUzU7-lkp@intel.com/ Fixes: 4ba9df04b7ac66 ("docs: leds: Add MT6370 RGB LED pattern document") Reported-by: kernel test robot Signed-off-by: Bagas Sanjaya Acked-by: Pavel Machek Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230319074903.13075-3-bagasdotme@gmail.com --- Documentation/leds/leds-mt6370-rgb.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Documentation/leds') diff --git a/Documentation/leds/leds-mt6370-rgb.rst b/Documentation/leds/leds-mt6370-rgb.rst index abf739e44842..ea782797a06d 100644 --- a/Documentation/leds/leds-mt6370-rgb.rst +++ b/Documentation/leds/leds-mt6370-rgb.rst @@ -31,19 +31,19 @@ depending on the current brightness setting. Pattern diagram:: - "0 Tr1 0 Tr2 0 Tf1 0 Tf2 0 Ton 0 Toff" --> '0' for dummy brightness code - - ^ - | ============ - | / \ / -Icurr | / \ / - | / \ / - | / \ / .....repeat - | / \ / - | --- --- --- - |--- --- --- - +----------------------------------============------------> Time - < Tr1>< Ton >< Toff >< Tr1> + "0 Tr1 0 Tr2 0 Tf1 0 Tf2 0 Ton 0 Toff" --> '0' for dummy brightness code + + ^ + | ============ + | / \ / + Icurr | / \ / + | / \ / + | / \ / .....repeat + | / \ / + | --- --- --- + |--- --- --- + +----------------------------------============------------> Time + < Tr1>< Ton >< Toff >< Tr1> Timing description:: -- cgit v1.2.3 From a8fd44cbd283cb9825f9d799da14234148e5a4dd Mon Sep 17 00:00:00 2001 From: Bagas Sanjaya Date: Sun, 19 Mar 2023 14:49:03 +0700 Subject: Documentation: leds: MT6370: Use bullet lists for timing variables The timing description contains list of timing pattern variables, but it uses code block without indentation instead. Switch to bullet list as it is better fit for this purpose. While at it, substitute "load" for "duty" because the variables control timing for current load into the device. Link: https://lore.kernel.org/oe-kbuild-all/202303182310.tB1mUzU7-lkp@intel.com/ Fixes: 4ba9df04b7ac66 ("docs: leds: Add MT6370 RGB LED pattern document") Reported-by: kernel test robot Signed-off-by: Bagas Sanjaya Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230319074903.13075-4-bagasdotme@gmail.com --- Documentation/leds/leds-mt6370-rgb.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Documentation/leds') diff --git a/Documentation/leds/leds-mt6370-rgb.rst b/Documentation/leds/leds-mt6370-rgb.rst index ea782797a06d..152a2e592172 100644 --- a/Documentation/leds/leds-mt6370-rgb.rst +++ b/Documentation/leds/leds-mt6370-rgb.rst @@ -45,17 +45,17 @@ Pattern diagram:: +----------------------------------============------------> Time < Tr1>< Ton >< Toff >< Tr1> -Timing description:: +Timing description: -Tr1: First rising time for duty 0 to 30%. -Tr2: Second rising time for duty 31% to 100%. -Ton: On time for duty 100%. -Tf1: First falling time for duty 100% to 31%. -Tf2: Second falling time for duty 30% to 0%. -Toff: Off time for duty 0%. + * Tr1: First rising time for 0% - 30% load. + * Tr2: Second rising time for 31% - 100% load. + * Ton: On time for 100% load. + * Tf1: First falling time for 100% - 31% load. + * Tf2: Second falling time for 30% to 0% load. + * Toff: Off time for 0% load. -Tr1/Tr2/Tf1/Tf2/Ton: 125ms to 3125ms, 200ms per step. -Toff: 250ms to 6250ms, 400ms per step. + * Tr1/Tr2/Tf1/Tf2/Ton: 125ms to 3125ms, 200ms per step. + * Toff: 250ms to 6250ms, 400ms per step. Pattern example:: -- cgit v1.2.3 From 57fbfb3b0b6526c9fd9c32383720ff550ace4919 Mon Sep 17 00:00:00 2001 From: Alexander Dahl Date: Tue, 18 Apr 2023 13:34:02 +0200 Subject: docs: leds: ledtrig-oneshot: Fix spelling mistake It's no comparison, but a "first this, then that" situation. Signed-off-by: Alexander Dahl Acked-by: Pavel Machek Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230418113402.188391-1-ada@thorsis.com --- Documentation/leds/ledtrig-oneshot.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/leds') diff --git a/Documentation/leds/ledtrig-oneshot.rst b/Documentation/leds/ledtrig-oneshot.rst index 69fa3ea1d554..e044d69e9c0f 100644 --- a/Documentation/leds/ledtrig-oneshot.rst +++ b/Documentation/leds/ledtrig-oneshot.rst @@ -5,7 +5,7 @@ One-shot LED Trigger This is a LED trigger useful for signaling the user of an event where there are no clear trap points to put standard led-on and led-off settings. Using this trigger, the application needs only to signal the trigger when an event has -happened, than the trigger turns the LED on and than keeps it off for a +happened, then the trigger turns the LED on and then keeps it off for a specified amount of time. This trigger is meant to be usable both for sporadic and dense events. In the -- cgit v1.2.3