diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2013-02-19 00:10:14 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2013-04-01 14:04:48 -0400 |
commit | ff45262a85dbf1bc74463c5dcea1d71a406d4d8e (patch) | |
tree | 4b78b4d3efa02a63346a395fa02e610d4b62bf55 /Documentation/leds/leds-lp55xx.txt | |
parent | 07961ac7c0ee8b546658717034fe692fd12eefa9 (diff) |
leds: add new LP5562 LED driver
LP5562 can drive up to 4 channels, RGB and White.
LEDs can be controlled directly via the led class control interface.
LP55xx common driver
LP5562 is one of LP55xx family device, so LP55xx common code are used.
On the other hand, chip specific configuration is defined in the structure
'lp55xx_device_config'
LED pattern data
LP5562 has also internal program memory which is used for running various LED
patterns. LP5562 driver supports the firmware interface and the predefined
pattern data as well.
LP5562 device attributes: 'led_pattern' and 'engine_mux'
A 'led_pattern' is an index code which runs the predefined pattern data.
And 'engine_mux' is updated with the firmware interface is activated.
Detailed description has been updated in the documentation files,
'leds-lp55xx.txt' and 'leds-lp5562.txt'.
Changes on the header file
LP5562 configurable definitions are added.
Pattern RGB data is fixed as constant value.
(No side effect on other devices, LP5521 or LP5523.)
(cooloney@gmail.com: remove redundant mutex_unlock(). Reported by Dan
Carpenter <dan.carpenter@oracle.com>)
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'Documentation/leds/leds-lp55xx.txt')
-rw-r--r-- | Documentation/leds/leds-lp55xx.txt | 46 |
1 files changed, 45 insertions, 1 deletions
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 | ||