Skip to content

Commit 0a8d6c9

Browse files
committed
Merge tag 'backlight-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones: "New Functionality: - Add lots of Device Tree bindings / support - Turn off LED strings when display is blank - Switch I2C drivers from .probe_new() to .probe() - Remove superfluous NULL checks - Only obtain PWM information once and do it in .probe() Fix-ups: - Ensure locks are obtained and held when required" * tag 'backlight-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: led_bl: Take led_access lock when required video: backlight: lp855x: Get PWM for PWM mode during probe dt-bindings: backlight: lp855x: Convert to YAML and modernize dt-bindings: backlight: pwm: Make power-supply not required backlight: pwm_bl: Remove unneeded checks for valid GPIOs backlight: Switch i2c drivers back to use .probe() backlight: lm3630a: Turn off both led strings when display is blank dt-bindings: leds: backlight: ktz8866: Add reg property and update example
2 parents c156d4a + a33677b commit 0a8d6c9

15 files changed

Lines changed: 218 additions & 125 deletions

File tree

Documentation/devicetree/bindings/leds/backlight/kinetic,ktz8866.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ properties:
2121
compatible:
2222
const: kinetic,ktz8866
2323

24+
reg:
25+
maxItems: 1
26+
2427
vddpos-supply:
2528
description: positive boost supply regulator.
2629

@@ -54,6 +57,7 @@ properties:
5457

5558
required:
5659
- compatible
60+
- reg
5761
- vddpos-supply
5862
- vddneg-supply
5963
- enable-gpios
@@ -64,14 +68,19 @@ examples:
6468
- |
6569
#include <dt-bindings/gpio/gpio.h>
6670
67-
backlight {
68-
compatible = "kinetic,ktz8866";
69-
70-
vddpos-supply = <&bl_vddpos_5p5>;
71-
vddneg-supply = <&bl_vddneg_5p5>;
72-
enable-gpios = <&tlmm 139 GPIO_ACTIVE_HIGH>;
73-
current-num-sinks = <5>;
74-
kinetic,current-ramp-delay-ms = <128>;
75-
kinetic,led-enable-ramp-delay-ms = <1>;
76-
kinetic,enable-lcd-bias;
71+
i2c {
72+
#address-cells = <1>;
73+
#size-cells = <0>;
74+
75+
backlight@11 {
76+
compatible = "kinetic,ktz8866";
77+
reg = <0x11>;
78+
vddpos-supply = <&bl_vddpos_5p5>;
79+
vddneg-supply = <&bl_vddneg_5p5>;
80+
enable-gpios = <&tlmm 139 GPIO_ACTIVE_HIGH>;
81+
current-num-sinks = <5>;
82+
kinetic,current-ramp-delay-ms = <128>;
83+
kinetic,led-enable-ramp-delay-ms = <1>;
84+
kinetic,enable-lcd-bias;
85+
};
7786
};
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/backlight/lp855x-backlight.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Texas Instruments LP855X backlight controllers
8+
9+
maintainers:
10+
- Artur Weber <aweber.kernel@gmail.com>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- ti,lp8550
16+
- ti,lp8551
17+
- ti,lp8552
18+
- ti,lp8553
19+
- ti,lp8555
20+
- ti,lp8556
21+
- ti,lp8557
22+
23+
reg:
24+
maxItems: 1
25+
26+
dev-ctrl:
27+
$ref: /schemas/types.yaml#/definitions/uint8
28+
description:
29+
Value of device control register. This is a device-specific value.
30+
31+
bl-name:
32+
$ref: /schemas/types.yaml#/definitions/string
33+
description: Backlight device name.
34+
35+
init-brt:
36+
$ref: /schemas/types.yaml#/definitions/uint8
37+
description: Initial value of backlight brightness.
38+
39+
power-supply:
40+
description: Regulator which controls the 3V rail.
41+
42+
enable-supply:
43+
description: Regulator which controls the EN/VDDIO input.
44+
45+
pwms:
46+
maxItems: 1
47+
description: |
48+
PWM channel to use for controlling the backlight; setting this
49+
enables the PWM-based backlight control mode.
50+
51+
pwm-names: true
52+
53+
pwm-period:
54+
$ref: /schemas/types.yaml#/definitions/uint32
55+
description:
56+
PWM period value. Deprecated; set the period value in the pwms
57+
property instead.
58+
deprecated: true
59+
60+
patternProperties:
61+
"^rom-[0-9a-f]{2}h$":
62+
type: object
63+
description: Nodes containing the values of configuration registers.
64+
additionalProperties: false
65+
properties:
66+
rom-addr:
67+
$ref: /schemas/types.yaml#/definitions/uint8
68+
description: Register address of ROM area to be updated.
69+
70+
rom-val:
71+
$ref: /schemas/types.yaml#/definitions/uint8
72+
description: Value to write to the ROM register.
73+
74+
required:
75+
- compatible
76+
- reg
77+
- dev-ctrl
78+
79+
unevaluatedProperties: false
80+
81+
examples:
82+
- |
83+
i2c {
84+
#address-cells = <1>;
85+
#size-cells = <0>;
86+
87+
backlight@2c {
88+
compatible = "ti,lp8555";
89+
reg = <0x2c>;
90+
91+
dev-ctrl = /bits/ 8 <0x00>;
92+
93+
pwms = <&pwm 0 10000>;
94+
pwm-names = "lp8555";
95+
96+
/* 4V OV, 4 output LED0 string enabled */
97+
rom-14h {
98+
rom-addr = /bits/ 8 <0x14>;
99+
rom-val = /bits/ 8 <0xcf>;
100+
};
101+
102+
/* Heavy smoothing, 24ms ramp time step */
103+
rom-15h {
104+
rom-addr = /bits/ 8 <0x15>;
105+
rom-val = /bits/ 8 <0xc7>;
106+
};
107+
108+
/* 4 output LED1 string enabled */
109+
rom-19h {
110+
rom-addr = /bits/ 8 <0x19>;
111+
rom-val = /bits/ 8 <0x0f>;
112+
};
113+
};
114+
};
115+
- |
116+
i2c {
117+
#address-cells = <1>;
118+
#size-cells = <0>;
119+
120+
backlight@2c {
121+
compatible = "ti,lp8556";
122+
reg = <0x2c>;
123+
124+
bl-name = "lcd-bl";
125+
dev-ctrl = /bits/ 8 <0x85>;
126+
init-brt = /bits/ 8 <0x10>;
127+
};
128+
};
129+
- |
130+
i2c {
131+
#address-cells = <1>;
132+
#size-cells = <0>;
133+
134+
backlight@2c {
135+
compatible = "ti,lp8557";
136+
reg = <0x2c>;
137+
enable-supply = <&backlight_vddio>;
138+
power-supply = <&backlight_vdd>;
139+
140+
dev-ctrl = /bits/ 8 <0x41>;
141+
init-brt = /bits/ 8 <0x0a>;
142+
143+
/* 4V OV, 4 output LED string enabled */
144+
rom-14h {
145+
rom-addr = /bits/ 8 <0x14>;
146+
rom-val = /bits/ 8 <0xcf>;
147+
};
148+
};
149+
};

Documentation/devicetree/bindings/leds/backlight/lp855x.txt

Lines changed: 0 additions & 72 deletions
This file was deleted.

Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ dependencies:
6868
required:
6969
- compatible
7070
- pwms
71-
- power-supply
7271

7372
additionalProperties: false
7473

drivers/video/backlight/adp8860_bl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,8 @@ static struct i2c_driver adp8860_driver = {
803803
.name = KBUILD_MODNAME,
804804
.pm = &adp8860_i2c_pm_ops,
805805
},
806-
.probe_new = adp8860_probe,
807-
.remove = adp8860_remove,
806+
.probe = adp8860_probe,
807+
.remove = adp8860_remove,
808808
.id_table = adp8860_id,
809809
};
810810

