Skip to content

Commit 7fafb54

Browse files
committed
Merge tag 'leds-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds
Pull LED updates from Pavel Machek: "Quite a lot of stuff is going on here. Great cleanups/fixes from Marek and others are biggest part. I limited CPU LED trigger to 8 LEDs, because it was willing to register 1024 'triggers' on machine with 1024 CPUs. I don't believe it will cause any problems, but we can raise the limit if it does" * tag 'leds-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: (84 commits) leds: pwm: Remove platform_data support leds: lm3697: Fix out-of-bound access leds: ns2: do not guard OF match pointer with of_match_ptr leds: ns2: convert to fwnode API leds: tlc591xx: fix leak of device node iterator leds: pca963x: use struct led_init_data when registering leds: pca963x: register LEDs immediately after parsing, get rid of platdata leds: tca6507: remove binding comment leds: tca6507: cosmetic change: use helper variable leds: tca6507: do not set GPIO names dt-bindings: leds: tca6507: convert to YAML ledtrig-cpu: Limit to 8 CPUs leds: TODO: Add documentation about possible subsystem improvements leds: pca9532: read pwm settings from device tree leds: pca9532: correct shift computation in pca9532_getled leds: lm36274: Fix warning for undefined parameters leds: lm3532: Fix warnings for undefined parameters leds: pca963x: use flexible array leds: pca963x: cosmetic: rename variables leds: pca963x: cosmetic: rename variables ...
2 parents 55e0500 + 19d2e0c commit 7fafb54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1791
-1104
lines changed

Documentation/devicetree/bindings/leds/leds-is31fl319x.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Optional properties:
1616
- audio-gain-db : audio gain selection for external analog modulation input.
1717
Valid values: 0 - 21, step by 3 (rounded down)
1818
Default: 0
19+
- shutdown-gpios : Specifier of the GPIO connected to SDB pin of the chip.
1920

