1 Kernel driver for LP5562
2 ========================
6 Author: Milo(Woogyom) Kim <milo.kim@ti.com>
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.
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
17 Device attribute: engine_mux
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.
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.
28 Red ... Engine 1 (fixed)
29 Green ... Engine 2 (fixed)
30 Blue ... Engine 3 (fixed)
31 White ... Engine 1 or 2 or 3 (selective)
33 How to load the program data using engine_mux
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.
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
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
56 How to load the predefined patterns
58 Please refer to 'leds-lp55xx.txt"
60 Setting Current of Each Channel
62 Like LP5521 and LP5523/55231, LP5562 provides LED current settings.
63 The 'led_current' and 'max_current' are used.
65 (Example of Platform data)
67 To configure the platform specific data, lp55xx_platform_data structure is used.
69 static struct lp55xx_led_config lp5562_led_config[] = {
96 static int lp5562_setup(void)
98 /* setup HW resources */
101 static void lp5562_release(void)
103 /* Release HW resources */
106 static void lp5562_enable(bool state)
108 /* Control of chip enable signal */
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,
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.