~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/leds/leds-lp55xx.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/leds/leds-lp55xx.rst (Version linux-6.12-rc7) and /Documentation/leds/leds-lp55xx.rst (Version linux-4.16.18)


  1 ==============================================    
  2 LP5521/LP5523/LP55231/LP5562/LP8501 Common Dri    
  3 ==============================================    
  4                                                   
  5 Authors: Milo(Woogyom) Kim <milo.kim@ti.com>       
  6                                                   
  7 Description                                       
  8 -----------                                       
  9 LP5521, LP5523/55231, LP5562 and LP8501 have c    
 10                                                   
 11   Register access via the I2C                     
 12   Device initialization/deinitialization          
 13   Create LED class devices for multiple output    
 14   Device attributes for user-space interface      
 15   Program memory for running LED patterns         
 16                                                   
 17 The LP55xx common driver provides these featur    
 18                                                   
 19   lp55xx_init_device() / lp55xx_deinit_device(    
 20   lp55xx_register_leds() / lp55xx_unregister_l    
 21   lp55xx_regsister_sysfs() / lp55xx_unregister    
 22                                                   
 23 ( Driver Structure Data )                         
 24                                                   
 25 In lp55xx common driver, two different data st    
 26                                                   
 27 * lp55xx_led                                      
 28     control multi output LED channels such as     
 29 * lp55xx_chip                                     
 30     general chip control such like the I2C and    
 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, spe    
 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     
 56   - Additional device specific attributes         
 57                                                   
 58 ( Firmware Interface )                            
 59                                                   
 60 LP55xx family devices have the internal progra    
 61 various LED patterns.                             
 62                                                   
 63 This pattern data is saved as a file in the us    
 64 hex byte string is written into the memory thr    
 65                                                   
 66 LP55xx common driver supports the firmware int    
 67                                                   
 68 LP55xx chips have three program engines.          
 69                                                   
 70 To load and run the pattern, the programming s    
 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 inter    
 78                                                   
 79 select_engine:                                    
 80         Select which engine is used for runnin    
 81 run_engine:                                       
 82         Start program which is loaded via the     
 83 firmware:                                         
 84         Load program data                         
 85                                                   
 86 In case of LP5523, one more command is require    
 87 It is used for selecting LED output(s) at each    
 88 In more details, please refer to 'leds-lp5523.    
 89                                                   
 90 For example, run blinking pattern in engine #1    
 91                                                   
 92         echo 1 > /sys/bus/i2c/devices/xxxx/sel    
 93         echo 1 > /sys/class/firmware/lp5521/lo    
 94         echo "4000600040FF6000" > /sys/class/f    
 95         echo 0 > /sys/class/firmware/lp5521/lo    
 96         echo 1 > /sys/bus/i2c/devices/xxxx/run    
 97                                                   
 98 For example, run blinking pattern in engine #3    
 99                                                   
100 Two LEDs are configured as pattern output chan    
101                                                   
102         echo 3 > /sys/bus/i2c/devices/xxxx/sel    
103         echo 1 > /sys/class/firmware/lp55231/l    
104         echo "9d0740ff7e0040007e00a0010000" >     
105         echo 0 > /sys/class/firmware/lp55231/l    
106         echo "000001100" > /sys/bus/i2c/device    
107         echo 1 > /sys/bus/i2c/devices/xxxx/run    
108                                                   
109 To start blinking patterns in engine #2 and #3    
110                                                   
111         for idx in 2 3                            
112         do                                        
113         echo $idx > /sys/class/leds/red/device    
114         sleep 0.1                                 
115         echo 1 > /sys/class/firmware/lp5521/lo    
116         echo "4000600040FF6000" > /sys/class/f    
117         echo 0 > /sys/class/firmware/lp5521/lo    
118         done                                      
119         echo 1 > /sys/class/leds/red/device/ru    
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/sel    
126         echo 1 > /sys/class/firmware/lp5523/lo    
127         echo "9d80400004ff05ff437f0000" > /sys    
128         echo 0 > /sys/class/firmware/lp5523/lo    
129         echo "111111111" > /sys/bus/i2c/device    
130         echo 1 > /sys/bus/i2c/devices/xxxx/run    
131                                                   
132 As soon as 'loading' is set to 0, registered c    
133 Inside the callback, the selected engine is lo    
134 To run programmed pattern, 'run_engine' attrib    
135                                                   
136 The pattern sequence of LP8501 is similar to L    
137                                                   
138 However pattern data is specific.                 
139                                                   
140 Ex 1) Engine 1 is used::                          
141                                                   
142         echo 1 > /sys/bus/i2c/devices/xxxx/sel    
143         echo 1 > /sys/class/firmware/lp8501/lo    
144         echo "9d0140ff7e0040007e00a001c000" >     
145         echo 0 > /sys/class/firmware/lp8501/lo    
146         echo 1 > /sys/bus/i2c/devices/xxxx/run    
147                                                   
148 Ex 2) Engine 2 and 3 are used at the same time    
149                                                   
150         echo 2 > /sys/bus/i2c/devices/xxxx/sel    
151         sleep 1                                   
152         echo 1 > /sys/class/firmware/lp8501/lo    
153         echo "9d0140ff7e0040007e00a001c000" >     
154         echo 0 > /sys/class/firmware/lp8501/lo    
155         sleep 1                                   
156         echo 3 > /sys/bus/i2c/devices/xxxx/sel    
157         sleep 1                                   
158         echo 1 > /sys/class/firmware/lp8501/lo    
159         echo "9d0340ff7e0040007e00a001c000" >     
160         echo 0 > /sys/class/firmware/lp8501/lo    
161         sleep 1                                   
162         echo 1 > /sys/class/leds/d1/device/run    
163                                                   
164 ( 'run_engine' and 'firmware_cb' )                
165                                                   
166 The sequence of running the program data is co    
167                                                   
168 But each device has own specific register addr    
169                                                   
170 To support this, 'run_engine' and 'firmware_cb    
171                                                   
172 run_engine:                                       
173         Control the selected engine               
174 firmware_cb:                                      
175         The callback function after loading th    
176                                                   
177         Chip specific commands for loading and    
178                                                   
179 ( Predefined pattern data )                       
180                                                   
181 Without the firmware interface, LP55xx driver     
182 loading a LED pattern. That is 'predefined' pa    
183                                                   
184 A predefined pattern is defined in the platfor    
185 via the sysfs if needed.                          
186                                                   
187 To use the predefined pattern concept, 'patter    
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,     
195                 };                                
196                                                   
197   /* mode_2: always on */                         
198   static const u8 mode_2[] = { 0x40, 0xFF, };     
199                                                   
200   struct lp55xx_predef_pattern board_led_patte    
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_    
215   };                                              
216                                                   
217 Then, mode_1 and mode_2 can be run via through    
218                                                   
219   echo 1 > /sys/bus/i2c/devices/xxxx/led_patte    
220   echo 2 > /sys/bus/i2c/devices/xxxx/led_patte    
221                                                   
222 To stop running pattern::                         
223                                                   
224   echo 0 > /sys/bus/i2c/devices/xxxx/led_patte    
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php