2021
Each led is represented as a sub-node of the issi,is31fl319x device.
2122
There can be less leds subnodes than the chip can support but not more.
@@ -44,6 +45,7 @@ fancy_leds: leds@65 {
4445
#address-cells = <1>;
4546
#size-cells = <0>;
4647
reg = <0x65>;
48+
shutdown-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
4749

4850
red_aux: led@1 {
4951
label = "red:aux";
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/leds-lp50xx.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: LED driver for LP50XX RGB LED from Texas Instruments.
8+
9+
maintainers:
10+
- Dan Murphy <[email protected]>
11+
12+
description: |
13+
The LP50XX is multi-channel, I2C RGB LED Drivers that can group RGB LEDs into
14+
a LED group or control them individually.
15+
16+
The difference in these RGB LED drivers is the number of supported RGB
17+
modules.
18+
19+
For more product information please see the link below:
20+
https://www.ti.com/lit/ds/symlink/lp5012.pdf
21+
https://www.ti.com/lit/ds/symlink/lp5024.pdf
22+
https://www.ti.com/lit/ds/symlink/lp5036.pdf
23+
24+
properties:
25+
compatible:
26+
enum:
27+
- ti,lp5009
28+
- ti,lp5012
29+
- ti,lp5018
30+
- ti,lp5024
31+
- ti,lp5030
32+
- ti,lp5036
33+
34+
reg:
35+
maxItems: 1
36+
description:
37+
I2C slave address
38+
lp5009/12 - 0x14, 0x15, 0x16, 0x17
39+
lp5018/24 - 0x28, 0x29, 0x2a, 0x2b
40+
lp5030/36 - 0x30, 0x31, 0x32, 0x33
41+
42+
enable-gpios:
43+
maxItems: 1
44+
description: GPIO pin to enable/disable the device.
45+
46+
vled-supply:
47+
description: LED supply.
48+
49+
patternProperties:
50+
'^multi-led@[0-9a-f]$':
51+
type: object
52+
allOf:
53+
- $ref: leds-class-multicolor.yaml#
54+
properties:
55+
reg:
56+
minItems: 1
57+
maxItems: 12
58+
description:
59+
This property denotes the LED module number(s) that is used on the
60+
for the child node. The LED modules can either be used stand alone
61+
or grouped into a module bank.
62+
63+
patternProperties:
64+
"(^led-[0-9a-f]$|led)":
65+
type: object
66+
$ref: common.yaml#
67+
68+
required:
69+
- compatible
70+
- reg
71+
72+
examples:
73+
- |
74+
#include <dt-bindings/gpio/gpio.h>
75+
#include <dt-bindings/leds/common.h>
76+
77+
i2c {
78+
#address-cells = <1>;
79+
#size-cells = <0>;
80+
81+
led-controller@14 {
82+
compatible = "ti,lp5009";
83+
reg = <0x14>;
84+
#address-cells = <1>;
85+
#size-cells = <0>;
86+
enable-gpios = <&gpio1 16>;
87+
88+
multi-led@1 {
89+
#address-cells = <1>;
90+
#size-cells = <0>;
91+
reg = <0x1>;
92+
color = <LED_COLOR_ID_RGB>;
93+
function = LED_FUNCTION_CHARGING;
94+
95+
led-0 {
96+
color = <LED_COLOR_ID_RED>;
97+
};
98+
99+
led-1 {
100+
color = <LED_COLOR_ID_GREEN>;
101+
};
102+
103+
led-2 {
104+
color = <LED_COLOR_ID_BLUE>;
105+
};
106+
};
107+
108+
multi-led@2 {
109+
#address-cells = <1>;
110+
#size-cells = <2>;
111+
reg = <0x2 0x3 0x5>;
112+
color = <LED_COLOR_ID_RGB>;
113+
function = LED_FUNCTION_STANDBY;
114+
115+
led-6 {
116+
color = <LED_COLOR_ID_RED>;
117+
};
118+
119+
led-7 {
120+
color = <LED_COLOR_ID_GREEN>;
121+
};
122+
123+
led-8 {
124+
color = <LED_COLOR_ID_BLUE>;
125+
};
126+
};
127+
};
128+
};
129+
130+
...

Documentation/devicetree/bindings/leds/leds-lp55xx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ examples:
189189
#address-cells = <1>;
190190
#size-cells = <0>;
191191
reg = <0x2>;
192-
color = <LED_COLOR_ID_MULTI>;
192+
color = <LED_COLOR_ID_RGB>;
193193
function = LED_FUNCTION_STANDBY;
194194
linux,default-trigger = "heartbeat";
195195

Documentation/devicetree/bindings/leds/leds-pca955x.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Required properties:
99
"nxp,pca9550"
1010
"nxp,pca9551"
1111
"nxp,pca9552"
12+
"ibm,pca9552"
1213
"nxp,pca9553"
1314
- #address-cells: must be 1
1415
- #size-cells: must be 0

Documentation/devicetree/bindings/leds/tca6507.txt

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/ti,tca6507.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: TCA6507 LED and GPIO controller
8+
9+
maintainers:
10+
- NeilBrown <[email protected]>
11+
12+
description:
13+
The TCA6507 is a programmable LED controller connected via I2C that can drive
14+
7 separate lines either by holding them low, or by pulsing them with modulated
15+
width.
16+
17+
properties:
18+
compatible:
19+
const: ti,tca6507
20+
21+
reg:
22+
description: I2C slave address of the controller.
23+
maxItems: 1
24+
25+
"#address-cells":
26+
const: 1
27+
28+
"#size-cells":
29+
const: 0
30+
31+
gpio-controller: true
32+
33+
"#gpio-cells":
34+
const: 2
35+
36+
gpio-line-names: true
37+
38+
patternProperties:
39+
"^led@[0-6]$":
40+
type: object
41+
42+
$ref: common.yaml#
43+
44+
properties:
45+
reg:
46+
minimum: 0
47+
maximum: 6
48+
49+
required:
50+
- reg
51+
52+
"^gpio@[0-6]$":
53+
type: object
54+
55+
properties:
56+
compatible:
57+
const: gpio
58+
59+
reg:
60+
minimum: 0
61+
maximum: 6
62+
63+
additionalProperties: false
64+
65+
required:
66+
- reg
67+
- compatible
68+
69+
if:
70+
patternProperties:
71+
"^gpio@[0-6]$":
72+
properties:
73+
compatible:
74+
contains:
75+
const: gpio
76+
then:
77+
required:
78+
- gpio-controller
79+
- "#gpio-cells"
80+
81+
additionalProperties: false
82+
83+
examples:
84+
- |
85+
86+
#include <dt-bindings/gpio/gpio.h>
87+
#include <dt-bindings/leds/common.h>
88+
89+
i2c0 {
90+
#address-cells = <1>;
91+
#size-cells = <0>;
92+
93+
led-controller@45 {
94+
compatible = "ti,tca6507";
95+
#address-cells = <1>;
96+
#size-cells = <0>;
97+
reg = <0x45>;
98+
99+
gpio-controller;
100+
#gpio-cells = <2>;
101+
102+
gpio-line-names = "wifi_reset@6";
103+
104+
led@0 {
105+
label = "gta04:red:aux";
106+
reg = <0x0>;
107+
};
108+
109+
led@1 {
110+
label = "gta04:green:aux";
111+
reg = <0x1>;
112+
};
113+
114+
led@3 {
115+
reg = <0x3>;
116+
color = <LED_COLOR_ID_RED>;
117+
function = LED_FUNCTION_POWER;
118+
linux,default-trigger = "default-on";
119+
};
120+
121+
led@4 {
122+
color = <LED_COLOR_ID_GREEN>;
123+
function = LED_FUNCTION_POWER;
124+
reg = <0x4>;
125+
};
126+
127+
gpio@6 {
128+
compatible = "gpio";
129+
reg = <0x6>;
130+
};
131+
};
132+
};
133+
134+
...

Documentation/leds/ledtrig-transient.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ set a timer to hold a state, however when user space application crashes or
1717
goes away without deactivating the timer, the hardware will be left in that
1818
state permanently.
1919

20-
As a specific example of this use-case, let's look at vibrate feature on
21-
phones. Vibrate function on phones is implemented using PWM pins on SoC or
22-
PMIC. There is a need to activate one shot timer to control the vibrate
23-
feature, to prevent user space crashes leaving the phone in vibrate mode
24-
permanently causing the battery to drain.
25-
2620
Transient trigger addresses the need for one shot timer activation. The
2721
transient trigger can be enabled and disabled just like the other leds
2822
triggers.
@@ -159,7 +153,6 @@ repeat the following step as needed::
159153

160154
This trigger is intended to be used for the following example use cases:
161155

162-
- Control of vibrate (phones, tablets etc.) hardware by user space app.
163156
- Use of LED by user space app as activity indicator.
164157
- Use of LED by user space app as a kind of watchdog indicator -- as
165158
long as the app is alive, it can keep the LED illuminated, if it dies

0 commit comments

Comments
 (0)