drivers/video/backlight/adp8870_bl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -973,8 +973,8 @@ static struct i2c_driver adp8870_driver = {
973973
.name = KBUILD_MODNAME,
974974
.pm = &adp8870_i2c_pm_ops,
975975
},
976-
.probe_new = adp8870_probe,
977-
.remove = adp8870_remove,
976+
.probe = adp8870_probe,
977+
.remove = adp8870_remove,
978978
.id_table = adp8870_id,
979979
};
980980

drivers/video/backlight/arcxcnn_bl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static struct i2c_driver arcxcnn_driver = {
392392
.name = "arcxcnn_bl",
393393
.of_match_table = arcxcnn_dt_ids,
394394
},
395-
.probe_new = arcxcnn_probe,
395+
.probe = arcxcnn_probe,
396396
.remove = arcxcnn_remove,
397397
.id_table = arcxcnn_ids,
398398
};

drivers/video/backlight/bd6107.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static struct i2c_driver bd6107_driver = {
192192
.driver = {
193193
.name = "bd6107",
194194
},
195-
.probe_new = bd6107_probe,
195+
.probe = bd6107_probe,
196196
.remove = bd6107_remove,
197197
.id_table = bd6107_ids,
198198
};

drivers/video/backlight/ktz8866.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static struct i2c_driver ktz8866_driver = {
196196
.name = "ktz8866",
197197
.of_match_table = ktz8866_match_table,
198198
},
199-
.probe_new = ktz8866_probe,
199+
.probe = ktz8866_probe,
200200
.remove = ktz8866_remove,
201201
.id_table = ktz8866_ids,
202202
};

drivers/video/backlight/led_bl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ static int led_bl_probe(struct platform_device *pdev)
209209
return PTR_ERR(priv->bl_dev);
210210
}
211211

212-
for (i = 0; i < priv->nb_leds; i++)
212+
for (i = 0; i < priv->nb_leds; i++) {
213+
mutex_lock(&priv->leds[i]->led_access);
213214
led_sysfs_disable(priv->leds[i]);
215+
mutex_unlock(&priv->leds[i]->led_access);
216+
}
214217

215218
backlight_update_status(priv->bl_dev);
216219

0 commit comments

Comments
 (0)