diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2013-05-07 03:14:48 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2013-06-20 19:21:32 -0400 |
commit | 2dac912809490ea3a6e5c16b83b54a08f36fc3d9 (patch) | |
tree | 68d8add3b89ab7434d3fca6899eecaa5308fe95b /Documentation/devicetree/bindings/leds/leds-lp55xx.txt | |
parent | a036e4cde5f29da010ead845569ff1e1ecc32d2a (diff) |
leds: lp55xx: support dynamic channel settings in the device tree structure
Currently, the LP55xx DT structure supports max 3 channels.
However, LP5523 has max 9 channels and LP5562 has 4 channels.
To enhance this constraint, the DT structure has been changed.
(a) Use the child node for various channel settings instead of fixed array
(b) Remove 'num_channel' property.
This value can be retrieved by counting the children node.
(c) 'chan-name' property supported
(d) Documentation updates for LP5521 and LP5523
(cooloney@gmail.com: fix a coding style issue in leds-lp55xx.txt)
Cc: Gabriel Fernandez <gabriel.fernandez@stericsson.com>
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'Documentation/devicetree/bindings/leds/leds-lp55xx.txt')
-rw-r--r-- | Documentation/devicetree/bindings/leds/leds-lp55xx.txt | 109 |
1 files changed, 101 insertions, 8 deletions
diff --git a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt index 348c88eaadfd..1ed6bb0ce777 100644 --- a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt +++ b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt | |||
@@ -2,20 +2,113 @@ Binding for National Semiconductor LP55xx Led Drivers | |||
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible: "national,lp5521" or "national,lp5523" | 4 | - compatible: "national,lp5521" or "national,lp5523" |
5 | - label: Used for naming LEDs | 5 | - reg: I2C slave address |
6 | - num-channel: Number of LED channels | 6 | - clock-mode: Input clock mode, (0: automode, 1: internal, 2: external) |
7 | |||
8 | Each child has own specific current settings | ||
7 | - led-cur: Current setting at each led channel (mA x10, 0 if led is not connected) | 9 | - led-cur: Current setting at each led channel (mA x10, 0 if led is not connected) |
8 | - max-cur: Maximun current at each led channel. | 10 | - max-cur: Maximun current at each led channel. |
9 | - clock-mode: Input clock mode, (0: automode, 1: internal, 2: external) | ||
10 | 11 | ||
11 | example: | 12 | Optional properties: |
13 | - label: Used for naming LEDs | ||
14 | |||
15 | Alternatively, each child can have specific channel name | ||
16 | - chan-name: Name of each channel name | ||
17 | |||
18 | example 1) LP5521 | ||
19 | 3 LED channels, external clock used. Channel names are 'lp5521_pri:channel0', | ||
20 | 'lp5521_pri:channel1' and 'lp5521_pri:channel2' | ||
12 | 21 | ||
13 | lp5521@32 { | 22 | lp5521@32 { |
14 | compatible = "national,lp5521"; | 23 | compatible = "national,lp5521"; |
15 | reg = <0x32>; | 24 | reg = <0x32>; |
16 | label = "lp5521_pri"; | 25 | label = "lp5521_pri"; |
17 | num-channel = /bits/ 8 <3>; | 26 | clock-mode = /bits/ 8 <2>; |
18 | led-cur = /bits/ 8 <0x2f 0x2f 0x2f>; | 27 | |
19 | max-cur = /bits/ 8 <0x5f 0x5f 0x5f>; | 28 | chan0 { |
20 | clock-mode = /bits/8 <2>; | 29 | led-cur = /bits/ 8 <0x2f>; |
30 | max-cur = /bits/ 8 <0x5f>; | ||
31 | }; | ||
32 | |||
33 | chan1 { | ||
34 | led-cur = /bits/ 8 <0x2f>; | ||
35 | max-cur = /bits/ 8 <0x5f>; | ||
36 | }; | ||
37 | |||
38 | chan2 { | ||
39 | led-cur = /bits/ 8 <0x2f>; | ||
40 | max-cur = /bits/ 8 <0x5f>; | ||
41 | }; | ||
42 | }; | ||
43 | |||
44 | example 2) LP5523 | ||
45 | 9 LED channels with specific name. Internal clock used. | ||
46 | The I2C slave address is configurable with ASEL1 and ASEL0 pins. | ||
47 | Available addresses are 32/33/34/35h. | ||
48 | |||
49 | ASEL1 ASEL0 Address | ||
50 | ------------------------- | ||
51 | GND GND 32h | ||
52 | GND VEN 33h | ||
53 | VEN GND 34h | ||
54 | VEN VEN 35h | ||
55 | |||
56 | lp5523@32 { | ||
57 | compatible = "national,lp5523"; | ||
58 | reg = <0x32>; | ||
59 | clock-mode = /bits/ 8 <1>; | ||
60 | |||
61 | chan0 { | ||
62 | chan-name = "d1"; | ||
63 | led-cur = /bits/ 8 <0x14>; | ||
64 | max-cur = /bits/ 8 <0x20>; | ||
65 | }; | ||
66 | |||
67 | chan1 { | ||
68 | chan-name = "d2"; | ||
69 | led-cur = /bits/ 8 <0x14>; | ||
70 | max-cur = /bits/ 8 <0x20>; | ||
71 | }; | ||
72 | |||
73 | chan2 { | ||
74 | chan-name = "d3"; | ||
75 | led-cur = /bits/ 8 <0x14>; | ||
76 | max-cur = /bits/ 8 <0x20>; | ||
77 | }; | ||
78 | |||
79 | chan3 { | ||
80 | chan-name = "d4"; | ||
81 | led-cur = /bits/ 8 <0x14>; | ||
82 | max-cur = /bits/ 8 <0x20>; | ||
83 | }; | ||
84 | |||
85 | chan4 { | ||
86 | chan-name = "d5"; | ||
87 | led-cur = /bits/ 8 <0x14>; | ||
88 | max-cur = /bits/ 8 <0x20>; | ||
89 | }; | ||
90 | |||
91 | chan5 { | ||
92 | chan-name = "d6"; | ||
93 | led-cur = /bits/ 8 <0x14>; | ||
94 | max-cur = /bits/ 8 <0x20>; | ||
95 | }; | ||
96 | |||
97 | chan6 { | ||
98 | chan-name = "d7"; | ||
99 | led-cur = /bits/ 8 <0x14>; | ||
100 | max-cur = /bits/ 8 <0x20>; | ||
101 | }; | ||
102 | |||
103 | chan7 { | ||
104 | chan-name = "d8"; | ||
105 | led-cur = /bits/ 8 <0x14>; | ||
106 | max-cur = /bits/ 8 <0x20>; | ||
107 | }; | ||
108 | |||
109 | chan8 { | ||
110 | chan-name = "d9"; | ||
111 | led-cur = /bits/ 8 <0x14>; | ||
112 | max-cur = /bits/ 8 <0x20>; | ||
113 | }; | ||
21 | }; | 114 | }; |