Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: leds: convert to ReST

Rename the leds documentation files to ReST, add an
index for them and adjust in order to produce a nice html
output via the Sphinx build system.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

authored by

Mauro Carvalho Chehab and committed by
Jacek Anaszewski
8dab9197 25529ede

+996 -778
+2 -2
Documentation/laptops/thinkpad-acpi.txt
··· 679 679 sysfs notes: 680 680 681 681 The ThinkLight sysfs interface is documented by the LED class 682 - documentation, in Documentation/leds/leds-class.txt. The ThinkLight LED name 682 + documentation, in Documentation/leds/leds-class.rst. The ThinkLight LED name 683 683 is "tpacpi::thinklight". 684 684 685 685 Due to limitations in the sysfs LED class, if the status of the ThinkLight ··· 779 779 sysfs notes: 780 780 781 781 The ThinkPad LED sysfs interface is described in detail by the LED class 782 - documentation, in Documentation/leds/leds-class.txt. 782 + documentation, in Documentation/leds/leds-class.rst. 783 783 784 784 The LEDs are named (in LED ID order, from 0 to 12): 785 785 "tpacpi::power", "tpacpi:orange:batt", "tpacpi:green:batt",
+25
Documentation/leds/index.rst
··· 1 + :orphan: 2 + 3 + ==== 4 + LEDs 5 + ==== 6 + 7 + .. toctree:: 8 + :maxdepth: 1 9 + 10 + leds-class 11 + leds-class-flash 12 + ledtrig-oneshot 13 + ledtrig-transient 14 + ledtrig-usbport 15 + 16 + uleds 17 + 18 + leds-blinkm 19 + leds-lm3556 20 + leds-lp3944 21 + leds-lp5521 22 + leds-lp5523 23 + leds-lp5562 24 + leds-lp55xx 25 + leds-mlxcpld
+34 -30
Documentation/leds/leds-blinkm.txt Documentation/leds/leds-blinkm.rst
··· 1 + ================== 2 + Leds BlinkM driver 3 + ================== 4 + 1 5 The leds-blinkm driver supports the devices of the BlinkM family. 2 6 3 7 They are RGB-LED modules driven by a (AT)tiny microcontroller and ··· 18 14 a) LED class interface for use with triggers 19 15 ############################################ 20 16 21 - The registration follows the scheme: 22 - blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color> 17 + The registration follows the scheme:: 23 18 24 - $ ls -h /sys/class/leds/blinkm-6-* 25 - /sys/class/leds/blinkm-6-9-blue: 26 - brightness device max_brightness power subsystem trigger uevent 19 + blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color> 27 20 28 - /sys/class/leds/blinkm-6-9-green: 29 - brightness device max_brightness power subsystem trigger uevent 21 + $ ls -h /sys/class/leds/blinkm-6-* 22 + /sys/class/leds/blinkm-6-9-blue: 23 + brightness device max_brightness power subsystem trigger uevent 30 24 31 - /sys/class/leds/blinkm-6-9-red: 32 - brightness device max_brightness power subsystem trigger uevent 25 + /sys/class/leds/blinkm-6-9-green: 26 + brightness device max_brightness power subsystem trigger uevent 27 + 28 + /sys/class/leds/blinkm-6-9-red: 29 + brightness device max_brightness power subsystem trigger uevent 33 30 34 31 (same is /sys/bus/i2c/devices/6-0009/leds) 35 32 36 33 We can control the colors separated into red, green and blue and 37 34 assign triggers on each color. 38 35 39 - E.g.: 36 + E.g.:: 40 37 41 - $ cat blinkm-6-9-blue/brightness 42 - 05 38 + $ cat blinkm-6-9-blue/brightness 39 + 05 43 40 44 - $ echo 200 > blinkm-6-9-blue/brightness 45 - $ 41 + $ echo 200 > blinkm-6-9-blue/brightness 42 + $ 46 43 47 - $ modprobe ledtrig-heartbeat 48 - $ echo heartbeat > blinkm-6-9-green/trigger 49 - $ 44 + $ modprobe ledtrig-heartbeat 45 + $ echo heartbeat > blinkm-6-9-green/trigger 46 + $ 50 47 51 48 52 49 b) Sysfs group to control rgb, fade, hsb, scripts ... ··· 57 52 in the sysfs folder of the I2C device. 58 53 E.g. below /sys/bus/i2c/devices/6-0009/blinkm 59 54 60 - $ ls -h /sys/bus/i2c/devices/6-0009/blinkm/ 61 - blue green red test 55 + $ ls -h /sys/bus/i2c/devices/6-0009/blinkm/ 56 + blue green red test 62 57 63 58 Currently supported is just setting red, green, blue 64 59 and a test sequence. 65 60 66 - E.g.: 61 + E.g.:: 67 62 68 - $ cat * 69 - 00 70 - 00 71 - 00 72 - #Write into test to start test sequence!# 63 + $ cat * 64 + 00 65 + 00 66 + 00 67 + #Write into test to start test sequence!# 73 68 74 - $ echo 1 > test 75 - $ 69 + $ echo 1 > test 70 + $ 76 71 77 - $ echo 255 > red 78 - $ 72 + $ echo 255 > red 73 + $ 79 74 80 75 81 76 82 77 as of 6/2012 83 78 84 79 dl9pf <at> gmx <dot> de 85 -
+33 -16
Documentation/leds/leds-class-flash.txt Documentation/leds/leds-class-flash.rst
··· 1 - 1 + ============================== 2 2 Flash LED handling under Linux 3 3 ============================== 4 4 5 5 Some LED devices provide two modes - torch and flash. In the LED subsystem 6 - those modes are supported by LED class (see Documentation/leds/leds-class.txt) 6 + those modes are supported by LED class (see Documentation/leds/leds-class.rst) 7 7 and LED Flash class respectively. The torch mode related features are enabled 8 8 by default and the flash ones only if a driver declares it by setting 9 9 LED_DEV_CAP_FLASH flag. ··· 14 14 15 15 Following sysfs attributes are exposed for controlling flash LED devices: 16 16 (see Documentation/ABI/testing/sysfs-class-led-flash) 17 + 17 18 - flash_brightness 18 19 - max_flash_brightness 19 20 - flash_timeout ··· 32 31 33 32 The driver must call the v4l2_flash_init function to get registered in the 34 33 V4L2 subsystem. The function takes six arguments: 35 - - dev : flash device, e.g. an I2C device 36 - - of_node : of_node of the LED, may be NULL if the same as device's 37 - - fled_cdev : LED flash class device to wrap 38 - - iled_cdev : LED flash class device representing indicator LED associated with 39 - fled_cdev, may be NULL 40 - - ops : V4L2 specific ops 41 - * external_strobe_set - defines the source of the flash LED strobe - 34 + 35 + - dev: 36 + flash device, e.g. an I2C device 37 + - of_node: 38 + of_node of the LED, may be NULL if the same as device's 39 + - fled_cdev: 40 + LED flash class device to wrap 41 + - iled_cdev: 42 + LED flash class device representing indicator LED associated with 43 + fled_cdev, may be NULL 44 + - ops: 45 + V4L2 specific ops 46 + 47 + * external_strobe_set 48 + defines the source of the flash LED strobe - 42 49 V4L2_CID_FLASH_STROBE control or external source, typically 43 50 a sensor, which makes it possible to synchronise the flash 44 51 strobe start with exposure start, 45 - * intensity_to_led_brightness and led_brightness_to_intensity - perform 52 + * intensity_to_led_brightness and led_brightness_to_intensity 53 + perform 46 54 enum led_brightness <-> V4L2 intensity conversion in a device 47 55 specific manner - they can be used for devices with non-linear 48 56 LED current scale. 49 - - config : configuration for V4L2 Flash sub-device 50 - * dev_name - the name of the media entity, unique in the system, 51 - * flash_faults - bitmask of flash faults that the LED flash class 57 + - config: 58 + configuration for V4L2 Flash sub-device 59 + 60 + * dev_name 61 + the name of the media entity, unique in the system, 62 + * flash_faults 63 + bitmask of flash faults that the LED flash class 52 64 device can report; corresponding LED_FAULT* bit definitions are 53 65 available in <linux/led-class-flash.h>, 54 - * torch_intensity - constraints for the LED in TORCH mode 66 + * torch_intensity 67 + constraints for the LED in TORCH mode 55 68 in microamperes, 56 - * indicator_intensity - constraints for the indicator LED 69 + * indicator_intensity 70 + constraints for the indicator LED 57 71 in microamperes, 58 - * has_external_strobe - determines whether the flash strobe source 72 + * has_external_strobe 73 + determines whether the flash strobe source 59 74 can be switched to external, 60 75 61 76 On remove the v4l2_flash_release function has to be called, which takes one
+9 -6
Documentation/leds/leds-class.txt Documentation/leds/leds-class.rst
··· 1 - 1 + ======================== 2 2 LED handling under Linux 3 3 ======================== 4 4 ··· 43 43 44 44 Is currently of the form: 45 45 46 - "devicename:colour:function" 46 + "devicename:colour:function" 47 47 48 48 There have been calls for LED properties such as colour to be exported as 49 49 individual led class attributes. As a solution which doesn't incur as much ··· 57 57 58 58 LED subsystem core exposes following API for setting brightness: 59 59 60 - - led_set_brightness : it is guaranteed not to sleep, passing LED_OFF stops 60 + - led_set_brightness: 61 + it is guaranteed not to sleep, passing LED_OFF stops 61 62 blinking, 62 - - led_set_brightness_sync : for use cases when immediate effect is desired - 63 + 64 + - led_set_brightness_sync: 65 + for use cases when immediate effect is desired - 63 66 it can block the caller for the time required for accessing 64 67 device registers and can sleep, passing LED_OFF stops hardware 65 68 blinking, returns -EBUSY if software blink fallback is enabled. ··· 73 70 74 71 A driver wanting to register a LED classdev for use by other drivers / 75 72 userspace needs to allocate and fill a led_classdev struct and then call 76 - [devm_]led_classdev_register. If the non devm version is used the driver 73 + `[devm_]led_classdev_register`. If the non devm version is used the driver 77 74 must call led_classdev_unregister from its remove function before 78 75 free-ing the led_classdev struct. 79 76 ··· 97 94 timers that may have been required for blinking. 98 95 99 96 The blink_set() function should choose a user friendly blinking value 100 - if it is called with *delay_on==0 && *delay_off==0 parameters. In this 97 + if it is called with `*delay_on==0` && `*delay_off==0` parameters. In this 101 98 case the driver should give back the chosen value through delay_on and 102 99 delay_off parameters to the leds subsystem. 103 100
+76 -24
Documentation/leds/leds-lm3556.txt Documentation/leds/leds-lm3556.rst
··· 1 + ======================== 1 2 Kernel driver for lm3556 2 3 ======================== 3 4 4 - *Texas Instrument: 5 - 1.5 A Synchronous Boost LED Flash Driver w/ High-Side Current Source 5 + * Texas Instrument: 6 + 1.5 A Synchronous Boost LED Flash Driver w/ High-Side Current Source 6 7 * Datasheet: http://www.national.com/ds/LM/LM3556.pdf 7 8 8 9 Authors: 9 - Daniel Jeong 10 + - Daniel Jeong 11 + 10 12 Contact:Daniel Jeong(daniel.jeong-at-ti.com, gshark.jeong-at-gmail.com) 11 13 12 14 Description 13 15 ----------- 14 16 There are 3 functions in LM3556, Flash, Torch and Indicator. 15 17 16 - FLASH MODE 18 + Flash Mode 19 + ^^^^^^^^^^ 20 + 17 21 In Flash Mode, the LED current source(LED) provides 16 target current levels 18 22 from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT 19 23 CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A), 20 24 or by pulling the STROBE pin HIGH. 25 + 21 26 LM3556 Flash can be controlled through sys/class/leds/flash/brightness file 27 + 22 28 * if STROBE pin is enabled, below example control brightness only, and 23 - ON / OFF will be controlled by STROBE pin. 29 + ON / OFF will be controlled by STROBE pin. 24 30 25 31 Flash Example: 26 - OFF : #echo 0 > sys/class/leds/flash/brightness 27 - 93.75 mA: #echo 1 > sys/class/leds/flash/brightness 28 - ... ..... 29 - 1500 mA: #echo 16 > sys/class/leds/flash/brightness 30 32 31 - TORCH MODE 33 + OFF:: 34 + 35 + #echo 0 > sys/class/leds/flash/brightness 36 + 37 + 93.75 mA:: 38 + 39 + #echo 1 > sys/class/leds/flash/brightness 40 + 41 + ... 42 + 43 + 1500 mA:: 44 + 45 + #echo 16 > sys/class/leds/flash/brightness 46 + 47 + Torch Mode 48 + ^^^^^^^^^^ 49 + 32 50 In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL 33 51 REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the 34 52 hardware TORCH input. 53 + 35 54 LM3556 torch can be controlled through sys/class/leds/torch/brightness file. 36 55 * if TORCH pin is enabled, below example control brightness only, 37 56 and ON / OFF will be controlled by TORCH pin. 38 57 39 58 Torch Example: 40 - OFF : #echo 0 > sys/class/leds/torch/brightness 41 - 46.88 mA: #echo 1 > sys/class/leds/torch/brightness 42 - ... ..... 43 - 375 mA : #echo 8 > sys/class/leds/torch/brightness 44 59 45 - INDICATOR MODE 60 + OFF:: 61 + 62 + #echo 0 > sys/class/leds/torch/brightness 63 + 64 + 46.88 mA:: 65 + 66 + #echo 1 > sys/class/leds/torch/brightness 67 + 68 + ... 69 + 70 + 375 mA:: 71 + 72 + #echo 8 > sys/class/leds/torch/brightness 73 + 74 + Indicator Mode 75 + ^^^^^^^^^^^^^^ 76 + 46 77 Indicator pattern can be set through sys/class/leds/indicator/pattern file, 47 78 and 4 patterns are pre-defined in indicator_pattern array. 79 + 48 80 According to N-lank, Pulse time and N Period values, different pattern wiill 49 81 be generated.If you want new patterns for your own device, change 50 82 indicator_pattern array with your own values and INDIC_PATTERN_SIZE. 83 + 51 84 Please refer datasheet for more detail about N-Blank, Pulse time and N Period. 52 85 53 86 Indicator pattern example: 54 - pattern 0: #echo 0 > sys/class/leds/indicator/pattern 55 - .... 56 - pattern 3: #echo 3 > sys/class/leds/indicator/pattern 87 + 88 + pattern 0:: 89 + 90 + #echo 0 > sys/class/leds/indicator/pattern 91 + 92 + ... 93 + 94 + pattern 3:: 95 + 96 + #echo 3 > sys/class/leds/indicator/pattern 57 97 58 98 Indicator brightness can be controlled through 59 99 sys/class/leds/indicator/brightness file. 60 100 61 101 Example: 62 - OFF : #echo 0 > sys/class/leds/indicator/brightness 63 - 5.86 mA : #echo 1 > sys/class/leds/indicator/brightness 64 - ........ 65 - 46.875mA : #echo 8 > sys/class/leds/indicator/brightness 102 + 103 + OFF:: 104 + 105 + #echo 0 > sys/class/leds/indicator/brightness 106 + 107 + 5.86 mA:: 108 + 109 + #echo 1 > sys/class/leds/indicator/brightness 110 + 111 + ... 112 + 113 + 46.875mA:: 114 + 115 + #echo 8 > sys/class/leds/indicator/brightness 66 116 67 117 Notes 68 118 ----- ··· 120 70 To register the chip at address 0x63 on specific adapter, set the platform data 121 71 according to include/linux/platform_data/leds-lm3556.h, set the i2c board info 122 72 123 - Example: 73 + Example:: 74 + 124 75 static struct i2c_board_info board_i2c_ch4[] __initdata = { 125 76 { 126 77 I2C_BOARD_INFO(LM3556_NAME, 0x63), ··· 131 80 132 81 and register it in the platform init function 133 82 134 - Example: 83 + Example:: 84 + 135 85 board_register_i2c_bus(4, 400, 136 86 board_i2c_ch4, ARRAY_SIZE(board_i2c_ch4));
+16 -7
Documentation/leds/leds-lp3944.txt Documentation/leds/leds-lp3944.rst
··· 1 + ==================== 1 2 Kernel driver lp3944 2 3 ==================== 3 4 4 5 * National Semiconductor LP3944 Fun-light Chip 6 + 5 7 Prefix: 'lp3944' 8 + 6 9 Addresses scanned: None (see the Notes section below) 7 - Datasheet: Publicly available at the National Semiconductor website 8 - http://www.national.com/pf/LP/LP3944.html 10 + 11 + Datasheet: 12 + 13 + Publicly available at the National Semiconductor website 14 + http://www.national.com/pf/LP/LP3944.html 9 15 10 16 Authors: 11 - Antonio Ospite <ospite@studenti.unina.it> 17 + Antonio Ospite <ospite@studenti.unina.it> 12 18 13 19 14 20 Description ··· 25 19 26 20 The DIM modes are used to set _blink_ patterns for leds, the pattern is 27 21 specified supplying two parameters: 28 - - period: from 0s to 1.6s 29 - - duty cycle: percentage of the period the led is on, from 0 to 100 22 + 23 + - period: 24 + from 0s to 1.6s 25 + - duty cycle: 26 + percentage of the period the led is on, from 0 to 100 30 27 31 28 Setting a led in DIM0 or DIM1 mode makes it blink according to the pattern. 32 29 See the datasheet for details. ··· 44 35 registered using the i2c_board_info mechanism. 45 36 46 37 To register the chip at address 0x60 on adapter 0, set the platform data 47 - according to include/linux/leds-lp3944.h, set the i2c board info: 38 + according to include/linux/leds-lp3944.h, set the i2c board info:: 48 39 49 40 static struct i2c_board_info a910_i2c_board_info[] __initdata = { 50 41 { ··· 53 44 }, 54 45 }; 55 46 56 - and register it in the platform init function 47 + and register it in the platform init function:: 57 48 58 49 i2c_register_board_info(0, a910_i2c_board_info, 59 50 ARRAY_SIZE(a910_i2c_board_info));
+115
Documentation/leds/leds-lp5521.rst
··· 1 + ======================== 2 + Kernel driver for lp5521 3 + ======================== 4 + 5 + * National Semiconductor LP5521 led driver chip 6 + * Datasheet: http://www.national.com/pf/LP/LP5521.html 7 + 8 + Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo 9 + 10 + Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com) 11 + 12 + Description 13 + ----------- 14 + 15 + LP5521 can drive up to 3 channels. Leds can be controlled directly via 16 + the led class control interface. Channels have generic names: 17 + lp5521:channelx, where x is 0 .. 2 18 + 19 + All three channels can be also controlled using the engine micro programs. 20 + More details of the instructions can be found from the public data sheet. 21 + 22 + LP5521 has the internal program memory for running various LED patterns. 23 + There are two ways to run LED patterns. 24 + 25 + 1) Legacy interface - enginex_mode and enginex_load 26 + Control interface for the engines: 27 + 28 + x is 1 .. 3 29 + 30 + enginex_mode: 31 + disabled, load, run 32 + enginex_load: 33 + store program (visible only in engine load mode) 34 + 35 + Example (start to blink the channel 2 led):: 36 + 37 + cd /sys/class/leds/lp5521:channel2/device 38 + echo "load" > engine3_mode 39 + echo "037f4d0003ff6000" > engine3_load 40 + echo "run" > engine3_mode 41 + 42 + To stop the engine:: 43 + 44 + echo "disabled" > engine3_mode 45 + 46 + 2) Firmware interface - LP55xx common interface 47 + 48 + For the details, please refer to 'firmware' section in leds-lp55xx.txt 49 + 50 + sysfs contains a selftest entry. 51 + 52 + The test communicates with the chip and checks that 53 + the clock mode is automatically set to the requested one. 54 + 55 + Each channel has its own led current settings. 56 + 57 + - /sys/class/leds/lp5521:channel0/led_current - RW 58 + - /sys/class/leds/lp5521:channel0/max_current - RO 59 + 60 + Format: 10x mA i.e 10 means 1.0 mA 61 + 62 + example platform data:: 63 + 64 + static struct lp55xx_led_config lp5521_led_config[] = { 65 + { 66 + .name = "red", 67 + .chan_nr = 0, 68 + .led_current = 50, 69 + .max_current = 130, 70 + }, { 71 + .name = "green", 72 + .chan_nr = 1, 73 + .led_current = 0, 74 + .max_current = 130, 75 + }, { 76 + .name = "blue", 77 + .chan_nr = 2, 78 + .led_current = 0, 79 + .max_current = 130, 80 + } 81 + }; 82 + 83 + static int lp5521_setup(void) 84 + { 85 + /* setup HW resources */ 86 + } 87 + 88 + static void lp5521_release(void) 89 + { 90 + /* Release HW resources */ 91 + } 92 + 93 + static void lp5521_enable(bool state) 94 + { 95 + /* Control of chip enable signal */ 96 + } 97 + 98 + static struct lp55xx_platform_data lp5521_platform_data = { 99 + .led_config = lp5521_led_config, 100 + .num_channels = ARRAY_SIZE(lp5521_led_config), 101 + .clock_mode = LP55XX_CLOCK_EXT, 102 + .setup_resources = lp5521_setup, 103 + .release_resources = lp5521_release, 104 + .enable = lp5521_enable, 105 + }; 106 + 107 + Note: 108 + chan_nr can have values between 0 and 2. 109 + The name of each channel can be configurable. 110 + If the name field is not defined, the default name will be set to 'xxxx:channelN' 111 + (XXXX : pdata->label or i2c client name, N : channel number) 112 + 113 + 114 + If the current is set to 0 in the platform data, that channel is 115 + disabled and it is not visible in the sysfs.
-101
Documentation/leds/leds-lp5521.txt
··· 1 - Kernel driver for lp5521 2 - ======================== 3 - 4 - * National Semiconductor LP5521 led driver chip 5 - * Datasheet: http://www.national.com/pf/LP/LP5521.html 6 - 7 - Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo 8 - Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com) 9 - 10 - Description 11 - ----------- 12 - 13 - LP5521 can drive up to 3 channels. Leds can be controlled directly via 14 - the led class control interface. Channels have generic names: 15 - lp5521:channelx, where x is 0 .. 2 16 - 17 - All three channels can be also controlled using the engine micro programs. 18 - More details of the instructions can be found from the public data sheet. 19 - 20 - LP5521 has the internal program memory for running various LED patterns. 21 - There are two ways to run LED patterns. 22 - 23 - 1) Legacy interface - enginex_mode and enginex_load 24 - Control interface for the engines: 25 - x is 1 .. 3 26 - enginex_mode : disabled, load, run 27 - enginex_load : store program (visible only in engine load mode) 28 - 29 - Example (start to blink the channel 2 led): 30 - cd /sys/class/leds/lp5521:channel2/device 31 - echo "load" > engine3_mode 32 - echo "037f4d0003ff6000" > engine3_load 33 - echo "run" > engine3_mode 34 - 35 - To stop the engine: 36 - echo "disabled" > engine3_mode 37 - 38 - 2) Firmware interface - LP55xx common interface 39 - For the details, please refer to 'firmware' section in leds-lp55xx.txt 40 - 41 - sysfs contains a selftest entry. 42 - The test communicates with the chip and checks that 43 - the clock mode is automatically set to the requested one. 44 - 45 - Each channel has its own led current settings. 46 - /sys/class/leds/lp5521:channel0/led_current - RW 47 - /sys/class/leds/lp5521:channel0/max_current - RO 48 - Format: 10x mA i.e 10 means 1.0 mA 49 - 50 - example platform data: 51 - 52 - Note: chan_nr can have values between 0 and 2. 53 - The name of each channel can be configurable. 54 - If the name field is not defined, the default name will be set to 'xxxx:channelN' 55 - (XXXX : pdata->label or i2c client name, N : channel number) 56 - 57 - static struct lp55xx_led_config lp5521_led_config[] = { 58 - { 59 - .name = "red", 60 - .chan_nr = 0, 61 - .led_current = 50, 62 - .max_current = 130, 63 - }, { 64 - .name = "green", 65 - .chan_nr = 1, 66 - .led_current = 0, 67 - .max_current = 130, 68 - }, { 69 - .name = "blue", 70 - .chan_nr = 2, 71 - .led_current = 0, 72 - .max_current = 130, 73 - } 74 - }; 75 - 76 - static int lp5521_setup(void) 77 - { 78 - /* setup HW resources */ 79 - } 80 - 81 - static void lp5521_release(void) 82 - { 83 - /* Release HW resources */ 84 - } 85 - 86 - static void lp5521_enable(bool state) 87 - { 88 - /* Control of chip enable signal */ 89 - } 90 - 91 - static struct lp55xx_platform_data lp5521_platform_data = { 92 - .led_config = lp5521_led_config, 93 - .num_channels = ARRAY_SIZE(lp5521_led_config), 94 - .clock_mode = LP55XX_CLOCK_EXT, 95 - .setup_resources = lp5521_setup, 96 - .release_resources = lp5521_release, 97 - .enable = lp5521_enable, 98 - }; 99 - 100 - If the current is set to 0 in the platform data, that channel is 101 - disabled and it is not visible in the sysfs.
+147
Documentation/leds/leds-lp5523.rst
··· 1 + ======================== 2 + Kernel driver for lp5523 3 + ======================== 4 + 5 + * National Semiconductor LP5523 led driver chip 6 + * Datasheet: http://www.national.com/pf/LP/LP5523.html 7 + 8 + Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo 9 + Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com) 10 + 11 + Description 12 + ----------- 13 + LP5523 can drive up to 9 channels. Leds can be controlled directly via 14 + the led class control interface. 15 + The name of each channel is configurable in the platform data - name and label. 16 + There are three options to make the channel name. 17 + 18 + a) Define the 'name' in the platform data 19 + 20 + To make specific channel name, then use 'name' platform data. 21 + 22 + - /sys/class/leds/R1 (name: 'R1') 23 + - /sys/class/leds/B1 (name: 'B1') 24 + 25 + b) Use the 'label' with no 'name' field 26 + 27 + For one device name with channel number, then use 'label'. 28 + - /sys/class/leds/RGB:channelN (label: 'RGB', N: 0 ~ 8) 29 + 30 + c) Default 31 + 32 + If both fields are NULL, 'lp5523' is used by default. 33 + - /sys/class/leds/lp5523:channelN (N: 0 ~ 8) 34 + 35 + LP5523 has the internal program memory for running various LED patterns. 36 + There are two ways to run LED patterns. 37 + 38 + 1) Legacy interface - enginex_mode, enginex_load and enginex_leds 39 + 40 + Control interface for the engines: 41 + 42 + x is 1 .. 3 43 + 44 + enginex_mode: 45 + disabled, load, run 46 + enginex_load: 47 + microcode load 48 + enginex_leds: 49 + led mux control 50 + 51 + :: 52 + 53 + cd /sys/class/leds/lp5523:channel2/device 54 + echo "load" > engine3_mode 55 + echo "9d80400004ff05ff437f0000" > engine3_load 56 + echo "111111111" > engine3_leds 57 + echo "run" > engine3_mode 58 + 59 + To stop the engine:: 60 + 61 + echo "disabled" > engine3_mode 62 + 63 + 2) Firmware interface - LP55xx common interface 64 + 65 + For the details, please refer to 'firmware' section in leds-lp55xx.txt 66 + 67 + LP5523 has three master faders. If a channel is mapped to one of 68 + the master faders, its output is dimmed based on the value of the master 69 + fader. 70 + 71 + For example:: 72 + 73 + echo "123000123" > master_fader_leds 74 + 75 + creates the following channel-fader mappings:: 76 + 77 + channel 0,6 to master_fader1 78 + channel 1,7 to master_fader2 79 + channel 2,8 to master_fader3 80 + 81 + Then, to have 25% of the original output on channel 0,6:: 82 + 83 + echo 64 > master_fader1 84 + 85 + To have 0% of the original output (i.e. no output) channel 1,7:: 86 + 87 + echo 0 > master_fader2 88 + 89 + To have 100% of the original output (i.e. no dimming) on channel 2,8:: 90 + 91 + echo 255 > master_fader3 92 + 93 + To clear all master fader controls:: 94 + 95 + echo "000000000" > master_fader_leds 96 + 97 + Selftest uses always the current from the platform data. 98 + 99 + Each channel contains led current settings. 100 + - /sys/class/leds/lp5523:channel2/led_current - RW 101 + - /sys/class/leds/lp5523:channel2/max_current - RO 102 + 103 + Format: 10x mA i.e 10 means 1.0 mA 104 + 105 + Example platform data:: 106 + 107 + static struct lp55xx_led_config lp5523_led_config[] = { 108 + { 109 + .name = "D1", 110 + .chan_nr = 0, 111 + .led_current = 50, 112 + .max_current = 130, 113 + }, 114 + ... 115 + { 116 + .chan_nr = 8, 117 + .led_current = 50, 118 + .max_current = 130, 119 + } 120 + }; 121 + 122 + static int lp5523_setup(void) 123 + { 124 + /* Setup HW resources */ 125 + } 126 + 127 + static void lp5523_release(void) 128 + { 129 + /* Release HW resources */ 130 + } 131 + 132 + static void lp5523_enable(bool state) 133 + { 134 + /* Control chip enable signal */ 135 + } 136 + 137 + static struct lp55xx_platform_data lp5523_platform_data = { 138 + .led_config = lp5523_led_config, 139 + .num_channels = ARRAY_SIZE(lp5523_led_config), 140 + .clock_mode = LP55XX_CLOCK_EXT, 141 + .setup_resources = lp5523_setup, 142 + .release_resources = lp5523_release, 143 + .enable = lp5523_enable, 144 + }; 145 + 146 + Note 147 + chan_nr can have values between 0 and 8.
-130
Documentation/leds/leds-lp5523.txt
··· 1 - Kernel driver for lp5523 2 - ======================== 3 - 4 - * National Semiconductor LP5523 led driver chip 5 - * Datasheet: http://www.national.com/pf/LP/LP5523.html 6 - 7 - Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo 8 - Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com) 9 - 10 - Description 11 - ----------- 12 - LP5523 can drive up to 9 channels. Leds can be controlled directly via 13 - the led class control interface. 14 - The name of each channel is configurable in the platform data - name and label. 15 - There are three options to make the channel name. 16 - 17 - a) Define the 'name' in the platform data 18 - To make specific channel name, then use 'name' platform data. 19 - /sys/class/leds/R1 (name: 'R1') 20 - /sys/class/leds/B1 (name: 'B1') 21 - 22 - b) Use the 'label' with no 'name' field 23 - For one device name with channel number, then use 'label'. 24 - /sys/class/leds/RGB:channelN (label: 'RGB', N: 0 ~ 8) 25 - 26 - c) Default 27 - If both fields are NULL, 'lp5523' is used by default. 28 - /sys/class/leds/lp5523:channelN (N: 0 ~ 8) 29 - 30 - LP5523 has the internal program memory for running various LED patterns. 31 - There are two ways to run LED patterns. 32 - 33 - 1) Legacy interface - enginex_mode, enginex_load and enginex_leds 34 - Control interface for the engines: 35 - x is 1 .. 3 36 - enginex_mode : disabled, load, run 37 - enginex_load : microcode load 38 - enginex_leds : led mux control 39 - 40 - cd /sys/class/leds/lp5523:channel2/device 41 - echo "load" > engine3_mode 42 - echo "9d80400004ff05ff437f0000" > engine3_load 43 - echo "111111111" > engine3_leds 44 - echo "run" > engine3_mode 45 - 46 - To stop the engine: 47 - echo "disabled" > engine3_mode 48 - 49 - 2) Firmware interface - LP55xx common interface 50 - For the details, please refer to 'firmware' section in leds-lp55xx.txt 51 - 52 - LP5523 has three master faders. If a channel is mapped to one of 53 - the master faders, its output is dimmed based on the value of the master 54 - fader. 55 - 56 - For example, 57 - 58 - echo "123000123" > master_fader_leds 59 - 60 - creates the following channel-fader mappings: 61 - 62 - channel 0,6 to master_fader1 63 - channel 1,7 to master_fader2 64 - channel 2,8 to master_fader3 65 - 66 - Then, to have 25% of the original output on channel 0,6: 67 - 68 - echo 64 > master_fader1 69 - 70 - To have 0% of the original output (i.e. no output) channel 1,7: 71 - 72 - echo 0 > master_fader2 73 - 74 - To have 100% of the original output (i.e. no dimming) on channel 2,8: 75 - 76 - echo 255 > master_fader3 77 - 78 - To clear all master fader controls: 79 - 80 - echo "000000000" > master_fader_leds 81 - 82 - Selftest uses always the current from the platform data. 83 - 84 - Each channel contains led current settings. 85 - /sys/class/leds/lp5523:channel2/led_current - RW 86 - /sys/class/leds/lp5523:channel2/max_current - RO 87 - Format: 10x mA i.e 10 means 1.0 mA 88 - 89 - Example platform data: 90 - 91 - Note - chan_nr can have values between 0 and 8. 92 - 93 - static struct lp55xx_led_config lp5523_led_config[] = { 94 - { 95 - .name = "D1", 96 - .chan_nr = 0, 97 - .led_current = 50, 98 - .max_current = 130, 99 - }, 100 - ... 101 - { 102 - .chan_nr = 8, 103 - .led_current = 50, 104 - .max_current = 130, 105 - } 106 - }; 107 - 108 - static int lp5523_setup(void) 109 - { 110 - /* Setup HW resources */ 111 - } 112 - 113 - static void lp5523_release(void) 114 - { 115 - /* Release HW resources */ 116 - } 117 - 118 - static void lp5523_enable(bool state) 119 - { 120 - /* Control chip enable signal */ 121 - } 122 - 123 - static struct lp55xx_platform_data lp5523_platform_data = { 124 - .led_config = lp5523_led_config, 125 - .num_channels = ARRAY_SIZE(lp5523_led_config), 126 - .clock_mode = LP55XX_CLOCK_EXT, 127 - .setup_resources = lp5523_setup, 128 - .release_resources = lp5523_release, 129 - .enable = lp5523_enable, 130 - };
+137
Documentation/leds/leds-lp5562.rst
··· 1 + ======================== 2 + Kernel driver for lp5562 3 + ======================== 4 + 5 + * TI LP5562 LED Driver 6 + 7 + Author: Milo(Woogyom) Kim <milo.kim@ti.com> 8 + 9 + Description 10 + =========== 11 + 12 + LP5562 can drive up to 4 channels. R/G/B and White. 13 + LEDs can be controlled directly via the led class control interface. 14 + 15 + All four channels can be also controlled using the engine micro programs. 16 + LP5562 has the internal program memory for running various LED patterns. 17 + For the details, please refer to 'firmware' section in leds-lp55xx.txt 18 + 19 + Device attribute 20 + ================ 21 + 22 + engine_mux 23 + 3 Engines are allocated in LP5562, but the number of channel is 4. 24 + Therefore each channel should be mapped to the engine number. 25 + 26 + Value: RGB or W 27 + 28 + This attribute is used for programming LED data with the firmware interface. 29 + Unlike the LP5521/LP5523/55231, LP5562 has unique feature for the engine mux, 30 + so additional sysfs is required 31 + 32 + LED Map 33 + 34 + ===== === =============================== 35 + Red ... Engine 1 (fixed) 36 + Green ... Engine 2 (fixed) 37 + Blue ... Engine 3 (fixed) 38 + White ... Engine 1 or 2 or 3 (selective) 39 + ===== === =============================== 40 + 41 + How to load the program data using engine_mux 42 + ============================================= 43 + 44 + Before loading the LP5562 program data, engine_mux should be written between 45 + the engine selection and loading the firmware. 46 + Engine mux has two different mode, RGB and W. 47 + RGB is used for loading RGB program data, W is used for W program data. 48 + 49 + For example, run blinking green channel pattern:: 50 + 51 + echo 2 > /sys/bus/i2c/devices/xxxx/select_engine # 2 is for green channel 52 + echo "RGB" > /sys/bus/i2c/devices/xxxx/engine_mux # engine mux for RGB 53 + echo 1 > /sys/class/firmware/lp5562/loading 54 + echo "4000600040FF6000" > /sys/class/firmware/lp5562/data 55 + echo 0 > /sys/class/firmware/lp5562/loading 56 + echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 57 + 58 + To run a blinking white pattern:: 59 + 60 + echo 1 or 2 or 3 > /sys/bus/i2c/devices/xxxx/select_engine 61 + echo "W" > /sys/bus/i2c/devices/xxxx/engine_mux 62 + echo 1 > /sys/class/firmware/lp5562/loading 63 + echo "4000600040FF6000" > /sys/class/firmware/lp5562/data 64 + echo 0 > /sys/class/firmware/lp5562/loading 65 + echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 66 + 67 + How to load the predefined patterns 68 + =================================== 69 + 70 + Please refer to 'leds-lp55xx.txt" 71 + 72 + Setting Current of Each Channel 73 + =============================== 74 + 75 + Like LP5521 and LP5523/55231, LP5562 provides LED current settings. 76 + The 'led_current' and 'max_current' are used. 77 + 78 + Example of Platform data 79 + ======================== 80 + 81 + :: 82 + 83 + static struct lp55xx_led_config lp5562_led_config[] = { 84 + { 85 + .name = "R", 86 + .chan_nr = 0, 87 + .led_current = 20, 88 + .max_current = 40, 89 + }, 90 + { 91 + .name = "G", 92 + .chan_nr = 1, 93 + .led_current = 20, 94 + .max_current = 40, 95 + }, 96 + { 97 + .name = "B", 98 + .chan_nr = 2, 99 + .led_current = 20, 100 + .max_current = 40, 101 + }, 102 + { 103 + .name = "W", 104 + .chan_nr = 3, 105 + .led_current = 20, 106 + .max_current = 40, 107 + }, 108 + }; 109 + 110 + static int lp5562_setup(void) 111 + { 112 + /* setup HW resources */ 113 + } 114 + 115 + static void lp5562_release(void) 116 + { 117 + /* Release HW resources */ 118 + } 119 + 120 + static void lp5562_enable(bool state) 121 + { 122 + /* Control of chip enable signal */ 123 + } 124 + 125 + static struct lp55xx_platform_data lp5562_platform_data = { 126 + .led_config = lp5562_led_config, 127 + .num_channels = ARRAY_SIZE(lp5562_led_config), 128 + .setup_resources = lp5562_setup, 129 + .release_resources = lp5562_release, 130 + .enable = lp5562_enable, 131 + }; 132 + 133 + To configure the platform specific data, lp55xx_platform_data structure is used 134 + 135 + 136 + If the current is set to 0 in the platform data, that channel is 137 + disabled and it is not visible in the sysfs.
-120
Documentation/leds/leds-lp5562.txt
··· 1 - Kernel driver for LP5562 2 - ======================== 3 - 4 - * TI LP5562 LED Driver 5 - 6 - Author: Milo(Woogyom) Kim <milo.kim@ti.com> 7 - 8 - Description 9 - 10 - LP5562 can drive up to 4 channels. R/G/B and White. 11 - LEDs can be controlled directly via the led class control interface. 12 - 13 - All four channels can be also controlled using the engine micro programs. 14 - LP5562 has the internal program memory for running various LED patterns. 15 - For the details, please refer to 'firmware' section in leds-lp55xx.txt 16 - 17 - Device attribute: engine_mux 18 - 19 - 3 Engines are allocated in LP5562, but the number of channel is 4. 20 - Therefore each channel should be mapped to the engine number. 21 - Value : RGB or W 22 - 23 - This attribute is used for programming LED data with the firmware interface. 24 - Unlike the LP5521/LP5523/55231, LP5562 has unique feature for the engine mux, 25 - so additional sysfs is required. 26 - 27 - LED Map 28 - Red ... Engine 1 (fixed) 29 - Green ... Engine 2 (fixed) 30 - Blue ... Engine 3 (fixed) 31 - White ... Engine 1 or 2 or 3 (selective) 32 - 33 - How to load the program data using engine_mux 34 - 35 - Before loading the LP5562 program data, engine_mux should be written between 36 - the engine selection and loading the firmware. 37 - Engine mux has two different mode, RGB and W. 38 - RGB is used for loading RGB program data, W is used for W program data. 39 - 40 - For example, run blinking green channel pattern, 41 - echo 2 > /sys/bus/i2c/devices/xxxx/select_engine # 2 is for green channel 42 - echo "RGB" > /sys/bus/i2c/devices/xxxx/engine_mux # engine mux for RGB 43 - echo 1 > /sys/class/firmware/lp5562/loading 44 - echo "4000600040FF6000" > /sys/class/firmware/lp5562/data 45 - echo 0 > /sys/class/firmware/lp5562/loading 46 - echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 47 - 48 - To run a blinking white pattern, 49 - echo 1 or 2 or 3 > /sys/bus/i2c/devices/xxxx/select_engine 50 - echo "W" > /sys/bus/i2c/devices/xxxx/engine_mux 51 - echo 1 > /sys/class/firmware/lp5562/loading 52 - echo "4000600040FF6000" > /sys/class/firmware/lp5562/data 53 - echo 0 > /sys/class/firmware/lp5562/loading 54 - echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 55 - 56 - How to load the predefined patterns 57 - 58 - Please refer to 'leds-lp55xx.txt" 59 - 60 - Setting Current of Each Channel 61 - 62 - Like LP5521 and LP5523/55231, LP5562 provides LED current settings. 63 - The 'led_current' and 'max_current' are used. 64 - 65 - (Example of Platform data) 66 - 67 - To configure the platform specific data, lp55xx_platform_data structure is used. 68 - 69 - static struct lp55xx_led_config lp5562_led_config[] = { 70 - { 71 - .name = "R", 72 - .chan_nr = 0, 73 - .led_current = 20, 74 - .max_current = 40, 75 - }, 76 - { 77 - .name = "G", 78 - .chan_nr = 1, 79 - .led_current = 20, 80 - .max_current = 40, 81 - }, 82 - { 83 - .name = "B", 84 - .chan_nr = 2, 85 - .led_current = 20, 86 - .max_current = 40, 87 - }, 88 - { 89 - .name = "W", 90 - .chan_nr = 3, 91 - .led_current = 20, 92 - .max_current = 40, 93 - }, 94 - }; 95 - 96 - static int lp5562_setup(void) 97 - { 98 - /* setup HW resources */ 99 - } 100 - 101 - static void lp5562_release(void) 102 - { 103 - /* Release HW resources */ 104 - } 105 - 106 - static void lp5562_enable(bool state) 107 - { 108 - /* Control of chip enable signal */ 109 - } 110 - 111 - static struct lp55xx_platform_data lp5562_platform_data = { 112 - .led_config = lp5562_led_config, 113 - .num_channels = ARRAY_SIZE(lp5562_led_config), 114 - .setup_resources = lp5562_setup, 115 - .release_resources = lp5562_release, 116 - .enable = lp5562_enable, 117 - }; 118 - 119 - If the current is set to 0 in the platform data, that channel is 120 - disabled and it is not visible in the sysfs.
+224
Documentation/leds/leds-lp55xx.rst
··· 1 + ================================================= 2 + LP5521/LP5523/LP55231/LP5562/LP8501 Common Driver 3 + ================================================= 4 + 5 + Authors: Milo(Woogyom) Kim <milo.kim@ti.com> 6 + 7 + Description 8 + ----------- 9 + LP5521, LP5523/55231, LP5562 and LP8501 have common features as below. 10 + 11 + Register access via the I2C 12 + Device initialization/deinitialization 13 + Create LED class devices for multiple output channels 14 + Device attributes for user-space interface 15 + Program memory for running LED patterns 16 + 17 + The LP55xx common driver provides these features using exported functions. 18 + 19 + lp55xx_init_device() / lp55xx_deinit_device() 20 + lp55xx_register_leds() / lp55xx_unregister_leds() 21 + lp55xx_regsister_sysfs() / lp55xx_unregister_sysfs() 22 + 23 + ( Driver Structure Data ) 24 + 25 + In lp55xx common driver, two different data structure is used. 26 + 27 + * lp55xx_led 28 + control multi output LED channels such as led current, channel index. 29 + * lp55xx_chip 30 + general chip control such like the I2C and platform data. 31 + 32 + For example, LP5521 has maximum 3 LED channels. 33 + LP5523/55231 has 9 output channels:: 34 + 35 + lp55xx_chip for LP5521 ... lp55xx_led #1 36 + lp55xx_led #2 37 + lp55xx_led #3 38 + 39 + lp55xx_chip for LP5523 ... lp55xx_led #1 40 + lp55xx_led #2 41 + . 42 + . 43 + lp55xx_led #9 44 + 45 + ( Chip Dependent Code ) 46 + 47 + To support device specific configurations, special structure 48 + 'lpxx_device_config' is used. 49 + 50 + - Maximum number of channels 51 + - Reset command, chip enable command 52 + - Chip specific initialization 53 + - Brightness control register access 54 + - Setting LED output current 55 + - Program memory address access for running patterns 56 + - Additional device specific attributes 57 + 58 + ( Firmware Interface ) 59 + 60 + LP55xx family devices have the internal program memory for running 61 + various LED patterns. 62 + 63 + This pattern data is saved as a file in the user-land or 64 + hex byte string is written into the memory through the I2C. 65 + 66 + LP55xx common driver supports the firmware interface. 67 + 68 + LP55xx chips have three program engines. 69 + 70 + To load and run the pattern, the programming sequence is following. 71 + 72 + (1) Select an engine number (1/2/3) 73 + (2) Mode change to load 74 + (3) Write pattern data into selected area 75 + (4) Mode change to run 76 + 77 + The LP55xx common driver provides simple interfaces as below. 78 + 79 + select_engine: 80 + Select which engine is used for running program 81 + run_engine: 82 + Start program which is loaded via the firmware interface 83 + firmware: 84 + Load program data 85 + 86 + In case of LP5523, one more command is required, 'enginex_leds'. 87 + It is used for selecting LED output(s) at each engine number. 88 + In more details, please refer to 'leds-lp5523.txt'. 89 + 90 + For example, run blinking pattern in engine #1 of LP5521:: 91 + 92 + echo 1 > /sys/bus/i2c/devices/xxxx/select_engine 93 + echo 1 > /sys/class/firmware/lp5521/loading 94 + echo "4000600040FF6000" > /sys/class/firmware/lp5521/data 95 + echo 0 > /sys/class/firmware/lp5521/loading 96 + echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 97 + 98 + For example, run blinking pattern in engine #3 of LP55231 99 + 100 + Two LEDs are configured as pattern output channels:: 101 + 102 + echo 3 > /sys/bus/i2c/devices/xxxx/select_engine 103 + echo 1 > /sys/class/firmware/lp55231/loading 104 + echo "9d0740ff7e0040007e00a0010000" > /sys/class/firmware/lp55231/data 105 + echo 0 > /sys/class/firmware/lp55231/loading 106 + echo "000001100" > /sys/bus/i2c/devices/xxxx/engine3_leds 107 + echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 108 + 109 + To start blinking patterns in engine #2 and #3 simultaneously:: 110 + 111 + for idx in 2 3 112 + do 113 + echo $idx > /sys/class/leds/red/device/select_engine 114 + sleep 0.1 115 + echo 1 > /sys/class/firmware/lp5521/loading 116 + echo "4000600040FF6000" > /sys/class/firmware/lp5521/data 117 + echo 0 > /sys/class/firmware/lp5521/loading 118 + done 119 + echo 1 > /sys/class/leds/red/device/run_engine 120 + 121 + Here is another example for LP5523. 122 + 123 + Full LED strings are selected by 'engine2_leds':: 124 + 125 + echo 2 > /sys/bus/i2c/devices/xxxx/select_engine 126 + echo 1 > /sys/class/firmware/lp5523/loading 127 + echo "9d80400004ff05ff437f0000" > /sys/class/firmware/lp5523/data 128 + echo 0 > /sys/class/firmware/lp5523/loading 129 + echo "111111111" > /sys/bus/i2c/devices/xxxx/engine2_leds 130 + echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 131 + 132 + As soon as 'loading' is set to 0, registered callback is called. 133 + Inside the callback, the selected engine is loaded and memory is updated. 134 + To run programmed pattern, 'run_engine' attribute should be enabled. 135 + 136 + The pattern sequence of LP8501 is similar to LP5523. 137 + 138 + However pattern data is specific. 139 + 140 + Ex 1) Engine 1 is used:: 141 + 142 + echo 1 > /sys/bus/i2c/devices/xxxx/select_engine 143 + echo 1 > /sys/class/firmware/lp8501/loading 144 + echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data 145 + echo 0 > /sys/class/firmware/lp8501/loading 146 + echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 147 + 148 + Ex 2) Engine 2 and 3 are used at the same time:: 149 + 150 + echo 2 > /sys/bus/i2c/devices/xxxx/select_engine 151 + sleep 1 152 + echo 1 > /sys/class/firmware/lp8501/loading 153 + echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data 154 + echo 0 > /sys/class/firmware/lp8501/loading 155 + sleep 1 156 + echo 3 > /sys/bus/i2c/devices/xxxx/select_engine 157 + sleep 1 158 + echo 1 > /sys/class/firmware/lp8501/loading 159 + echo "9d0340ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data 160 + echo 0 > /sys/class/firmware/lp8501/loading 161 + sleep 1 162 + echo 1 > /sys/class/leds/d1/device/run_engine 163 + 164 + ( 'run_engine' and 'firmware_cb' ) 165 + 166 + The sequence of running the program data is common. 167 + 168 + But each device has own specific register addresses for commands. 169 + 170 + To support this, 'run_engine' and 'firmware_cb' are configurable in each driver. 171 + 172 + run_engine: 173 + Control the selected engine 174 + firmware_cb: 175 + The callback function after loading the firmware is done. 176 + 177 + Chip specific commands for loading and updating program memory. 178 + 179 + ( Predefined pattern data ) 180 + 181 + Without the firmware interface, LP55xx driver provides another method for 182 + loading a LED pattern. That is 'predefined' pattern. 183 + 184 + A predefined pattern is defined in the platform data and load it(or them) 185 + via the sysfs if needed. 186 + 187 + To use the predefined pattern concept, 'patterns' and 'num_patterns' should be 188 + configured. 189 + 190 + Example of predefined pattern data:: 191 + 192 + /* mode_1: blinking data */ 193 + static const u8 mode_1[] = { 194 + 0x40, 0x00, 0x60, 0x00, 0x40, 0xFF, 0x60, 0x00, 195 + }; 196 + 197 + /* mode_2: always on */ 198 + static const u8 mode_2[] = { 0x40, 0xFF, }; 199 + 200 + struct lp55xx_predef_pattern board_led_patterns[] = { 201 + { 202 + .r = mode_1, 203 + .size_r = ARRAY_SIZE(mode_1), 204 + }, 205 + { 206 + .b = mode_2, 207 + .size_b = ARRAY_SIZE(mode_2), 208 + }, 209 + } 210 + 211 + struct lp55xx_platform_data lp5562_pdata = { 212 + ... 213 + .patterns = board_led_patterns, 214 + .num_patterns = ARRAY_SIZE(board_led_patterns), 215 + }; 216 + 217 + Then, mode_1 and mode_2 can be run via through the sysfs:: 218 + 219 + echo 1 > /sys/bus/i2c/devices/xxxx/led_pattern # red blinking LED pattern 220 + echo 2 > /sys/bus/i2c/devices/xxxx/led_pattern # blue LED always on 221 + 222 + To stop running pattern:: 223 + 224 + echo 0 > /sys/bus/i2c/devices/xxxx/led_pattern
-194
Documentation/leds/leds-lp55xx.txt
··· 1 - LP5521/LP5523/LP55231/LP5562/LP8501 Common Driver 2 - ================================================= 3 - 4 - Authors: Milo(Woogyom) Kim <milo.kim@ti.com> 5 - 6 - Description 7 - ----------- 8 - LP5521, LP5523/55231, LP5562 and LP8501 have common features as below. 9 - 10 - Register access via the I2C 11 - Device initialization/deinitialization 12 - Create LED class devices for multiple output channels 13 - Device attributes for user-space interface 14 - Program memory for running LED patterns 15 - 16 - The LP55xx common driver provides these features using exported functions. 17 - lp55xx_init_device() / lp55xx_deinit_device() 18 - lp55xx_register_leds() / lp55xx_unregister_leds() 19 - lp55xx_regsister_sysfs() / lp55xx_unregister_sysfs() 20 - 21 - ( Driver Structure Data ) 22 - 23 - In lp55xx common driver, two different data structure is used. 24 - 25 - o lp55xx_led 26 - control multi output LED channels such as led current, channel index. 27 - o lp55xx_chip 28 - general chip control such like the I2C and platform data. 29 - 30 - For example, LP5521 has maximum 3 LED channels. 31 - LP5523/55231 has 9 output channels. 32 - 33 - lp55xx_chip for LP5521 ... lp55xx_led #1 34 - lp55xx_led #2 35 - lp55xx_led #3 36 - 37 - lp55xx_chip for LP5523 ... lp55xx_led #1 38 - lp55xx_led #2 39 - . 40 - . 41 - lp55xx_led #9 42 - 43 - ( Chip Dependent Code ) 44 - 45 - To support device specific configurations, special structure 46 - 'lpxx_device_config' is used. 47 - 48 - Maximum number of channels 49 - Reset command, chip enable command 50 - Chip specific initialization 51 - Brightness control register access 52 - Setting LED output current 53 - Program memory address access for running patterns 54 - Additional device specific attributes 55 - 56 - ( Firmware Interface ) 57 - 58 - LP55xx family devices have the internal program memory for running 59 - various LED patterns. 60 - This pattern data is saved as a file in the user-land or 61 - hex byte string is written into the memory through the I2C. 62 - LP55xx common driver supports the firmware interface. 63 - 64 - LP55xx chips have three program engines. 65 - To load and run the pattern, the programming sequence is following. 66 - (1) Select an engine number (1/2/3) 67 - (2) Mode change to load 68 - (3) Write pattern data into selected area 69 - (4) Mode change to run 70 - 71 - The LP55xx common driver provides simple interfaces as below. 72 - select_engine : Select which engine is used for running program 73 - run_engine : Start program which is loaded via the firmware interface 74 - firmware : Load program data 75 - 76 - In case of LP5523, one more command is required, 'enginex_leds'. 77 - It is used for selecting LED output(s) at each engine number. 78 - In more details, please refer to 'leds-lp5523.txt'. 79 - 80 - For example, run blinking pattern in engine #1 of LP5521 81 - echo 1 > /sys/bus/i2c/devices/xxxx/select_engine 82 - echo 1 > /sys/class/firmware/lp5521/loading 83 - echo "4000600040FF6000" > /sys/class/firmware/lp5521/data 84 - echo 0 > /sys/class/firmware/lp5521/loading 85 - echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 86 - 87 - For example, run blinking pattern in engine #3 of LP55231 88 - Two LEDs are configured as pattern output channels. 89 - echo 3 > /sys/bus/i2c/devices/xxxx/select_engine 90 - echo 1 > /sys/class/firmware/lp55231/loading 91 - echo "9d0740ff7e0040007e00a0010000" > /sys/class/firmware/lp55231/data 92 - echo 0 > /sys/class/firmware/lp55231/loading 93 - echo "000001100" > /sys/bus/i2c/devices/xxxx/engine3_leds 94 - echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 95 - 96 - To start blinking patterns in engine #2 and #3 simultaneously, 97 - for idx in 2 3 98 - do 99 - echo $idx > /sys/class/leds/red/device/select_engine 100 - sleep 0.1 101 - echo 1 > /sys/class/firmware/lp5521/loading 102 - echo "4000600040FF6000" > /sys/class/firmware/lp5521/data 103 - echo 0 > /sys/class/firmware/lp5521/loading 104 - done 105 - echo 1 > /sys/class/leds/red/device/run_engine 106 - 107 - Here is another example for LP5523. 108 - Full LED strings are selected by 'engine2_leds'. 109 - echo 2 > /sys/bus/i2c/devices/xxxx/select_engine 110 - echo 1 > /sys/class/firmware/lp5523/loading 111 - echo "9d80400004ff05ff437f0000" > /sys/class/firmware/lp5523/data 112 - echo 0 > /sys/class/firmware/lp5523/loading 113 - echo "111111111" > /sys/bus/i2c/devices/xxxx/engine2_leds 114 - echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 115 - 116 - As soon as 'loading' is set to 0, registered callback is called. 117 - Inside the callback, the selected engine is loaded and memory is updated. 118 - To run programmed pattern, 'run_engine' attribute should be enabled. 119 - 120 - The pattern sequence of LP8501 is similar to LP5523. 121 - However pattern data is specific. 122 - Ex 1) Engine 1 is used 123 - echo 1 > /sys/bus/i2c/devices/xxxx/select_engine 124 - echo 1 > /sys/class/firmware/lp8501/loading 125 - echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data 126 - echo 0 > /sys/class/firmware/lp8501/loading 127 - echo 1 > /sys/bus/i2c/devices/xxxx/run_engine 128 - 129 - Ex 2) Engine 2 and 3 are used at the same time 130 - echo 2 > /sys/bus/i2c/devices/xxxx/select_engine 131 - sleep 1 132 - echo 1 > /sys/class/firmware/lp8501/loading 133 - echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data 134 - echo 0 > /sys/class/firmware/lp8501/loading 135 - sleep 1 136 - echo 3 > /sys/bus/i2c/devices/xxxx/select_engine 137 - sleep 1 138 - echo 1 > /sys/class/firmware/lp8501/loading 139 - echo "9d0340ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data 140 - echo 0 > /sys/class/firmware/lp8501/loading 141 - sleep 1 142 - echo 1 > /sys/class/leds/d1/device/run_engine 143 - 144 - ( 'run_engine' and 'firmware_cb' ) 145 - The sequence of running the program data is common. 146 - But each device has own specific register addresses for commands. 147 - To support this, 'run_engine' and 'firmware_cb' are configurable in each driver. 148 - run_engine : Control the selected engine 149 - firmware_cb : The callback function after loading the firmware is done. 150 - Chip specific commands for loading and updating program memory. 151 - 152 - ( Predefined pattern data ) 153 - 154 - Without the firmware interface, LP55xx driver provides another method for 155 - loading a LED pattern. That is 'predefined' pattern. 156 - A predefined pattern is defined in the platform data and load it(or them) 157 - via the sysfs if needed. 158 - To use the predefined pattern concept, 'patterns' and 'num_patterns' should be 159 - configured. 160 - 161 - Example of predefined pattern data: 162 - 163 - /* mode_1: blinking data */ 164 - static const u8 mode_1[] = { 165 - 0x40, 0x00, 0x60, 0x00, 0x40, 0xFF, 0x60, 0x00, 166 - }; 167 - 168 - /* mode_2: always on */ 169 - static const u8 mode_2[] = { 0x40, 0xFF, }; 170 - 171 - struct lp55xx_predef_pattern board_led_patterns[] = { 172 - { 173 - .r = mode_1, 174 - .size_r = ARRAY_SIZE(mode_1), 175 - }, 176 - { 177 - .b = mode_2, 178 - .size_b = ARRAY_SIZE(mode_2), 179 - }, 180 - } 181 - 182 - struct lp55xx_platform_data lp5562_pdata = { 183 - ... 184 - .patterns = board_led_patterns, 185 - .num_patterns = ARRAY_SIZE(board_led_patterns), 186 - }; 187 - 188 - Then, mode_1 and mode_2 can be run via through the sysfs. 189 - 190 - echo 1 > /sys/bus/i2c/devices/xxxx/led_pattern # red blinking LED pattern 191 - echo 2 > /sys/bus/i2c/devices/xxxx/led_pattern # blue LED always on 192 - 193 - To stop running pattern, 194 - echo 0 > /sys/bus/i2c/devices/xxxx/led_pattern
+118
Documentation/leds/leds-mlxcpld.rst
··· 1 + ======================================= 2 + Kernel driver for Mellanox systems LEDs 3 + ======================================= 4 + 5 + Provide system LED support for the nex Mellanox systems: 6 + "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", 7 + "msn2410", "msb7800", "msn2740", "msn2100". 8 + 9 + Description 10 + ----------- 11 + Driver provides the following LEDs for the systems "msx6710", "msx6720", 12 + "msb7700", "msn2700", "msx1410", "msn2410", "msb7800", "msn2740": 13 + 14 + - mlxcpld:fan1:green 15 + - mlxcpld:fan1:red 16 + - mlxcpld:fan2:green 17 + - mlxcpld:fan2:red 18 + - mlxcpld:fan3:green 19 + - mlxcpld:fan3:red 20 + - mlxcpld:fan4:green 21 + - mlxcpld:fan4:red 22 + - mlxcpld:psu:green 23 + - mlxcpld:psu:red 24 + - mlxcpld:status:green 25 + - mlxcpld:status:red 26 + 27 + "status" 28 + - CPLD reg offset: 0x20 29 + - Bits [3:0] 30 + 31 + "psu" 32 + - CPLD reg offset: 0x20 33 + - Bits [7:4] 34 + 35 + "fan1" 36 + - CPLD reg offset: 0x21 37 + - Bits [3:0] 38 + 39 + "fan2" 40 + - CPLD reg offset: 0x21 41 + - Bits [7:4] 42 + 43 + "fan3" 44 + - CPLD reg offset: 0x22 45 + - Bits [3:0] 46 + 47 + "fan4" 48 + - CPLD reg offset: 0x22 49 + - Bits [7:4] 50 + 51 + Color mask for all the above LEDs: 52 + 53 + [bit3,bit2,bit1,bit0] or 54 + [bit7,bit6,bit5,bit4]: 55 + 56 + - [0,0,0,0] = LED OFF 57 + - [0,1,0,1] = Red static ON 58 + - [1,1,0,1] = Green static ON 59 + - [0,1,1,0] = Red blink 3Hz 60 + - [1,1,1,0] = Green blink 3Hz 61 + - [0,1,1,1] = Red blink 6Hz 62 + - [1,1,1,1] = Green blink 6Hz 63 + 64 + Driver provides the following LEDs for the system "msn2100": 65 + 66 + - mlxcpld:fan:green 67 + - mlxcpld:fan:red 68 + - mlxcpld:psu1:green 69 + - mlxcpld:psu1:red 70 + - mlxcpld:psu2:green 71 + - mlxcpld:psu2:red 72 + - mlxcpld:status:green 73 + - mlxcpld:status:red 74 + - mlxcpld:uid:blue 75 + 76 + "status" 77 + - CPLD reg offset: 0x20 78 + - Bits [3:0] 79 + 80 + "fan" 81 + - CPLD reg offset: 0x21 82 + - Bits [3:0] 83 + 84 + "psu1" 85 + - CPLD reg offset: 0x23 86 + - Bits [3:0] 87 + 88 + "psu2" 89 + - CPLD reg offset: 0x23 90 + - Bits [7:4] 91 + 92 + "uid" 93 + - CPLD reg offset: 0x24 94 + - Bits [3:0] 95 + 96 + Color mask for all the above LEDs, excepted uid: 97 + 98 + [bit3,bit2,bit1,bit0] or 99 + [bit7,bit6,bit5,bit4]: 100 + 101 + - [0,0,0,0] = LED OFF 102 + - [0,1,0,1] = Red static ON 103 + - [1,1,0,1] = Green static ON 104 + - [0,1,1,0] = Red blink 3Hz 105 + - [1,1,1,0] = Green blink 3Hz 106 + - [0,1,1,1] = Red blink 6Hz 107 + - [1,1,1,1] = Green blink 6Hz 108 + 109 + Color mask for uid LED: 110 + [bit3,bit2,bit1,bit0]: 111 + 112 + - [0,0,0,0] = LED OFF 113 + - [1,1,0,1] = Blue static ON 114 + - [1,1,1,0] = Blue blink 3Hz 115 + - [1,1,1,1] = Blue blink 6Hz 116 + 117 + Driver supports HW blinking at 3Hz and 6Hz frequency (50% duty cycle). 118 + For 3Hz duty cylce is about 167 msec, for 6Hz is about 83 msec.
-110
Documentation/leds/leds-mlxcpld.txt
··· 1 - Kernel driver for Mellanox systems LEDs 2 - ======================================= 3 - 4 - Provide system LED support for the nex Mellanox systems: 5 - "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", 6 - "msn2410", "msb7800", "msn2740", "msn2100". 7 - 8 - Description 9 - ----------- 10 - Driver provides the following LEDs for the systems "msx6710", "msx6720", 11 - "msb7700", "msn2700", "msx1410", "msn2410", "msb7800", "msn2740": 12 - mlxcpld:fan1:green 13 - mlxcpld:fan1:red 14 - mlxcpld:fan2:green 15 - mlxcpld:fan2:red 16 - mlxcpld:fan3:green 17 - mlxcpld:fan3:red 18 - mlxcpld:fan4:green 19 - mlxcpld:fan4:red 20 - mlxcpld:psu:green 21 - mlxcpld:psu:red 22 - mlxcpld:status:green 23 - mlxcpld:status:red 24 - 25 - "status" 26 - CPLD reg offset: 0x20 27 - Bits [3:0] 28 - 29 - "psu" 30 - CPLD reg offset: 0x20 31 - Bits [7:4] 32 - 33 - "fan1" 34 - CPLD reg offset: 0x21 35 - Bits [3:0] 36 - 37 - "fan2" 38 - CPLD reg offset: 0x21 39 - Bits [7:4] 40 - 41 - "fan3" 42 - CPLD reg offset: 0x22 43 - Bits [3:0] 44 - 45 - "fan4" 46 - CPLD reg offset: 0x22 47 - Bits [7:4] 48 - 49 - Color mask for all the above LEDs: 50 - [bit3,bit2,bit1,bit0] or 51 - [bit7,bit6,bit5,bit4]: 52 - [0,0,0,0] = LED OFF 53 - [0,1,0,1] = Red static ON 54 - [1,1,0,1] = Green static ON 55 - [0,1,1,0] = Red blink 3Hz 56 - [1,1,1,0] = Green blink 3Hz 57 - [0,1,1,1] = Red blink 6Hz 58 - [1,1,1,1] = Green blink 6Hz 59 - 60 - Driver provides the following LEDs for the system "msn2100": 61 - mlxcpld:fan:green 62 - mlxcpld:fan:red 63 - mlxcpld:psu1:green 64 - mlxcpld:psu1:red 65 - mlxcpld:psu2:green 66 - mlxcpld:psu2:red 67 - mlxcpld:status:green 68 - mlxcpld:status:red 69 - mlxcpld:uid:blue 70 - 71 - "status" 72 - CPLD reg offset: 0x20 73 - Bits [3:0] 74 - 75 - "fan" 76 - CPLD reg offset: 0x21 77 - Bits [3:0] 78 - 79 - "psu1" 80 - CPLD reg offset: 0x23 81 - Bits [3:0] 82 - 83 - "psu2" 84 - CPLD reg offset: 0x23 85 - Bits [7:4] 86 - 87 - "uid" 88 - CPLD reg offset: 0x24 89 - Bits [3:0] 90 - 91 - Color mask for all the above LEDs, excepted uid: 92 - [bit3,bit2,bit1,bit0] or 93 - [bit7,bit6,bit5,bit4]: 94 - [0,0,0,0] = LED OFF 95 - [0,1,0,1] = Red static ON 96 - [1,1,0,1] = Green static ON 97 - [0,1,1,0] = Red blink 3Hz 98 - [1,1,1,0] = Green blink 3Hz 99 - [0,1,1,1] = Red blink 6Hz 100 - [1,1,1,1] = Green blink 6Hz 101 - 102 - Color mask for uid LED: 103 - [bit3,bit2,bit1,bit0]: 104 - [0,0,0,0] = LED OFF 105 - [1,1,0,1] = Blue static ON 106 - [1,1,1,0] = Blue blink 3Hz 107 - [1,1,1,1] = Blue blink 6Hz 108 - 109 - Driver supports HW blinking at 3Hz and 6Hz frequency (50% duty cycle). 110 - For 3Hz duty cylce is about 167 msec, for 6Hz is about 83 msec.
+6 -5
Documentation/leds/ledtrig-oneshot.txt Documentation/leds/ledtrig-oneshot.rst
··· 1 + ==================== 1 2 One-shot LED Trigger 2 3 ==================== 3 4 ··· 18 17 on (inverted) when not rearmed. 19 18 20 19 The trigger can be activated from user space on led class devices as shown 21 - below: 20 + below:: 22 21 23 22 echo oneshot > trigger 24 23 25 24 This adds sysfs attributes to the LED that are documented in: 26 25 Documentation/ABI/testing/sysfs-class-led-trigger-oneshot 27 26 28 - Example use-case: network devices, initialization: 27 + Example use-case: network devices, initialization:: 29 28 30 29 echo oneshot > trigger # set trigger for this led 31 30 echo 33 > delay_on # blink at 1 / (33 + 33) Hz on continuous traffic 32 31 echo 33 > delay_off 33 32 34 - interface goes up: 33 + interface goes up:: 35 34 36 35 echo 1 > invert # set led as normally-on, turn the led on 37 36 38 - packet received/transmitted: 37 + packet received/transmitted:: 39 38 40 39 echo 1 > shot # led starts blinking, ignored if already blinking 41 40 42 - interface goes down 41 + interface goes down:: 43 42 44 43 echo 0 > invert # set led as normally-off, turn the led off
+39 -24
Documentation/leds/ledtrig-transient.txt Documentation/leds/ledtrig-transient.rst
··· 1 + ===================== 1 2 LED Transient Trigger 2 3 ===================== 3 4 ··· 63 62 state, the LED state changes to LED_OFF. 64 63 65 64 Transient trigger can be enabled and disabled from user space on led class 66 - devices, that support this trigger as shown below: 65 + devices, that support this trigger as shown below:: 67 66 68 - echo transient > trigger 69 - echo none > trigger 67 + echo transient > trigger 68 + echo none > trigger 70 69 71 - NOTE: Add a new property trigger state to control the state. 70 + NOTE: 71 + Add a new property trigger state to control the state. 72 72 73 73 This trigger exports three properties, activate, state, and duration. When 74 74 transient trigger is activated these properties are set to default values. ··· 81 79 - state allows user to specify a transient state to be held for the specified 82 80 duration. 83 81 84 - activate - one shot timer activate mechanism. 82 + activate 83 + - one shot timer activate mechanism. 85 84 1 when activated, 0 when deactivated. 86 85 default value is zero when transient trigger is enabled, 87 86 to allow duration to be set. ··· 92 89 deactivated state indicates that there is no active timer 93 90 running. 94 91 95 - duration - one shot timer value. When activate is set, duration value 92 + duration 93 + - one shot timer value. When activate is set, duration value 96 94 is used to start a timer that runs once. This value doesn't 97 95 get changed by the trigger unless user does a set via 98 96 echo new_value > duration 99 97 100 - state - transient state to be held. It has two values 0 or 1. 0 maps 98 + state 99 + - transient state to be held. It has two values 0 or 1. 0 maps 101 100 to LED_OFF and 1 maps to LED_FULL. The specified state is 102 101 held for the duration of the one shot timer and then the 103 102 state gets changed to the non-transient state which is the ··· 119 114 at the set value to be used when activate is set at a future time. This will 120 115 allow user app to set the time once and activate it to run it once for the 121 116 specified value as needed. When timer expires, state is restored to the 122 - non-transient state which is the inverse of the transient state. 117 + non-transient state which is the inverse of the transient state: 123 118 124 - echo 1 > activate - starts timer = duration when duration is not 0. 125 - echo 0 > activate - cancels currently running timer. 126 - echo n > duration - stores timer value to be used upon next 127 - activate. Currently active timer if 128 - any, continues to run for the specified time. 129 - echo 0 > duration - stores timer value to be used upon next 130 - activate. Currently active timer if any, 131 - continues to run for the specified time. 132 - echo 1 > state - stores desired transient state LED_FULL to be 119 + ================= =============================================== 120 + echo 1 > activate starts timer = duration when duration is not 0. 121 + echo 0 > activate cancels currently running timer. 122 + echo n > duration stores timer value to be used upon next 123 + activate. Currently active timer if 124 + any, continues to run for the specified time. 125 + echo 0 > duration stores timer value to be used upon next 126 + activate. Currently active timer if any, 127 + continues to run for the specified time. 128 + echo 1 > state stores desired transient state LED_FULL to be 133 129 held for the specified duration. 134 - echo 0 > state - stores desired transient state LED_OFF to be 130 + echo 0 > state stores desired transient state LED_OFF to be 135 131 held for the specified duration. 132 + ================= =============================================== 136 133 137 - What is not supported: 138 - ====================== 134 + What is not supported 135 + ===================== 136 + 139 137 - Timer activation is one shot and extending and/or shortening the timer 140 138 is not supported. 141 139 142 - Example use-case 1: 140 + Examples 141 + ======== 142 + 143 + use-case 1:: 144 + 143 145 echo transient > trigger 144 146 echo n > duration 145 147 echo 1 > state 146 - repeat the following step as needed: 148 + 149 + repeat the following step as needed:: 150 + 147 151 echo 1 > activate - start timer = duration to run once 148 152 echo 1 > activate - start timer = duration to run once 149 153 echo none > trigger 150 154 151 155 This trigger is intended to be used for for the following example use cases: 156 + 152 157 - Control of vibrate (phones, tablets etc.) hardware by user space app. 153 158 - Use of LED by user space app as activity indicator. 154 159 - Use of LED by user space app as a kind of watchdog indicator -- as 155 - long as the app is alive, it can keep the LED illuminated, if it dies 156 - the LED will be extinguished automatically. 160 + long as the app is alive, it can keep the LED illuminated, if it dies 161 + the LED will be extinguished automatically. 157 162 - Use by any user space app that needs a transient GPIO output.
+8 -3
Documentation/leds/ledtrig-usbport.txt Documentation/leds/ledtrig-usbport.rst
··· 1 + ==================== 1 2 USB port LED trigger 2 3 ==================== 3 4 ··· 11 10 echoing "1" to a chosen port. 12 11 13 12 Please note that this trigger allows selecting multiple USB ports for a single 14 - LED. This can be useful in two cases: 13 + LED. 14 + 15 + This can be useful in two cases: 15 16 16 17 1) Device with single USB LED and few physical ports 18 + ==================================================== 17 19 18 20 In such a case LED will be turned on as long as there is at least one connected 19 21 USB device. 20 22 21 23 2) Device with a physical port handled by few controllers 24 + ========================================================= 22 25 23 26 Some devices may have one controller per PHY standard. E.g. USB 3.0 physical 24 27 port may be handled by ohci-platform, ehci-platform and xhci-hcd. If there is ··· 30 25 31 26 32 27 This trigger can be activated from user space on led class devices as shown 33 - below: 28 + below:: 34 29 35 30 echo usbport > trigger 36 31 37 32 This adds sysfs attributes to the LED that are documented in: 38 33 Documentation/ABI/testing/sysfs-class-led-trigger-usbport 39 34 40 - Example use-case: 35 + Example use-case:: 41 36 42 37 echo usbport > trigger 43 38 echo 1 > ports/usb1-port1
+3 -2
Documentation/leds/uleds.txt Documentation/leds/uleds.rst
··· 1 + ============== 1 2 Userspace LEDs 2 3 ============== 3 4 ··· 11 10 12 11 When the driver is loaded, a character device is created at /dev/uleds. To 13 12 create a new LED class device, open /dev/uleds and write a uleds_user_dev 14 - structure to it (found in kernel public header file linux/uleds.h). 13 + structure to it (found in kernel public header file linux/uleds.h):: 15 14 16 15 #define LED_MAX_NAME_SIZE 64 17 16 18 17 struct uleds_user_dev { 19 - char name[LED_MAX_NAME_SIZE]; 18 + char name[LED_MAX_NAME_SIZE]; 20 19 }; 21 20 22 21 A new LED class device will be created with the name given. The name can be
+1 -1
MAINTAINERS
··· 10117 10117 S: Supported 10118 10118 F: drivers/leds/leds-mlxcpld.c 10119 10119 F: drivers/leds/leds-mlxreg.c 10120 - F: Documentation/leds/leds-mlxcpld.txt 10120 + F: Documentation/leds/leds-mlxcpld.rst 10121 10121 10122 10122 MELLANOX PLATFORM DRIVER 10123 10123 M: Vadim Pasternak <vadimp@mellanox.com>
+1 -1
drivers/leds/trigger/Kconfig
··· 14 14 This allows LEDs to be controlled by a programmable timer 15 15 via sysfs. Some LED hardware can be programmed to start 16 16 blinking the LED without any further software interaction. 17 - For more details read Documentation/leds/leds-class.txt. 17 + For more details read Documentation/leds/leds-class.rst. 18 18 19 19 If unsure, say Y. 20 20
+1 -1
drivers/leds/trigger/ledtrig-transient.c
··· 3 3 // LED Kernel Transient Trigger 4 4 // 5 5 // Transient trigger allows one shot timer activation. Please refer to 6 - // Documentation/leds/ledtrig-transient.txt for details 6 + // Documentation/leds/ledtrig-transient.rst for details 7 7 // Copyright (C) 2012 Shuah Khan <shuahkhan@gmail.com> 8 8 // 9 9 // Based on Richard Purdie's ledtrig-timer.c and Atsushi Nemoto's
+1 -1
net/netfilter/Kconfig
··· 905 905 echo netfilter-ssh > /sys/class/leds/<ledname>/trigger 906 906 907 907 For more information on the LEDs available on your system, see 908 - Documentation/leds/leds-class.txt 908 + Documentation/leds/leds-class.rst 909 909 910 910 config NETFILTER_XT_TARGET_LOG 911 911 tristate "LOG target support"