Drsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget$/translations/zh_CN/leds/leds-lp55xxmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/zh_TW/leds/leds-lp55xxmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/it_IT/leds/leds-lp55xxmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ja_JP/leds/leds-lp55xxmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ko_KR/leds/leds-lp55xxmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/sp_SP/leds/leds-lp55xxmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h1LP5521/LP5523/LP55231/LP5562/LP8501 Common Driverh]h1LP5521/LP5523/LP55231/LP5562/LP8501 Common Driver}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh>/var/lib/git/docbuild/linux/Documentation/leds/leds-lp55xx.rsthKubh paragraph)}(h,Authors: Milo(Woogyom) Kim h](hAuthors: Milo(Woogyom) Kim <}(hhhhhNhNubh reference)}(hmilo.kim@ti.comh]hmilo.kim@ti.com}(hhhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:milo.kim@ti.comuh1hhhubh>}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h Descriptionh]h Description}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hFLP5521, LP5523/55231, LP5562 and LP8501 have common features as below.h]hFLP5521, LP5523/55231, LP5562 and LP8501 have common features as below.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh block_quote)}(hRegister access via the I2C Device initialization/deinitialization Create LED class devices for multiple output channels Device attributes for user-space interface Program memory for running LED patterns h]h)}(hRegister access via the I2C Device initialization/deinitialization Create LED class devices for multiple output channels Device attributes for user-space interface Program memory for running LED patternsh]hRegister access via the I2C Device initialization/deinitialization Create LED class devices for multiple output channels Device attributes for user-space interface Program memory for running LED patterns}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hJThe LP55xx common driver provides these features using exported functions.h]hJThe LP55xx common driver provides these features using exported functions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hlp55xx_init_device() / lp55xx_deinit_device() lp55xx_register_leds() / lp55xx_unregister_leds() lp55xx_regsister_sysfs() / lp55xx_unregister_sysfs() h]h)}(hlp55xx_init_device() / lp55xx_deinit_device() lp55xx_register_leds() / lp55xx_unregister_leds() lp55xx_regsister_sysfs() / lp55xx_unregister_sysfs()h]hlp55xx_init_device() / lp55xx_deinit_device() lp55xx_register_leds() / lp55xx_unregister_leds() lp55xx_regsister_sysfs() / lp55xx_unregister_sysfs()}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj$ubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h( Driver Structure Data )h]h( Driver Structure Data )}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h>In lp55xx common driver, two different data structure is used.h]h>In lp55xx common driver, two different data structure is used.}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh bullet_list)}(hhh](h list_item)}(hRlp55xx_led control multi output LED channels such as led current, channel index.h]hdefinition_list)}(hhh]hdefinition_list_item)}(hPlp55xx_led control multi output LED channels such as led current, channel index.h](hterm)}(h lp55xx_ledh]h lp55xx_led}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1jnhhhKhjjubh definition)}(hhh]h)}(hEcontrol multi output LED channels such as led current, channel index.h]hEcontrol multi output LED channels such as led current, channel index.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j~hjjubeh}(h]h ]h"]h$]h&]uh1jhhhhKhjeubah}(h]h ]h"]h$]h&]uh1jchj_ubah}(h]h ]h"]h$]h&]uh1j]hjZhhhNhNubj^)}(hHlp55xx_chip general chip control such like the I2C and platform data. h]jd)}(hhh]ji)}(hFlp55xx_chip general chip control such like the I2C and platform data. h](jo)}(h lp55xx_chiph]h lp55xx_chip}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jnhhhKhjubj)}(hhh]h)}(h9general chip control such like the I2C and platform data.h]h9general chip control such like the I2C and platform data.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j~hjubeh}(h]h ]h"]h$]h&]uh1jhhhhKhjubah}(h]h ]h"]h$]h&]uh1jchjubah}(h]h ]h"]h$]h&]uh1j]hjZhhhNhNubeh}(h]h ]h"]h$]h&]bullet*uh1jXhhhKhhhhubh)}(hTFor example, LP5521 has maximum 3 LED channels. LP5523/55231 has 9 output channels::h]hSFor example, LP5521 has maximum 3 LED channels. LP5523/55231 has 9 output channels:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh literal_block)}(hX<lp55xx_chip for LP5521 ... lp55xx_led #1 lp55xx_led #2 lp55xx_led #3 lp55xx_chip for LP5523 ... lp55xx_led #1 lp55xx_led #2 . . lp55xx_led #9h]hX<lp55xx_chip for LP5521 ... lp55xx_led #1 lp55xx_led #2 lp55xx_led #3 lp55xx_chip for LP5523 ... lp55xx_led #1 lp55xx_led #2 . . lp55xx_led #9}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhK#hhhhubh)}(h( Chip Dependent Code )h]h( Chip Dependent Code )}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hhhhubh)}(hZTo support device specific configurations, special structure 'lpxx_device_config' is used.h]h^To support device specific configurations, special structure ‘lpxx_device_config’ is used.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hhhhubh)}(hX- Maximum number of channels - Reset command, chip enable command - Chip specific initialization - Brightness control register access - Setting LED output current - Program memory address access for running patterns - Additional device specific attributes h]jY)}(hhh](j^)}(hMaximum number of channelsh]h)}(hj8h]hMaximum number of channels}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hj6ubah}(h]h ]h"]h$]h&]uh1j]hj3ubj^)}(h"Reset command, chip enable commandh]h)}(hjOh]h"Reset command, chip enable command}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjMubah}(h]h ]h"]h$]h&]uh1j]hj3ubj^)}(hChip specific initializationh]h)}(hjfh]hChip specific initialization}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjdubah}(h]h ]h"]h$]h&]uh1j]hj3ubj^)}(h"Brightness control register accessh]h)}(hj}h]h"Brightness control register access}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hj{ubah}(h]h ]h"]h$]h&]uh1j]hj3ubj^)}(hSetting LED output currenth]h)}(hjh]hSetting LED output current}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1j]hj3ubj^)}(h2Program memory address access for running patternsh]h)}(hjh]h2Program memory address access for running patterns}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hjubah}(h]h ]h"]h$]h&]uh1j]hj3ubj^)}(h&Additional device specific attributes h]h)}(h%Additional device specific attributesh]h%Additional device specific attributes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1j]hj3ubeh}(h]h ]h"]h$]h&]j-uh1jXhhhK2hj/ubah}(h]h ]h"]h$]h&]uh1hhhhK2hhhhubh)}(h( Firmware Interface )h]h( Firmware Interface )}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hhhhubh)}(hXLP55xx family devices have the internal program memory for running various LED patterns.h]hXLP55xx family devices have the internal program memory for running various LED patterns.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKselect_engine: Select which engine is used for running programh](jo)}(hselect_engine:h]hselect_engine:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jnhhhKOhjubj)}(hhh]h)}(h/Select which engine is used for running programh]h/Select which engine is used for running program}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjubah}(h]h ]h"]h$]h&]uh1j~hjubeh}(h]h ]h"]h$]h&]uh1jhhhhKOhjubji)}(hDrun_engine: Start program which is loaded via the firmware interfaceh](jo)}(h run_engine:h]h run_engine:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jnhhhKQhjubj)}(hhh]h)}(h8Start program which is loaded via the firmware interfaceh]h8Start program which is loaded via the firmware interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKRhjubah}(h]h ]h"]h$]h&]uh1j~hjubeh}(h]h ]h"]h$]h&]uh1jhhhhKQhjhhubji)}(hfirmware: Load program data h](jo)}(h firmware:h]h firmware:}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jnhhhKThj ubj)}(hhh]h)}(hLoad program datah]hLoad program data}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThj2ubah}(h]h ]h"]h$]h&]uh1j~hj ubeh}(h]h ]h"]h$]h&]uh1jhhhhKThjhhubeh}(h]h ]h"]h$]h&]uh1jchhhhhhhNubh)}(hIn case of LP5523, one more command is required, 'enginex_leds'. It is used for selecting LED output(s) at each engine number. In more details, please refer to 'leds-lp5523.txt'.h]hIn case of LP5523, one more command is required, ‘enginex_leds’. It is used for selecting LED output(s) at each engine number. In more details, please refer to ‘leds-lp5523.txt’.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhhhhubh)}(h:For example, run blinking pattern in engine #1 of LP5521::h]h9For example, run blinking pattern in engine #1 of LP5521:}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKZhhhhubj)}(hecho 1 > /sys/bus/i2c/devices/xxxx/select_engine echo 1 > /sys/class/firmware/lp5521/loading echo "4000600040FF6000" > /sys/class/firmware/lp5521/data echo 0 > /sys/class/firmware/lp5521/loading echo 1 > /sys/bus/i2c/devices/xxxx/run_engineh]hecho 1 > /sys/bus/i2c/devices/xxxx/select_engine echo 1 > /sys/class/firmware/lp5521/loading echo "4000600040FF6000" > /sys/class/firmware/lp5521/data echo 0 > /sys/class/firmware/lp5521/loading echo 1 > /sys/bus/i2c/devices/xxxx/run_engine}hjqsbah}(h]h ]h"]h$]h&]jjuh1jhhhK\hhhhubh)}(h9For example, run blinking pattern in engine #3 of LP55231h]h9For example, run blinking pattern in engine #3 of LP55231}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhhhhubh)}(h4Two LEDs are configured as pattern output channels::h]h3Two LEDs are configured as pattern output channels:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhhhhubj)}(hX9echo 3 > /sys/bus/i2c/devices/xxxx/select_engine echo 1 > /sys/class/firmware/lp55231/loading echo "9d0740ff7e0040007e00a0010000" > /sys/class/firmware/lp55231/data echo 0 > /sys/class/firmware/lp55231/loading echo "000001100" > /sys/bus/i2c/devices/xxxx/engine3_leds echo 1 > /sys/bus/i2c/devices/xxxx/run_engineh]hX9echo 3 > /sys/bus/i2c/devices/xxxx/select_engine echo 1 > /sys/class/firmware/lp55231/loading echo "9d0740ff7e0040007e00a0010000" > /sys/class/firmware/lp55231/data echo 0 > /sys/class/firmware/lp55231/loading echo "000001100" > /sys/bus/i2c/devices/xxxx/engine3_leds echo 1 > /sys/bus/i2c/devices/xxxx/run_engine}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKfhhhhubh)}(h?To start blinking patterns in engine #2 and #3 simultaneously::h]h>To start blinking patterns in engine #2 and #3 simultaneously:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhhhhubj)}(hXfor idx in 2 3 do echo $idx > /sys/class/leds/red/device/select_engine sleep 0.1 echo 1 > /sys/class/firmware/lp5521/loading echo "4000600040FF6000" > /sys/class/firmware/lp5521/data echo 0 > /sys/class/firmware/lp5521/loading done echo 1 > /sys/class/leds/red/device/run_engineh]hXfor idx in 2 3 do echo $idx > /sys/class/leds/red/device/select_engine sleep 0.1 echo 1 > /sys/class/firmware/lp5521/loading echo "4000600040FF6000" > /sys/class/firmware/lp5521/data echo 0 > /sys/class/firmware/lp5521/loading done echo 1 > /sys/class/leds/red/device/run_engine}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKohhhhubh)}(h#Here is another example for LP5523.h]h#Here is another example for LP5523.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhhhhubh)}(h1Full LED strings are selected by 'engine2_leds'::h]h4Full LED strings are selected by ‘engine2_leds’:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hhhhubj)}(hX2echo 2 > /sys/bus/i2c/devices/xxxx/select_engine echo 1 > /sys/class/firmware/lp5523/loading echo "9d80400004ff05ff437f0000" > /sys/class/firmware/lp5523/data echo 0 > /sys/class/firmware/lp5523/loading echo "111111111" > /sys/bus/i2c/devices/xxxx/engine2_leds echo 1 > /sys/bus/i2c/devices/xxxx/run_engineh]hX2echo 2 > /sys/bus/i2c/devices/xxxx/select_engine echo 1 > /sys/class/firmware/lp5523/loading echo "9d80400004ff05ff437f0000" > /sys/class/firmware/lp5523/data echo 0 > /sys/class/firmware/lp5523/loading echo "111111111" > /sys/bus/i2c/devices/xxxx/engine2_leds echo 1 > /sys/bus/i2c/devices/xxxx/run_engine}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhK}hhhhubh)}(hAs soon as 'loading' is set to 0, registered callback is called. Inside the callback, the selected engine is loaded and memory is updated. To run programmed pattern, 'run_engine' attribute should be enabled.h]hAs soon as ‘loading’ is set to 0, registered callback is called. Inside the callback, the selected engine is loaded and memory is updated. To run programmed pattern, ‘run_engine’ attribute should be enabled.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h4The pattern sequence of LP8501 is similar to LP5523.h]h4The pattern sequence of LP8501 is similar to LP5523.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h!However pattern data is specific.h]h!However pattern data is specific.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hEx 1) Engine 1 is used::h]hEx 1) Engine 1 is used:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj)}(hecho 1 > /sys/bus/i2c/devices/xxxx/select_engine echo 1 > /sys/class/firmware/lp8501/loading echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data echo 0 > /sys/class/firmware/lp8501/loading echo 1 > /sys/bus/i2c/devices/xxxx/run_engineh]hecho 1 > /sys/bus/i2c/devices/xxxx/select_engine echo 1 > /sys/class/firmware/lp8501/loading echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data echo 0 > /sys/class/firmware/lp8501/loading echo 1 > /sys/bus/i2c/devices/xxxx/run_engine}hj'sbah}(h]h ]h"]h$]h&]jjuh1jhhhKhhhhubh)}(h0Ex 2) Engine 2 and 3 are used at the same time::h]h/Ex 2) Engine 2 and 3 are used at the same time:}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj)}(hXecho 2 > /sys/bus/i2c/devices/xxxx/select_engine sleep 1 echo 1 > /sys/class/firmware/lp8501/loading echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data echo 0 > /sys/class/firmware/lp8501/loading sleep 1 echo 3 > /sys/bus/i2c/devices/xxxx/select_engine sleep 1 echo 1 > /sys/class/firmware/lp8501/loading echo "9d0340ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data echo 0 > /sys/class/firmware/lp8501/loading sleep 1 echo 1 > /sys/class/leds/d1/device/run_engineh]hXecho 2 > /sys/bus/i2c/devices/xxxx/select_engine sleep 1 echo 1 > /sys/class/firmware/lp8501/loading echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data echo 0 > /sys/class/firmware/lp8501/loading sleep 1 echo 3 > /sys/bus/i2c/devices/xxxx/select_engine sleep 1 echo 1 > /sys/class/firmware/lp8501/loading echo "9d0340ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data echo 0 > /sys/class/firmware/lp8501/loading sleep 1 echo 1 > /sys/class/leds/d1/device/run_engine}hjCsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhhhhubh)}(h"( 'run_engine' and 'firmware_cb' )h]h*( ‘run_engine’ and ‘firmware_cb’ )}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h3The sequence of running the program data is common.h]h3The sequence of running the program data is common.}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hABut each device has own specific register addresses for commands.h]hABut each device has own specific register addresses for commands.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hPTo support this, 'run_engine' and 'firmware_cb' are configurable in each driver.h]hXTo support this, ‘run_engine’ and ‘firmware_cb’ are configurable in each driver.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubjd)}(hhh](ji)}(h'run_engine: Control the selected engineh](jo)}(h run_engine:h]h run_engine:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jnhhhKhjubj)}(hhh]h)}(hControl the selected engineh]hControl the selected engine}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j~hjubeh}(h]h ]h"]h$]h&]uh1jhhhhKhjubji)}(hfirmware_cb: The callback function after loading the firmware is done. Chip specific commands for loading and updating program memory. h](jo)}(h firmware_cb:h]h firmware_cb:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jnhhhKhjubj)}(hhh](h)}(h9The callback function after loading the firmware is done.h]h9The callback function after loading the firmware is done.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h?Chip specific commands for loading and updating program memory.h]h?Chip specific commands for loading and updating program memory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j~hjubeh}(h]h ]h"]h$]h&]uh1jhhhhKhjhhubeh}(h]h ]h"]h$]h&]uh1jchhhhhhhNubh)}(h( Predefined pattern data )h]h( Predefined pattern data )}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h~Without the firmware interface, LP55xx driver provides another method for loading a LED pattern. That is 'predefined' pattern.h]hWithout the firmware interface, LP55xx driver provides another method for loading a LED pattern. That is ‘predefined’ pattern.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hbA predefined pattern is defined in the platform data and load it(or them) via the sysfs if needed.h]hbA predefined pattern is defined in the platform data and load it(or them) via the sysfs if needed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hZTo use the predefined pattern concept, 'patterns' and 'num_patterns' should be configured.h]hbTo use the predefined pattern concept, ‘patterns’ and ‘num_patterns’ should be configured.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h$Example of predefined pattern data::h]h#Example of predefined pattern data:}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj)}(hXL/* mode_1: blinking data */ static const u8 mode_1[] = { 0x40, 0x00, 0x60, 0x00, 0x40, 0xFF, 0x60, 0x00, }; /* mode_2: always on */ static const u8 mode_2[] = { 0x40, 0xFF, }; struct lp55xx_predef_pattern board_led_patterns[] = { { .r = mode_1, .size_r = ARRAY_SIZE(mode_1), }, { .b = mode_2, .size_b = ARRAY_SIZE(mode_2), }, } struct lp55xx_platform_data lp5562_pdata = { ... .patterns = board_led_patterns, .num_patterns = ARRAY_SIZE(board_led_patterns), };h]hXL/* mode_1: blinking data */ static const u8 mode_1[] = { 0x40, 0x00, 0x60, 0x00, 0x40, 0xFF, 0x60, 0x00, }; /* mode_2: always on */ static const u8 mode_2[] = { 0x40, 0xFF, }; struct lp55xx_predef_pattern board_led_patterns[] = { { .r = mode_1, .size_r = ARRAY_SIZE(mode_1), }, { .b = mode_2, .size_b = ARRAY_SIZE(mode_2), }, } struct lp55xx_platform_data lp5562_pdata = { ... .patterns = board_led_patterns, .num_patterns = ARRAY_SIZE(board_led_patterns), };}hjDsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhhhhubh)}(h:Then, mode_1 and mode_2 can be run via through the sysfs::h]h9Then, mode_1 and mode_2 can be run via through the sysfs:}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj)}(hecho 1 > /sys/bus/i2c/devices/xxxx/led_pattern # red blinking LED pattern echo 2 > /sys/bus/i2c/devices/xxxx/led_pattern # blue LED always onh]hecho 1 > /sys/bus/i2c/devices/xxxx/led_pattern # red blinking LED pattern echo 2 > /sys/bus/i2c/devices/xxxx/led_pattern # blue LED always on}hj`sbah}(h]h ]h"]h$]h&]jjuh1jhhhKhhhhubh)}(hTo stop running pattern::h]hTo stop running pattern:}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubj)}(h.echo 0 > /sys/bus/i2c/devices/xxxx/led_patternh]h.echo 0 > /sys/bus/i2c/devices/xxxx/led_pattern}hj|sbah}(h]h ]h"]h$]h&]jjuh1jhhhKhhhhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhKubeh}(h]1lp5521-lp5523-lp55231-lp5562-lp8501-common-driverah ]h"]1lp5521/lp5523/lp55231/lp5562/lp8501 common driverah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjju nametypes}(jjuh}(jhjhu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.