Skip to content

Commit 25529ed

Browse files
Merge tag 'ti-lmu-led-drivers' into for-next
Merge immutable branch between LEDs, MFD and REGULATOR due to TI LMU LED support rework and introduction of two new drivers with DT bindings. * tag 'ti-lmu-led-drivers': leds: lm36274: Introduce the TI LM36274 LED driver dt-bindings: leds: Add LED bindings for the LM36274 regulator: lm363x: Add support for LM36274 mfd: ti-lmu: Add LM36274 support to the ti-lmu dt-bindings: mfd: Add lm36274 bindings to ti-lmu leds: lm3697: Introduce the lm3697 driver mfd: ti-lmu: Remove support for LM3697 dt-bindings: ti-lmu: Modify dt bindings for the LM3697 leds: TI LMU: Add common code for TI LMU devices dt-bindings: mfd: LMU: Add ti,brightness-resolution dt-bindings: mfd: LMU: Add the ramp up/down property
2 parents 09bfa5f + 11e1bbc commit 25529ed

15 files changed

Lines changed: 1135 additions & 85 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
* Texas Instruments LM36274 4-Channel LCD Backlight Driver w/Integrated Bias
2+
3+
The LM36274 is an integrated four-channel WLED driver and LCD bias supply.
4+
The backlight boost provides the power to bias four parallel LED strings with
5+
up to 29V total output voltage. The 11-bit LED current is programmable via
6+
the I2C bus and/or controlled via a logic level PWM input from 60 uA to 30 mA.
7+
8+
Parent device properties are documented in
9+
Documentation/devicetree/bindings/mfd/ti_lmu.txt
10+
11+
Regulator properties are documented in
12+
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
13+
14+
Required backlight properties:
15+
- compatible:
16+
"ti,lm36274-backlight"
17+
- reg : 0
18+
- #address-cells : 1
19+
- #size-cells : 0
20+
- led-sources : Indicates which LED strings will be enabled.
21+
Values from 0-3, sources is 0 based so strings will be
22+
source value + 1.
23+
24+
Optional backlight properties:
25+
- label : see Documentation/devicetree/bindings/leds/common.txt
26+
- linux,default-trigger :
27+
see Documentation/devicetree/bindings/leds/common.txt
28+
29+
Example:
30+
31+
HVLED string 1 and 3 are controlled by control bank A and HVLED 2 string is
32+
controlled by control bank B.
33+
34+
lm36274@11 {
35+
compatible = "ti,lm36274";
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
reg = <0x11>;
39+
40+
enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
41+
42+
regulators {
43+
#address-cells = <1>;
44+
#size-cells = <0>;
45+
compatible = "ti,lm363x-regulator";
46+
47+
enable-gpios = <&pioC 0 GPIO_ACTIVE_HIGH>,
48+
<&pioC 1 GPIO_ACTIVE_HIGH>;
49+
50+
vboost {
51+
regulator-name = "lcd_boost";
52+
regulator-min-microvolt = <4000000>;
53+
regulator-max-microvolt = <7150000>;
54+
regulator-always-on;
55+
};
56+
57+
vpos {
58+
regulator-name = "lcd_vpos";
59+
regulator-min-microvolt = <4000000>;
60+
regulator-max-microvolt = <6500000>;
61+
};
62+
63+
vneg {
64+
regulator-name = "lcd_vneg";
65+
regulator-min-microvolt = <4000000>;
66+
regulator-max-microvolt = <6500000>;
67+
};
68+
};
69+
70+
backlight {
71+
#address-cells = <1>;
72+
#size-cells = <0>;
73+
compatible = "ti,lm36274-backlight";
74+
75+
led@0 {
76+
reg = <0>;
77+
led-sources = <0 2>;
78+
label = "white:backlight_cluster";
79+
linux,default-trigger = "backlight";
80+
};
81+
};
82+
};
83+
84+
For more product information please see the link below:
85+
http://www.ti.com/lit/ds/symlink/lm36274.pdf
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
* Texas Instruments - LM3697 Highly Efficient White LED Driver
2+
3+
The LM3697 11-bit LED driver provides high-
4+
performance backlight dimming for 1, 2, or 3 series
5+
LED strings while delivering up to 90% efficiency.
6+
7+
This device is suitable for display and keypad lighting
8+
9+
Required properties:
10+
- compatible:
11+
"ti,lm3697"
12+
- reg : I2C slave address
13+
- #address-cells : 1
14+
- #size-cells : 0
15+
16+
Optional properties:
17+
- enable-gpios : GPIO pin to enable/disable the device
18+
- vled-supply : LED supply
19+
20+
Required child properties:
21+
- reg : 0 - LED is Controlled by bank A
22+
1 - LED is Controlled by bank B
23+
- led-sources : Indicates which HVLED string is associated to which
24+
control bank. This is a zero based property so
25+
HVLED1 = 0, HVLED2 = 1, HVLED3 = 2.
26+
Additional information is contained
27+
in Documentation/devicetree/bindings/leds/common.txt
28+
29+
Optional child properties:
30+
- ti,brightness-resolution - see Documentation/devicetree/bindings/mfd/ti-lmu.txt
31+
- ramp-up-us: see Documentation/devicetree/bindings/mfd/ti-lmu.txt
32+
- ramp-down-us: see Documentation/devicetree/bindings/mfd/ti-lmu.txt
33+
- label : see Documentation/devicetree/bindings/leds/common.txt
34+
- linux,default-trigger :
35+
see Documentation/devicetree/bindings/leds/common.txt
36+
37+
Example:
38+
39+
HVLED string 1 and 3 are controlled by control bank A and HVLED 2 string is
40+
controlled by control bank B.
41+
42+
led-controller@36 {
43+
compatible = "ti,lm3697";
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
reg = <0x36>;
47+
48+
enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
49+
vled-supply = <&vbatt>;
50+
51+
led@0 {
52+
reg = <0>;
53+
led-sources = <0 2>;
54+
ti,brightness-resolution = <2047>;
55+
ramp-up-us = <5000>;
56+
ramp-down-us = <1000>;
57+
label = "white:first_backlight_cluster";
58+
linux,default-trigger = "backlight";
59+
};
60+
61+
led@1 {
62+
reg = <1>;
63+
led-sources = <1>;
64+
ti,brightness-resolution = <255>;
65+
ramp-up-us = <500>;
66+
ramp-down-us = <1000>;
67+
label = "white:second_backlight_cluster";
68+
linux,default-trigger = "backlight";
69+
};
70+
}
71+
72+
For more product information please see the link below:
73+
http://www.ti.com/lit/ds/symlink/lm3697.pdf

