diff options
author | Samu Onkalo <samu.p.onkalo@nokia.com> | 2010-11-11 17:05:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-12 10:55:32 -0500 |
commit | 5991e154b2d09ad28af9dc7d3226b35dbbc052c3 (patch) | |
tree | ad716cded512e81c2b0a3beacff5dfb2a1f64e0e /Documentation | |
parent | f4920f673c4260de966b5f72c5524de0dabb7ffe (diff) |
Documentation: led drivers lp5521 and lp5523
Create sub directory Documentation/leds and add short documentation for
LP5521 and LP5523 drivers.
Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/leds/leds-lp5521.txt | 88 | ||||
-rw-r--r-- | Documentation/leds/leds-lp5523.txt | 83 |
2 files changed, 171 insertions, 0 deletions
diff --git a/Documentation/leds/leds-lp5521.txt b/Documentation/leds/leds-lp5521.txt new file mode 100644 index 000000000000..c4d8d151e0fe --- /dev/null +++ b/Documentation/leds/leds-lp5521.txt | |||
@@ -0,0 +1,88 @@ | |||
1 | Kernel driver for lp5521 | ||
2 | ======================== | ||
3 | |||
4 | * National Semiconductor LP5521 led driver chip | ||
5 | * Datasheet: http://www.national.com/pf/LP/LP5521.html | ||
6 | |||
7 | Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo | ||
8 | Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com) | ||
9 | |||
10 | Description | ||
11 | ----------- | ||
12 | |||
13 | LP5521 can drive up to 3 channels. Leds can be controlled directly via | ||
14 | the led class control interface. Channels have generic names: | ||
15 | lp5521:channelx, where x is 0 .. 2 | ||
16 | |||
17 | All three channels can be also controlled using the engine micro programs. | ||
18 | More details of the instructions can be found from the public data sheet. | ||
19 | |||
20 | Control interface for the engines: | ||
21 | x is 1 .. 3 | ||
22 | enginex_mode : disabled, load, run | ||
23 | enginex_load : store program (visible only in engine load mode) | ||
24 | |||
25 | Example (start to blink the channel 2 led): | ||
26 | cd /sys/class/leds/lp5521:channel2/device | ||
27 | echo "load" > engine3_mode | ||
28 | echo "037f4d0003ff6000" > engine3_load | ||
29 | echo "run" > engine3_mode | ||
30 | |||
31 | stop the engine: | ||
32 | echo "disabled" > engine3_mode | ||
33 | |||
34 | sysfs contains a selftest entry. | ||
35 | The test communicates with the chip and checks that | ||
36 | the clock mode is automatically set to the requested one. | ||
37 | |||
38 | Each channel has its own led current settings. | ||
39 | /sys/class/leds/lp5521:channel0/led_current - RW | ||
40 | /sys/class/leds/lp5521:channel0/max_current - RO | ||
41 | Format: 10x mA i.e 10 means 1.0 mA | ||
42 | |||
43 | example platform data: | ||
44 | |||
45 | Note: chan_nr can have values between 0 and 2. | ||
46 | |||
47 | static struct lp5521_led_config lp5521_led_config[] = { | ||
48 | { | ||
49 | .chan_nr = 0, | ||
50 | .led_current = 50, | ||
51 | .max_current = 130, | ||
52 | }, { | ||
53 | .chan_nr = 1, | ||
54 | .led_current = 0, | ||
55 | .max_current = 130, | ||
56 | }, { | ||
57 | .chan_nr = 2, | ||
58 | .led_current = 0, | ||
59 | .max_current = 130, | ||
60 | } | ||
61 | }; | ||
62 | |||
63 | static int lp5521_setup(void) | ||
64 | { | ||
65 | /* setup HW resources */ | ||
66 | } | ||
67 | |||
68 | static void lp5521_release(void) | ||
69 | { | ||
70 | /* Release HW resources */ | ||
71 | } | ||
72 | |||
73 | static void lp5521_enable(bool state) | ||
74 | { | ||
75 | /* Control of chip enable signal */ | ||
76 | } | ||
77 | |||
78 | static struct lp5521_platform_data lp5521_platform_data = { | ||
79 | .led_config = lp5521_led_config, | ||
80 | .num_channels = ARRAY_SIZE(lp5521_led_config), | ||
81 | .clock_mode = LP5521_CLOCK_EXT, | ||
82 | .setup_resources = lp5521_setup, | ||
83 | .release_resources = lp5521_release, | ||
84 | .enable = lp5521_enable, | ||
85 | }; | ||
86 | |||
87 | If the current is set to 0 in the platform data, that channel is | ||
88 | disabled and it is not visible in the sysfs. | ||
diff --git a/Documentation/leds/leds-lp5523.txt b/Documentation/leds/leds-lp5523.txt new file mode 100644 index 000000000000..fad2feb8b7ce --- /dev/null +++ b/Documentation/leds/leds-lp5523.txt | |||
@@ -0,0 +1,83 @@ | |||
1 | Kernel driver for lp5523 | ||
2 | ======================== | ||
3 | |||
4 | * National Semiconductor LP5523 led driver chip | ||
5 | * Datasheet: http://www.national.com/pf/LP/LP5523.html | ||
6 | |||
7 | Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo | ||
8 | Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com) | ||
9 | |||
10 | Description | ||
11 | ----------- | ||
12 | LP5523 can drive up to 9 channels. Leds can be controlled directly via | ||
13 | the led class control interface. Channels have generic names: | ||
14 | lp5523:channelx where x is 0...8 | ||
15 | |||
16 | The chip provides 3 engines. Each engine can control channels without | ||
17 | interaction from the main CPU. Details of the micro engine code can be found | ||
18 | from the public data sheet. Leds can be muxed to different channels. | ||
19 | |||
20 | Control interface for the engines: | ||
21 | x is 1 .. 3 | ||
22 | enginex_mode : disabled, load, run | ||
23 | enginex_load : microcode load (visible only in load mode) | ||
24 | enginex_leds : led mux control (visible only in load mode) | ||
25 | |||
26 | cd /sys/class/leds/lp5523:channel2/device | ||
27 | echo "load" > engine3_mode | ||
28 | echo "9d80400004ff05ff437f0000" > engine3_load | ||
29 | echo "111111111" > engine3_leds | ||
30 | echo "run" > engine3_mode | ||
31 | |||
32 | sysfs contains a selftest entry. It measures each channel | ||
33 | voltage level and checks if it looks reasonable. If the level is too high, | ||
34 | the led is missing; if the level is too low, there is a short circuit. | ||
35 | |||
36 | Selftest uses always the current from the platform data. | ||
37 | |||
38 | Each channel contains led current settings. | ||
39 | /sys/class/leds/lp5523:channel2/led_current - RW | ||
40 | /sys/class/leds/lp5523:channel2/max_current - RO | ||
41 | Format: 10x mA i.e 10 means 1.0 mA | ||
42 | |||
43 | Example platform data: | ||
44 | |||
45 | Note - chan_nr can have values between 0 and 8. | ||
46 | |||
47 | static struct lp5523_led_config lp5523_led_config[] = { | ||
48 | { | ||
49 | .chan_nr = 0, | ||
50 | .led_current = 50, | ||
51 | .max_current = 130, | ||
52 | }, | ||
53 | ... | ||
54 | }, { | ||
55 | .chan_nr = 8, | ||
56 | .led_current = 50, | ||
57 | .max_current = 130, | ||
58 | } | ||
59 | }; | ||
60 | |||
61 | static int lp5523_setup(void) | ||
62 | { | ||
63 | /* Setup HW resources */ | ||
64 | } | ||
65 | |||
66 | static void lp5523_release(void) | ||
67 | { | ||
68 | /* Release HW resources */ | ||
69 | } | ||
70 | |||
71 | static void lp5523_enable(bool state) | ||
72 | { | ||
73 | /* Control chip enable signal */ | ||
74 | } | ||
75 | |||
76 | static struct lp5523_platform_data lp5523_platform_data = { | ||
77 | .led_config = lp5523_led_config, | ||
78 | .num_channels = ARRAY_SIZE(lp5523_led_config), | ||
79 | .clock_mode = LP5523_CLOCK_EXT, | ||
80 | .setup_resources = lp5523_setup, | ||
81 | .release_resources = lp5523_release, | ||
82 | .enable = lp5523_enable, | ||
83 | }; | ||