diff options
Diffstat (limited to 'Documentation/leds')
-rw-r--r-- | Documentation/leds/00-INDEX | 2 | ||||
-rw-r--r-- | Documentation/leds/leds-lp5562.txt | 135 | ||||
-rw-r--r-- | Documentation/leds/leds-lp55xx.txt | 46 |
3 files changed, 182 insertions, 1 deletions
diff --git a/Documentation/leds/00-INDEX b/Documentation/leds/00-INDEX index 5246090ef15c..1ecd1596633e 100644 --- a/Documentation/leds/00-INDEX +++ b/Documentation/leds/00-INDEX | |||
@@ -6,6 +6,8 @@ leds-lp5521.txt | |||
6 | - notes on how to use the leds-lp5521 driver. | 6 | - notes on how to use the leds-lp5521 driver. |
7 | leds-lp5523.txt | 7 | leds-lp5523.txt |
8 | - notes on how to use the leds-lp5523 driver. | 8 | - notes on how to use the leds-lp5523 driver. |
9 | leds-lp5562.txt | ||
10 | - notes on how to use the leds-lp5562 driver. | ||
9 | leds-lp55xx.txt | 11 | leds-lp55xx.txt |
10 | - description about lp55xx common driver. | 12 | - description about lp55xx common driver. |
11 | leds-lm3556.txt | 13 | leds-lm3556.txt |
diff --git a/Documentation/leds/leds-lp5562.txt b/Documentation/leds/leds-lp5562.txt new file mode 100644 index 000000000000..96061000dd93 --- /dev/null +++ b/Documentation/leds/leds-lp5562.txt | |||
@@ -0,0 +1,135 @@ | |||
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. | ||
121 | |||
122 | The 'update_config' : CONFIG register (ADDR 08h) | ||
123 | This value is platform-specific data. | ||
124 | If update_config is not defined, the CONFIG register is set with | ||
125 | 'LP5562_PWRSAVE_EN | LP5562_CLK_AUTO'. | ||
126 | (Enable auto-powersave, set automatic clock source selection) | ||
127 | |||
128 | #define LP5562_CONFIGS (LP5562_PWM_HF | LP5562_PWRSAVE_EN | \ | ||
129 | LP5562_CLK_SRC_EXT) | ||
130 | |||
131 | static struct lp55xx_platform_data lp5562_pdata = { | ||
132 | .led_config = lp5562_led_config, | ||
133 | .num_channels = ARRAY_SIZE(lp5562_led_config), | ||
134 | .update_config = LP5562_CONFIGS, | ||
135 | }; | ||
diff --git a/Documentation/leds/leds-lp55xx.txt b/Documentation/leds/leds-lp55xx.txt index ced41868d2d1..eec8fa2ffe4e 100644 --- a/Documentation/leds/leds-lp55xx.txt +++ b/Documentation/leds/leds-lp55xx.txt | |||
@@ -5,7 +5,7 @@ Authors: Milo(Woogyom) Kim <milo.kim@ti.com> | |||
5 | 5 | ||
6 | Description | 6 | Description |
7 | ----------- | 7 | ----------- |
8 | LP5521, LP5523/55231 have common features as below. | 8 | LP5521, LP5523/55231 and LP5562 have common features as below. |
9 | 9 | ||
10 | Register access via the I2C | 10 | Register access via the I2C |
11 | Device initialization/deinitialization | 11 | Device initialization/deinitialization |
@@ -116,3 +116,47 @@ To support this, 'run_engine' and 'firmware_cb' are configurable in each driver. | |||
116 | run_engine : Control the selected engine | 116 | run_engine : Control the selected engine |
117 | firmware_cb : The callback function after loading the firmware is done. | 117 | firmware_cb : The callback function after loading the firmware is done. |
118 | Chip specific commands for loading and updating program memory. | 118 | Chip specific commands for loading and updating program memory. |
119 | |||
120 | ( Predefined pattern data ) | ||
121 | |||
122 | Without the firmware interface, LP55xx driver provides another method for | ||
123 | loading a LED pattern. That is 'predefined' pattern. | ||
124 | A predefined pattern is defined in the platform data and load it(or them) | ||
125 | via the sysfs if needed. | ||
126 | To use the predefined pattern concept, 'patterns' and 'num_patterns' should be | ||
127 | configured. | ||
128 | |||
129 | Example of predefined pattern data: | ||
130 | |||
131 | /* mode_1: blinking data */ | ||
132 | static const u8 mode_1[] = { | ||
133 | 0x40, 0x00, 0x60, 0x00, 0x40, 0xFF, 0x60, 0x00, | ||
134 | }; | ||
135 | |||
136 | /* mode_2: always on */ | ||
137 | static const u8 mode_2[] = { 0x40, 0xFF, }; | ||
138 | |||
139 | struct lp55xx_predef_pattern board_led_patterns[] = { | ||
140 | { | ||
141 | .r = mode_1, | ||
142 | .size_r = ARRAY_SIZE(mode_1), | ||
143 | }, | ||
144 | { | ||
145 | .b = mode_2, | ||
146 | .size_b = ARRAY_SIZE(mode_2), | ||
147 | }, | ||
148 | } | ||
149 | |||
150 | struct lp55xx_platform_data lp5562_pdata = { | ||
151 | ... | ||
152 | .patterns = board_led_patterns, | ||
153 | .num_patterns = ARRAY_SIZE(board_led_patterns), | ||
154 | }; | ||
155 | |||
156 | Then, mode_1 and mode_2 can be run via through the sysfs. | ||
157 | |||
158 | echo 1 > /sys/bus/i2c/devices/xxxx/led_pattern # red blinking LED pattern | ||
159 | echo 2 > /sys/bus/i2c/devices/xxxx/led_pattern # blue LED always on | ||
160 | |||
161 | To stop running pattern, | ||
162 | echo 0 > /sys/bus/i2c/devices/xxxx/led_pattern | ||