‎Documentation/devicetree/bindings/mfd/ti-lmu.txt‎

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,40 @@ TI LMU driver supports lighting devices below.
88
LM3632 Backlight and regulator
99
LM3633 Backlight, LED and fault monitor
1010
LM3695 Backlight
11-
LM3697 Backlight and fault monitor
11+
LM36274 Backlight and regulator
1212

1313
Required properties:
1414
- compatible: Should be one of:
1515
"ti,lm3631"
1616
"ti,lm3632"
1717
"ti,lm3633"
1818
"ti,lm3695"
19-
"ti,lm3697"
19+
"ti,lm36274"
2020
- reg: I2C slave address.
2121
0x11 for LM3632
2222
0x29 for LM3631
23-
0x36 for LM3633, LM3697
23+
0x36 for LM3633
2424
0x63 for LM3695
25+
0x11 for LM36274
2526

26-
Optional property:
27+
Optional properties:
2728
- enable-gpios: A GPIO specifier for hardware enable pin.
29+
- ramp-up-us: Current ramping from one brightness level to
30+
the a higher brightness level.
31+
Range from 2048 us - 117.44 s
32+
- ramp-down-us: Current ramping from one brightness level to
33+
the a lower brightness level.
34+
Range from 2048 us - 117.44 s
35+
- ti,brightness-resolution - This determines whether to use 8 bit brightness
36+
mode or 11 bit brightness mode. If this value is
37+
not set the device is defaulted to the preferred
38+
8bit brightness mode per 7.3.4.1 of the data
39+
sheet. This setting can either be in the parent
40+
node or as part of the LED child nodes. This
41+
is determined by the part itself if the strings
42+
have a common brightness register or individual
43+
brightness registers.
44+
The values are 255 (8bit) or 2047 (11bit).
2845

2946
Required node:
3047
- backlight: All LMU devices have backlight child nodes.
@@ -35,14 +52,15 @@ Optional nodes:
3552
Required properties:
3653
- compatible: Should be one of:
3754
"ti,lm3633-fault-monitor"
38-
"ti,lm3697-fault-monitor"
3955
- leds: LED properties for LM3633. Please refer to [2].
56+
LED properties for LM36274. Please refer to [4].
4057
- regulators: Regulator properties for LM3631 and LM3632.
4158
Please refer to [3].
4259

4360
[1] ../leds/backlight/ti-lmu-backlight.txt
4461
[2] ../leds/leds-lm3633.txt
4562
[3] ../regulator/lm363x-regulator.txt
63+
[4] ../leds/leds-lm36274.txt
4664

