1 ========================
2 Kernel driver for lp5562
3 ========================
7 Author: Milo(Woogyom) Kim <milo.kim@ti.com>
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.
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
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.
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
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 ===== === ===============================
41 How to load the program data using engine_mux
42 =============================================
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.
49 For example, run blinking green channel pattern::
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
58 To run a blinking white pattern::
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
67 How to load the predefined patterns
68 ===================================
70 Please refer to 'leds-lp55xx.txt"
72 Setting Current of Each Channel
73 ===============================
75 Like LP5521 and LP5523/55231, LP5562 provides LED current settings.
76 The 'led_current' and 'max_current' are used.
78 Example of Platform data
79 ========================
83 static struct lp55xx_led_config lp5562_led_config[] = {
110 static int lp5562_setup(void)
112 /* setup HW resources */
115 static void lp5562_release(void)
117 /* Release HW resources */
120 static void lp5562_enable(bool state)
122 /* Control of chip enable signal */
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,
133 To configure the platform specific data, lp55xx_platform_data structure is used
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.