summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel jeong2014-04-30 02:29:24 -0500
committerDaniel jeong2014-04-30 02:29:24 -0500
commit91ddf54ee4f018514af93cac252e3170ad635fa3 (patch)
tree3b1e58e81f82927741b391ffafe9f763fc80e828 /Documentation
downloadkernel-91ddf54ee4f018514af93cac252e3170ad635fa3.tar.gz
kernel-91ddf54ee4f018514af93cac252e3170ad635fa3.tar.xz
kernel-91ddf54ee4f018514af93cac252e3170ad635fa3.zip
Setup Iintial baseline based on LK3.14v0.0.init
Signed-off-by: Daniel jeong <daniel.jeong@ti.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-lp3943.txt37
-rw-r--r--Documentation/devicetree/bindings/leds/leds-lp55xx.txt222
-rw-r--r--Documentation/devicetree/bindings/mfd/lp3943.txt33
-rw-r--r--Documentation/devicetree/bindings/power_supply/lp8727_charger.txt44
-rw-r--r--Documentation/devicetree/bindings/regulator/lp872x.txt160
-rw-r--r--Documentation/devicetree/bindings/video/backlight/lp855x.txt68
-rw-r--r--Documentation/leds/leds-lm3556.txt85
-rw-r--r--Documentation/leds/leds-lp5562.txt120
-rw-r--r--Documentation/leds/leds-lp55xx.txt194
9 files changed, 963 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio-lp3943.txt b/Documentation/devicetree/bindings/gpio/gpio-lp3943.txt
new file mode 100644
index 0000000..80fcb7d
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-lp3943.txt
@@ -0,0 +1,37 @@
1TI/National Semiconductor LP3943 GPIO controller
2
3Required properties:
4 - compatible: "ti,lp3943-gpio"
5 - gpio-controller: Marks the device node as a GPIO controller.
6 - #gpio-cells: Should be 2. See gpio.txt in this directory for a
7 description of the cells format.
8
9Example:
10Simple LED controls with LP3943 GPIO controller
11
12&i2c4 {
13 lp3943@60 {
14 compatible = "ti,lp3943";
15 reg = <0x60>;
16
17 gpioex: gpio {
18 compatible = "ti,lp3943-gpio";
19 gpio-controller;
20 #gpio-cells = <2>;
21 };
22 };
23};
24
25leds {
26 compatible = "gpio-leds";
27 indicator1 {
28 label = "indi1";
29 gpios = <&gpioex 9 GPIO_ACTIVE_LOW>;
30 };
31
32 indicator2 {
33 label = "indi2";
34 gpios = <&gpioex 10 GPIO_ACTIVE_LOW>;
35 default-state = "off";
36 };
37};
diff --git a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt
new file mode 100644
index 0000000..c55b8c0
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt
@@ -0,0 +1,222 @@
1Binding for TI/National Semiconductor LP55xx Led Drivers
2
3Required properties:
4- compatible: "national,lp5521" or "national,lp5523" or "ti,lp5562" or "ti,lp8501"
5- reg: I2C slave address
6- clock-mode: Input clock mode, (0: automode, 1: internal, 2: external)
7
8Each child has own specific current settings
9- led-cur: Current setting at each led channel (mA x10, 0 if led is not connected)
10- max-cur: Maximun current at each led channel.
11
12Optional properties:
13- enable-gpio: GPIO attached to the chip's enable pin
14- label: Used for naming LEDs
15- pwr-sel: LP8501 specific property. Power selection for output channels.
16 0: D1~9 are connected to VDD
17 1: D1~6 with VDD, D7~9 with VOUT
18 2: D1~6 with VOUT, D7~9 with VDD
19 3: D1~9 are connected to VOUT
20
21Alternatively, each child can have a specific channel name and trigger:
22- chan-name (optional): name of channel
23- linux,default-trigger (optional): see
24 Documentation/devicetree/bindings/leds/common.txt
25
26example 1) LP5521
273 LED channels, external clock used. Channel names are 'lp5521_pri:channel0',
28'lp5521_pri:channel1' and 'lp5521_pri:channel2', with a heartbeat trigger
29on channel 0.
30
31lp5521@32 {
32 compatible = "national,lp5521";
33 reg = <0x32>;
34 label = "lp5521_pri";
35 clock-mode = /bits/ 8 <2>;
36
37 chan0 {
38 led-cur = /bits/ 8 <0x2f>;
39 max-cur = /bits/ 8 <0x5f>;
40 linux,default-trigger = "heartbeat";
41 };
42
43 chan1 {
44 led-cur = /bits/ 8 <0x2f>;
45 max-cur = /bits/ 8 <0x5f>;
46 };
47
48 chan2 {
49 led-cur = /bits/ 8 <0x2f>;
50 max-cur = /bits/ 8 <0x5f>;
51 };
52};
53
54example 2) LP5523
559 LED channels with specific name. Internal clock used.
56The I2C slave address is configurable with ASEL1 and ASEL0 pins.
57Available addresses are 32/33/34/35h.
58
59ASEL1 ASEL0 Address
60-------------------------
61 GND GND 32h
62 GND VEN 33h
63 VEN GND 34h
64 VEN VEN 35h
65
66lp5523@32 {
67 compatible = "national,lp5523";
68 reg = <0x32>;
69 clock-mode = /bits/ 8 <1>;
70
71 chan0 {
72 chan-name = "d1";
73 led-cur = /bits/ 8 <0x14>;
74 max-cur = /bits/ 8 <0x20>;
75 };
76
77 chan1 {
78 chan-name = "d2";
79 led-cur = /bits/ 8 <0x14>;
80 max-cur = /bits/ 8 <0x20>;
81 };
82
83 chan2 {
84 chan-name = "d3";
85 led-cur = /bits/ 8 <0x14>;
86 max-cur = /bits/ 8 <0x20>;
87 };
88
89 chan3 {
90 chan-name = "d4";
91 led-cur = /bits/ 8 <0x14>;
92 max-cur = /bits/ 8 <0x20>;
93 };
94
95 chan4 {
96 chan-name = "d5";
97 led-cur = /bits/ 8 <0x14>;
98 max-cur = /bits/ 8 <0x20>;
99 };
100
101 chan5 {
102 chan-name = "d6";
103 led-cur = /bits/ 8 <0x14>;
104 max-cur = /bits/ 8 <0x20>;
105 };
106
107 chan6 {
108 chan-name = "d7";
109 led-cur = /bits/ 8 <0x14>;
110 max-cur = /bits/ 8 <0x20>;
111 };
112
113 chan7 {
114 chan-name = "d8";
115 led-cur = /bits/ 8 <0x14>;
116 max-cur = /bits/ 8 <0x20>;
117 };
118
119 chan8 {
120 chan-name = "d9";
121 led-cur = /bits/ 8 <0x14>;
122 max-cur = /bits/ 8 <0x20>;
123 };
124};
125
126example 3) LP5562
1274 channels are defined.
128
129lp5562@30 {
130 compatible = "ti,lp5562";
131 reg = <0x30>;
132 clock-mode = /bits/8 <2>;
133
134 chan0 {
135 chan-name = "R";
136 led-cur = /bits/ 8 <0x20>;
137 max-cur = /bits/ 8 <0x60>;
138 };
139
140 chan1 {
141 chan-name = "G";
142 led-cur = /bits/ 8 <0x20>;
143 max-cur = /bits/ 8 <0x60>;
144 };
145
146 chan2 {
147 chan-name = "B";
148 led-cur = /bits/ 8 <0x20>;
149 max-cur = /bits/ 8 <0x60>;
150 };
151
152 chan3 {
153 chan-name = "W";
154 led-cur = /bits/ 8 <0x20>;
155 max-cur = /bits/ 8 <0x60>;
156 };
157};
158
159example 4) LP8501
1609 channels are defined. The 'pwr-sel' is LP8501 specific property.
161Others are same as LP5523.
162
163lp8501@32 {
164 compatible = "ti,lp8501";
165 reg = <0x32>;
166 clock-mode = /bits/ 8 <2>;
167 pwr-sel = /bits/ 8 <3>; /* D1~9 connected to VOUT */
168
169 chan0 {
170 chan-name = "d1";
171 led-cur = /bits/ 8 <0x14>;
172 max-cur = /bits/ 8 <0x20>;
173 };
174
175 chan1 {
176 chan-name = "d2";
177 led-cur = /bits/ 8 <0x14>;
178 max-cur = /bits/ 8 <0x20>;
179 };
180
181 chan2 {
182 chan-name = "d3";
183 led-cur = /bits/ 8 <0x14>;
184 max-cur = /bits/ 8 <0x20>;
185 };
186
187 chan3 {
188 chan-name = "d4";
189 led-cur = /bits/ 8 <0x14>;
190 max-cur = /bits/ 8 <0x20>;
191 };
192
193 chan4 {
194 chan-name = "d5";
195 led-cur = /bits/ 8 <0x14>;
196 max-cur = /bits/ 8 <0x20>;
197 };
198
199 chan5 {
200 chan-name = "d6";
201 led-cur = /bits/ 8 <0x14>;
202 max-cur = /bits/ 8 <0x20>;
203 };
204
205 chan6 {
206 chan-name = "d7";
207 led-cur = /bits/ 8 <0x14>;
208 max-cur = /bits/ 8 <0x20>;
209 };
210
211 chan7 {
212 chan-name = "d8";
213 led-cur = /bits/ 8 <0x14>;
214 max-cur = /bits/ 8 <0x20>;
215 };
216
217 chan8 {
218 chan-name = "d9";
219 led-cur = /bits/ 8 <0x14>;
220 max-cur = /bits/ 8 <0x20>;
221 };
222};
diff --git a/Documentation/devicetree/bindings/mfd/lp3943.txt b/Documentation/devicetree/bindings/mfd/lp3943.txt
new file mode 100644
index 0000000..e8591d6
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/lp3943.txt
@@ -0,0 +1,33 @@
1TI/National Semiconductor LP3943 MFD driver
2
3Required properties:
4 - compatible: "ti,lp3943"
5 - reg: I2C slave address. From 0x60 to 0x67.
6
7LP3943 consists of two sub-devices, lp3943-gpio and lp3943-pwm.
8
9For the LP3943 GPIO properties please refer to:
10Documentation/devicetree/bindings/gpio/gpio-lp3943.txt
11
12For the LP3943 PWM properties please refer to:
13Documentation/devicetree/bindings/pwm/pwm-lp3943.txt
14
15Example:
16
17lp3943@60 {
18 compatible = "ti,lp3943";
19 reg = <0x60>;
20
21 gpioex: gpio {
22 compatible = "ti,lp3943-gpio";
23 gpio-controller;
24 #gpio-cells = <2>;
25 };
26
27 pwm3943: pwm {
28 compatible = "ti,lp3943-pwm";
29 #pwm-cells = <2>;
30 ti,pwm0 = <8 9 10>;
31 ti,pwm1 = <15>;
32 };
33};
diff --git a/Documentation/devicetree/bindings/power_supply/lp8727_charger.txt b/Documentation/devicetree/bindings/power_supply/lp8727_charger.txt
new file mode 100644
index 0000000..2246bc5
--- /dev/null
+++ b/Documentation/devicetree/bindings/power_supply/lp8727_charger.txt
@@ -0,0 +1,44 @@
1Binding for TI/National Semiconductor LP8727 Charger
2
3Required properties:
4- compatible: "ti,lp8727"
5- reg: I2C slave address 27h
6
7Optional properties:
8- interrupt-parent: interrupt controller node (see interrupt binding[0])
9- interrupts: interrupt specifier (see interrupt binding[0])
10- debounce-ms: interrupt debounce time. (u32)
11
12AC and USB charging parameters
13- charger-type: "ac" or "usb" (string)
14- eoc-level: value of 'enum lp8727_eoc_level' (u8)
15- charging-current: value of 'enum lp8727_ichg' (u8)
16
17[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
18
19Example)
20
21lp8727@27 {
22 compatible = "ti,lp8727";
23 reg = <0x27>;
24
25 /* GPIO 134 is used for LP8728 interrupt pin */
26 interrupt-parent = <&gpio5>; /* base = 128 */
27 interrupts = <6 0x2>; /* offset = 6, falling edge type */
28
29 debounce-ms = <300>;
30
31 /* AC charger: 5% EOC and 500mA charging current */
32 ac {
33 charger-type = "ac";
34 eoc-level = /bits/ 8 <0>;
35 charging-current = /bits/ 8 <4>;
36 };
37
38 /* USB charger: 10% EOC and 400mA charging current */
39 usb {
40 charger-type = "usb";
41 eoc-level = /bits/ 8 <1>;
42 charging-current = /bits/ 8 <2>;
43 };
44};
diff --git a/Documentation/devicetree/bindings/regulator/lp872x.txt b/Documentation/devicetree/bindings/regulator/lp872x.txt
new file mode 100644
index 0000000..7818318
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/lp872x.txt
@@ -0,0 +1,160 @@
1Binding for TI/National Semiconductor LP872x Driver
2
3Required properties:
4 - compatible: "ti,lp8720" or "ti,lp8725"
5 - reg: I2C slave address. 0x7d = LP8720, 0x7a = LP8725
6
7Optional properties:
8 - ti,general-config: the value of LP872X_GENERAL_CFG register (u8)
9 (LP8720)
10 bit[2]: BUCK output voltage control by external DVS pin or register
11 1 = external pin, 0 = bit7 of register 08h
12 bit[1]: sleep control by external DVS pin or register
13 1 = external pin, 0 = bit6 of register 08h
14 bit[0]: time step unit(usec). 1 = 25, 0 = 50
15
16 (LP8725)
17 bit[7:6]: time step unit(usec). 00 = 32, 01 = 64, 10 = 128, 11 = 256
18 bit[4]: BUCK2 enable control. 1 = enable, 0 = disable
19 bit[3]: BUCK2 output voltage register address. 1 = 0Ah, 0 = 0Bh
20 bit[2]: BUCK1 output voltage control by external DVS pin or register
21 1 = register 08h, 0 = DVS
22 bit[1]: LDO sleep control. 1 = sleep mode, 0 = normal
23 bit[0]: BUCK1 enable control, 1 = enable, 0 = disable
24
25 For more details, please see the datasheet.
26
27 - ti,update-config: define it when LP872X_GENERAL_CFG register should be set
28 - ti,dvs-gpio: GPIO specifier for external DVS pin control of LP872x devices.
29 - ti,dvs-vsel: DVS selector. 0 = SEL_V1, 1 = SEL_V2.
30 - ti,dvs-state: initial DVS pin state. 0 = DVS_LOW, 1 = DVS_HIGH.
31
32 Sub nodes for regulator_init_data
33 LP8720 has maximum 6 nodes. (child name: ldo1 ~ 5 and buck)
34 LP8725 has maximum 9 nodes. (child name: ldo1 ~ 5, lilo1,2 and buck1,2)
35 For more details, please see the following binding document.
36 (Documentation/devicetree/bindings/regulator/regulator.txt)
37
38Datasheet
39 - LP8720: http://www.ti.com/lit/ds/symlink/lp8720.pdf
40 - LP8725: http://www.ti.com/lit/ds/symlink/lp8725.pdf
41
42Example 1) LP8720
43
44lp8720@7d {
45 compatible = "ti,lp8720";
46 reg = <0x7d>;
47
48 /* external DVS pin used, timestep is 25usec */
49 ti,general-config = /bits/ 8 <0x03>;
50 ti,update-config;
51
52 /*
53 * The dvs-gpio depends on the processor environment.
54 * For example, following GPIO specifier means GPIO134 in OMAP4.
55 */
56 ti,dvs-gpio = <&gpio5 6 0>;
57 ti,dvs-vsel = /bits/ 8 <1>; /* SEL_V2 */
58 ti,dvs-state = /bits/ 8 <1>; /* DVS_HIGH */
59
60 vaf: ldo1 {
61 regulator-min-microvolt = <1200000>;
62 regulator-max-microvolt = <3300000>;
63 };
64
65 vmmc: ldo2 {
66 regulator-min-microvolt = <1200000>;
67 regulator-max-microvolt = <3300000>;
68 };
69
70 vcam_io: ldo3 {
71 regulator-min-microvolt = <1200000>;
72 regulator-max-microvolt = <3300000>;
73 regulator-boot-on;
74 };
75
76 vcam_core: ldo4 {
77 regulator-min-microvolt = <800000>;
78 regulator-max-microvolt = <2850000>;
79 regulator-boot-on;
80 };
81
82 vcam: ldo5 {
83 regulator-min-microvolt = <1200000>;
84 regulator-max-microvolt = <3300000>;
85 };
86
87 vcc: buck {
88 regulator-name = "VBUCK";
89 regulator-min-microvolt = <800000>;
90 regulator-max-microvolt = <2300000>;
91 };
92};
93
94Example 2) LP8725
95
96lp8725@7a {
97 compatible = "ti,lp8725";
98 reg = <0x7a>;
99
100 /* Enable BUCK1,2, no DVS, normal LDO mode, timestep is 256usec */
101 ti,general-config = /bits/ 8 <0xdd>;
102 ti,update-config;
103
104 vcam_io: ldo1 {
105 regulator-min-microvolt = <1200000>;
106 regulator-max-microvolt = <3300000>;
107 };
108
109 vcam_core: ldo2 {
110 regulator-min-microvolt = <1200000>;
111 regulator-max-microvolt = <3300000>;
112 };
113
114 vcam: ldo3 {
115 regulator-min-microvolt = <1200000>;
116 regulator-max-microvolt = <3300000>;
117 };
118
119 vcmmb_io: ldo4 {
120 regulator-min-microvolt = <1200000>;
121 regulator-max-microvolt = <3300000>;
122 regulator-boot-on;
123 };
124
125 vcmmb_core: ldo5 {
126 regulator-min-microvolt = <1200000>;
127 regulator-max-microvolt = <3300000>;
128 regulator-boot-on;
129 };
130
131 vaux1: lilo1 {
132 regulator-name = "VAUX1";
133 regulator-min-microvolt = <800000>;
134 regulator-max-microvolt = <3300000>;
135 };
136
137 vaux2: lilo2 {
138 regulator-name = "VAUX2";
139 regulator-min-microvolt = <800000>;
140 regulator-max-microvolt = <3300000>;
141 };
142
143 vcc1: buck1 {
144 regulator-name = "VBUCK1";
145 regulator-min-microvolt = <800000>;
146 regulator-max-microvolt = <3000000>;
147 regulator-min-microamp = <460000>;
148 regulator-max-microamp = <1370000>;
149 regulator-boot-on;
150 };
151
152 vcc2: buck2 {
153 regulator-name = "VBUCK2";
154 regulator-min-microvolt = <800000>;
155 regulator-max-microvolt = <3000000>;
156 regulator-min-microamp = <460000>;
157 regulator-max-microamp = <1370000>;
158 regulator-boot-on;
159 };
160};
diff --git a/Documentation/devicetree/bindings/video/backlight/lp855x.txt b/Documentation/devicetree/bindings/video/backlight/lp855x.txt
new file mode 100644
index 0000000..96e83a5
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/backlight/lp855x.txt
@@ -0,0 +1,68 @@
1lp855x bindings
2
3Required properties:
4 - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553",
5 "ti,lp8555", "ti,lp8556", "ti,lp8557"
6 - reg: I2C slave address (u8)
7 - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device.
8
9Optional properties:
10 - bl-name: Backlight device name (string)
11 - init-brt: Initial value of backlight brightness (u8)
12 - pwm-period: PWM period value. Set only PWM input mode used (u32)
13 - rom-addr: Register address of ROM area to be updated (u8)
14 - rom-val: Register value to be updated (u8)
15
16Example:
17
18 /* LP8555 */
19 backlight@2c {
20 compatible = "ti,lp8555";
21 reg = <0x2c>;
22
23 dev-ctrl = /bits/ 8 <0x00>;
24 pwm-period = <10000>;
25
26 /* 4V OV, 4 output LED0 string enabled */
27 rom_14h {
28 rom-addr = /bits/ 8 <0x14>;
29 rom-val = /bits/ 8 <0xcf>;
30 };
31
32 /* Heavy smoothing, 24ms ramp time step */
33 rom_15h {
34 rom-addr = /bits/ 8 <0x15>;
35 rom-val = /bits/ 8 <0xc7>;
36 };
37
38 /* 4 output LED1 string enabled */
39 rom_19h {
40 rom-addr = /bits/ 8 <0x19>;
41 rom-val = /bits/ 8 <0x0f>;
42 };
43 };
44
45 /* LP8556 */
46 backlight@2c {
47 compatible = "ti,lp8556";
48 reg = <0x2c>;
49
50 bl-name = "lcd-bl";
51 dev-ctrl = /bits/ 8 <0x85>;
52 init-brt = /bits/ 8 <0x10>;
53 };
54
55 /* LP8557 */
56 backlight@2c {
57 compatible = "ti,lp8557";
58 reg = <0x2c>;
59
60 dev-ctrl = /bits/ 8 <0x41>;
61 init-brt = /bits/ 8 <0x0a>;
62
63 /* 4V OV, 4 output LED string enabled */
64 rom_14h {
65 rom-addr = /bits/ 8 <0x14>;
66 rom-val = /bits/ 8 <0xcf>;
67 };
68 };
diff --git a/Documentation/leds/leds-lm3556.txt b/Documentation/leds/leds-lm3556.txt
new file mode 100644
index 0000000..62278e8
--- /dev/null
+++ b/Documentation/leds/leds-lm3556.txt
@@ -0,0 +1,85 @@
1Kernel driver for lm3556
2========================
3
4*Texas Instrument:
5 1.5 A Synchronous Boost LED Flash Driver w/ High-Side Current Source
6* Datasheet: http://www.national.com/ds/LM/LM3556.pdf
7
8Authors:
9 Daniel Jeong
10 Contact:Daniel Jeong(daniel.jeong-at-ti.com, gshark.jeong-at-gmail.com)
11
12Description
13-----------
14There are 3 functions in LM3556, Flash, Torch and Indicator.
15
16FLASH MODE
17In Flash Mode, the LED current source(LED) provides 16 target current levels
18from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT
19CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A),
20or by pulling the STROBE pin HIGH.
21LM3556 Flash can be controlled through sys/class/leds/flash/brightness file
22* if STROBE pin is enabled, below example control brightness only, and
23ON / OFF will be controlled by STROBE pin.
24
25Flash Example:
26OFF : #echo 0 > sys/class/leds/flash/brightness
2793.75 mA: #echo 1 > sys/class/leds/flash/brightness
28... .....
291500 mA: #echo 16 > sys/class/leds/flash/brightness
30
31TORCH MODE
32In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL
33REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the
34hardware TORCH input.
35LM3556 torch can be controlled through sys/class/leds/torch/brightness file.
36* if TORCH pin is enabled, below example control brightness only,
37and ON / OFF will be controlled by TORCH pin.
38
39Torch Example:
40OFF : #echo 0 > sys/class/leds/torch/brightness
4146.88 mA: #echo 1 > sys/class/leds/torch/brightness
42... .....
43375 mA : #echo 8 > sys/class/leds/torch/brightness
44
45INDICATOR MODE
46Indicator pattern can be set through sys/class/leds/indicator/pattern file,
47and 4 patterns are pre-defined in indicator_pattern array.
48According to N-lank, Pulse time and N Period values, different pattern wiill
49be generated.If you want new patterns for your own device, change
50indicator_pattern array with your own values and INDIC_PATTERN_SIZE.
51Please refer datasheet for more detail about N-Blank, Pulse time and N Period.
52
53Indicator pattern example:
54pattern 0: #echo 0 > sys/class/leds/indicator/pattern
55....
56pattern 3: #echo 3 > sys/class/leds/indicator/pattern
57
58Indicator brightness can be controlled through
59sys/class/leds/indicator/brightness file.
60
61Example:
62OFF : #echo 0 > sys/class/leds/indicator/brightness
635.86 mA : #echo 1 > sys/class/leds/indicator/brightness
64........
6546.875mA : #echo 8 > sys/class/leds/indicator/brightness
66
67Notes
68-----
69Driver expects it is registered using the i2c_board_info mechanism.
70To register the chip at address 0x63 on specific adapter, set the platform data
71according to include/linux/platform_data/leds-lm3556.h, set the i2c board info
72
73Example:
74 static struct i2c_board_info board_i2c_ch4[] __initdata = {
75 {
76 I2C_BOARD_INFO(LM3556_NAME, 0x63),
77 .platform_data = &lm3556_pdata,
78 },
79 };
80
81and register it in the platform init function
82
83Example:
84 board_register_i2c_bus(4, 400,
85 board_i2c_ch4, ARRAY_SIZE(board_i2c_ch4));
diff --git a/Documentation/leds/leds-lp5562.txt b/Documentation/leds/leds-lp5562.txt
new file mode 100644
index 0000000..5a823ff
--- /dev/null
+++ b/Documentation/leds/leds-lp5562.txt
@@ -0,0 +1,120 @@
1Kernel driver for LP5562
2========================
3
4* TI LP5562 LED Driver
5
6Author: Milo(Woogyom) Kim <milo.kim@ti.com>
7
8Description
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
17Device 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
33How 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
56How to load the predefined patterns
57
58 Please refer to 'leds-lp55xx.txt"
59
60Setting 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
67To configure the platform specific data, lp55xx_platform_data structure is used.
68
69static 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
96static int lp5562_setup(void)
97{
98 /* setup HW resources */
99}
100
101static void lp5562_release(void)
102{
103 /* Release HW resources */
104}
105
106static void lp5562_enable(bool state)
107{
108 /* Control of chip enable signal */
109}
110
111static 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
119If the current is set to 0 in the platform data, that channel is
120disabled and it is not visible in the sysfs.
diff --git a/Documentation/leds/leds-lp55xx.txt b/Documentation/leds/leds-lp55xx.txt
new file mode 100644
index 0000000..bcea12a
--- /dev/null
+++ b/Documentation/leds/leds-lp55xx.txt
@@ -0,0 +1,194 @@
1LP5521/LP5523/LP55231/LP5562/LP8501 Common Driver
2=================================================
3
4Authors: Milo(Woogyom) Kim <milo.kim@ti.com>
5
6Description
7-----------
8LP5521, LP5523/55231, LP5562 and LP8501 have common features as below.
9
10 Register access via the I2C
11 Device initialization/deinitialization
12 Create LED class devices for multiple output channels
13 Device attributes for user-space interface
14 Program memory for running LED patterns
15
16The LP55xx common driver provides these features using exported functions.
17 lp55xx_init_device() / lp55xx_deinit_device()
18 lp55xx_register_leds() / lp55xx_unregister_leds()
19 lp55xx_regsister_sysfs() / lp55xx_unregister_sysfs()
20
21( Driver Structure Data )
22
23In lp55xx common driver, two different data structure is used.
24
25o lp55xx_led
26 control multi output LED channels such as led current, channel index.
27o lp55xx_chip
28 general chip control such like the I2C and platform data.
29
30For example, LP5521 has maximum 3 LED channels.
31LP5523/55231 has 9 output channels.
32
33lp55xx_chip for LP5521 ... lp55xx_led #1
34 lp55xx_led #2
35 lp55xx_led #3
36
37lp55xx_chip for LP5523 ... lp55xx_led #1
38 lp55xx_led #2
39 .
40 .
41 lp55xx_led #9
42
43( Chip Dependent Code )
44
45To support device specific configurations, special structure
46'lpxx_device_config' is used.
47
48 Maximum number of channels
49 Reset command, chip enable command
50 Chip specific initialization
51 Brightness control register access
52 Setting LED output current
53 Program memory address access for running patterns
54 Additional device specific attributes
55
56( Firmware Interface )
57
58LP55xx family devices have the internal program memory for running
59various LED patterns.
60This pattern data is saved as a file in the user-land or
61hex byte string is written into the memory through the I2C.
62LP55xx common driver supports the firmware interface.
63
64LP55xx chips have three program engines.
65To load and run the pattern, the programming sequence is following.
66 (1) Select an engine number (1/2/3)
67 (2) Mode change to load
68 (3) Write pattern data into selected area
69 (4) Mode change to run
70
71The LP55xx common driver provides simple interfaces as below.
72select_engine : Select which engine is used for running program
73run_engine : Start program which is loaded via the firmware interface
74firmware : Load program data
75
76In case of LP5523, one more command is required, 'enginex_leds'.
77It is used for selecting LED output(s) at each engine number.
78In more details, please refer to 'leds-lp5523.txt'.
79
80For example, run blinking pattern in engine #1 of LP5521
81echo 1 > /sys/bus/i2c/devices/xxxx/select_engine
82echo 1 > /sys/class/firmware/lp5521/loading
83echo "4000600040FF6000" > /sys/class/firmware/lp5521/data
84echo 0 > /sys/class/firmware/lp5521/loading
85echo 1 > /sys/bus/i2c/devices/xxxx/run_engine
86
87For example, run blinking pattern in engine #3 of LP55231
88Two LEDs are configured as pattern output channels.
89echo 3 > /sys/bus/i2c/devices/xxxx/select_engine
90echo 1 > /sys/class/firmware/lp55231/loading
91echo "9d0740ff7e0040007e00a0010000" > /sys/class/firmware/lp55231/data
92echo 0 > /sys/class/firmware/lp55231/loading
93echo "000001100" > /sys/bus/i2c/devices/xxxx/engine3_leds
94echo 1 > /sys/bus/i2c/devices/xxxx/run_engine
95
96To start blinking patterns in engine #2 and #3 simultaneously,
97for idx in 2 3
98do
99 echo $idx > /sys/class/leds/red/device/select_engine
100 sleep 0.1
101 echo 1 > /sys/class/firmware/lp5521/loading
102 echo "4000600040FF6000" > /sys/class/firmware/lp5521/data
103 echo 0 > /sys/class/firmware/lp5521/loading
104done
105echo 1 > /sys/class/leds/red/device/run_engine
106
107Here is another example for LP5523.
108Full LED strings are selected by 'engine2_leds'.
109echo 2 > /sys/bus/i2c/devices/xxxx/select_engine
110echo 1 > /sys/class/firmware/lp5523/loading
111echo "9d80400004ff05ff437f0000" > /sys/class/firmware/lp5523/data
112echo 0 > /sys/class/firmware/lp5523/loading
113echo "111111111" > /sys/bus/i2c/devices/xxxx/engine2_leds
114echo 1 > /sys/bus/i2c/devices/xxxx/run_engine
115
116As soon as 'loading' is set to 0, registered callback is called.
117Inside the callback, the selected engine is loaded and memory is updated.
118To run programmed pattern, 'run_engine' attribute should be enabled.
119
120The pattern sqeuence of LP8501 is similar to LP5523.
121However pattern data is specific.
122Ex 1) Engine 1 is used
123echo 1 > /sys/bus/i2c/devices/xxxx/select_engine
124echo 1 > /sys/class/firmware/lp8501/loading
125echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data
126echo 0 > /sys/class/firmware/lp8501/loading
127echo 1 > /sys/bus/i2c/devices/xxxx/run_engine
128
129Ex 2) Engine 2 and 3 are used at the same time
130echo 2 > /sys/bus/i2c/devices/xxxx/select_engine
131sleep 1
132echo 1 > /sys/class/firmware/lp8501/loading
133echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data
134echo 0 > /sys/class/firmware/lp8501/loading
135sleep 1
136echo 3 > /sys/bus/i2c/devices/xxxx/select_engine
137sleep 1
138echo 1 > /sys/class/firmware/lp8501/loading
139echo "9d0340ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data
140echo 0 > /sys/class/firmware/lp8501/loading
141sleep 1
142echo 1 > /sys/class/leds/d1/device/run_engine
143
144( 'run_engine' and 'firmware_cb' )
145The sequence of running the program data is common.
146But each device has own specific register addresses for commands.
147To support this, 'run_engine' and 'firmware_cb' are configurable in each driver.
148run_engine : Control the selected engine
149firmware_cb : The callback function after loading the firmware is done.
150 Chip specific commands for loading and updating program memory.
151
152( Predefined pattern data )
153
154Without the firmware interface, LP55xx driver provides another method for
155loading a LED pattern. That is 'predefined' pattern.
156A predefined pattern is defined in the platform data and load it(or them)
157via the sysfs if needed.
158To use the predefined pattern concept, 'patterns' and 'num_patterns' should be
159configured.
160
161 Example of predefined pattern data:
162
163 /* mode_1: blinking data */
164 static const u8 mode_1[] = {
165 0x40, 0x00, 0x60, 0x00, 0x40, 0xFF, 0x60, 0x00,
166 };
167
168 /* mode_2: always on */
169 static const u8 mode_2[] = { 0x40, 0xFF, };
170
171 struct lp55xx_predef_pattern board_led_patterns[] = {
172 {
173 .r = mode_1,
174 .size_r = ARRAY_SIZE(mode_1),
175 },
176 {
177 .b = mode_2,
178 .size_b = ARRAY_SIZE(mode_2),
179 },
180 }
181
182 struct lp55xx_platform_data lp5562_pdata = {
183 ...
184 .patterns = board_led_patterns,
185 .num_patterns = ARRAY_SIZE(board_led_patterns),
186 };
187
188Then, mode_1 and mode_2 can be run via through the sysfs.
189
190 echo 1 > /sys/bus/i2c/devices/xxxx/led_pattern # red blinking LED pattern
191 echo 2 > /sys/bus/i2c/devices/xxxx/led_pattern # blue LED always on
192
193To stop running pattern,
194 echo 0 > /sys/bus/i2c/devices/xxxx/led_pattern