4765
lm3631@29 {
4866
compatible = "ti,lm3631";
@@ -90,7 +108,7 @@ lm3631@29 {
90108

91109
lcd_bl {
92110
led-sources = <0 1>;
93-
ramp-up-msec = <300>;
111+
ramp-up-us = <300000>;
94112
};
95113
};
96114
};
@@ -152,15 +170,15 @@ lm3633@36 {
152170
main {
153171
label = "main_lcd";
154172
led-sources = <1 2>;
155-
ramp-up-msec = <500>;
156-
ramp-down-msec = <500>;
173+
ramp-up-us = <500000>;
174+
ramp-down-us = <500000>;
157175
};
158176

159177
front {
160178
label = "front_lcd";
161179
led-sources = <0>;
162-
ramp-up-msec = <1000>;
163-
ramp-down-msec = <0>;
180+
ramp-up-us = <1000000>;
181+
ramp-down-us = <0>;
164182
};
165183
};
166184

@@ -201,23 +219,51 @@ lm3695@63 {
201219
};
202220
};
203221

204-
lm3697@36 {
205-
compatible = "ti,lm3697";
206-
reg = <0x36>;
222+
lm36274@11 {
223+
compatible = "ti,lm36274";
224+
#address-cells = <1>;
225+
#size-cells = <0>;
226+
reg = <0x11>;
207227

208228
enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
229+
regulators {
230+
#address-cells = <1>;
231+
#size-cells = <0>;
232+
compatible = "ti,lm363x-regulator";
209233

210-
backlight {
211-
compatible = "ti,lm3697-backlight";
234+
enable-gpios = <&pioC 0 GPIO_ACTIVE_HIGH>,
235+
<&pioC 1 GPIO_ACTIVE_HIGH>;
212236

213-
lcd {
214-
led-sources = <0 1 2>;
215-
ramp-up-msec = <200>;
216-
ramp-down-msec = <200>;
237+
vboost {
238+
regulator-name = "lcd_boost";
239+
regulator-min-microvolt = <4000000>;
240+
regulator-max-microvolt = <7150000>;
241+
regulator-always-on;
242+
};
243+
244+
vpos {
245+
regulator-name = "lcd_vpos";
246+
regulator-min-microvolt = <4000000>;
247+
regulator-max-microvolt = <6500000>;
248+
};
249+
250+
vneg {
251+
regulator-name = "lcd_vneg";
252+
regulator-min-microvolt = <4000000>;
253+
regulator-max-microvolt = <6500000>;
217254
};
218255
};
219256

220-
fault-monitor {
221-
compatible = "ti,lm3697-fault-monitor";
257+
backlight {
258+
#address-cells = <1>;
259+
#size-cells = <0>;
260+
compatible = "ti,lm36274-backlight";
261+
262+
led@0 {
263+
reg = <0>;
264+
led-sources = <0 2>;
265+
label = "white:backlight_cluster";
266+
linux,default-trigger = "backlight";
267+
};
222268
};
223269
};

‎drivers/leds/Kconfig‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,31 @@ config LEDS_SPI_BYTE
793793
for controlling the brightness. Currently the following controller is
794794
supported: Ubiquiti airCube ISP microcontroller based LED controller.
795795

796+
config LEDS_TI_LMU_COMMON
797+
tristate "LED driver for TI LMU"
798+
depends on LEDS_CLASS
799+
depends on REGMAP
800+
help
801+
Say Y to enable the LED driver for TI LMU devices.
802+
This supports common features between the TI LM3532, LM3631, LM3632,
803+
LM3633, LM3695 and LM3697.
804+
805+
config LEDS_LM3697
806+
tristate "LED driver for LM3697"
807+
depends on LEDS_TI_LMU_COMMON
808+
depends on I2C && OF
809+
help
810+
Say Y to enable the LM3697 LED driver for TI LMU devices.
811+
This supports the LED device LM3697.
812+
813+
config LEDS_LM36274
814+
tristate "LED driver for LM36274"
815+
depends on LEDS_TI_LMU_COMMON
816+
depends on MFD_TI_LMU
817+
help
818+
Say Y to enable the LM36274 LED driver for TI LMU devices.
819+
This supports the LED device LM36274.
820+
796821
comment "LED Triggers"
797822
source "drivers/leds/trigger/Kconfig"
798823

‎drivers/leds/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ obj-$(CONFIG_LEDS_MT6323) += leds-mt6323.o
8282
obj-$(CONFIG_LEDS_LM3692X) += leds-lm3692x.o
8383
obj-$(CONFIG_LEDS_SC27XX_BLTC) += leds-sc27xx-bltc.o
8484
obj-$(CONFIG_LEDS_LM3601X) += leds-lm3601x.o
85+
obj-$(CONFIG_LEDS_TI_LMU_COMMON) += leds-ti-lmu-common.o
86+
obj-$(CONFIG_LEDS_LM3697) += leds-lm3697.o
87+
obj-$(CONFIG_LEDS_LM36274) += leds-lm36274.o
8588

8689
# LED SPI Drivers
8790
obj-$(CONFIG_LEDS_CR0014114) += leds-cr0014114.o

0 commit comments

Comments
 (0)