Skip to content

Commit f5c31bc

Browse files
committed
Merge tag 'leds-next-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds
Pull LED updates from Lee Jones: "Core Framework: - Introduce ExpressWire library New Drivers: - Add support for ON Semiconductor NCP5623 RGB LED Driver New Device Support: - Add support for PM660L to Qualcomm's LPG driver New Functionality: - Dynamically load modules required for the default-trigger - Add some support for suspend and resume - Allow LEDs to remain lit during suspend Fix-ups: - Device Tree binding adaptions/conversions/creation - Fix include lists; alphabetise, remove unused, explicitly add used - Add new led_match_default_trigger to avoid duplication - Add module alias' to aid auto-loading - Default to hw_control if no others are specified - De-bloat the supported link speed attribute lists - Remove superfluous code and simplify overall - Constify some variables Bug Fixes: - Prevent kernel panic when renaming the net interface - Fix Kconfig related build errors - Ensure mutexes are unlocked prior to destroying them - Provide clean-up between state changes to avoid invalid state - Fix some broken kernel-doc headers" * tag 'leds-next-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (41 commits) leds: ncp5623: Add MS suffix to time defines leds: Add NCP5623 multi-led driver dt-bindings: leds: Add NCP5623 multi-LED Controller leds: mlxreg: Drop an excess struct mlxreg_led_data member leds: leds-mlxcpld: Fix struct mlxcpld_led_priv member name leds: lm3601x: Fix struct lm3601_led kernel-doc warnings leds: Fix ifdef check for gpio_led_register_device() dt-bindings: leds: qcom-lpg: Narrow nvmem for other variants dt-bindings: leds: qcom-lpg: Drop redundant qcom,pm8550-pwm in if:then: dt-bindings: leds: Add LED_FUNCTION_WAN_ONLINE for Internet access leds: sgm3140: Add missing timer cleanup and flash gpio control leds: expresswire: Don't depend on NEW_LEDS Revert "leds: Only descend into leds directory when CONFIG_NEW_LEDS is set" leds: aw2013: Unlock mutex before destroying it leds: qcom-lpg: Add QCOM_PBS dependency leds: rgb: leds-group-multicolor: Allow LEDs to stay on in suspend leds: trigger: netdev: Fix kernel panic on interface rename trig notify leds: qcom-lpg: Add PM660L configuration and compatible leds: spi-byte: Use devm_led_classdev_register_ext() leds: pca963x: Add support for suspend and resume ...
2 parents f3d8f29 + 45066c4 commit f5c31bc

33 files changed

+1034
-189
lines changed

Documentation/ABI/testing/sysfs-class-led-trigger-netdev

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ Description:
8888
speed of 10MBps of the named network device.
8989
Setting this value also immediately changes the LED state.
9090

91+
Present only if the named network device supports 10Mbps link speed.
92+
9193
What: /sys/class/leds/<led>/link_100
9294
Date: Jun 2023
9395
KernelVersion: 6.5
@@ -101,6 +103,8 @@ Description:
101103
speed of 100Mbps of the named network device.
102104
Setting this value also immediately changes the LED state.
103105

106+
Present only if the named network device supports 100Mbps link speed.
107+
104108
What: /sys/class/leds/<led>/link_1000
105109
Date: Jun 2023
106110
KernelVersion: 6.5
@@ -114,6 +118,8 @@ Description:
114118
speed of 1000Mbps of the named network device.
115119
Setting this value also immediately changes the LED state.
116120

121+
Present only if the named network device supports 1000Mbps link speed.
122+
117123
What: /sys/class/leds/<led>/link_2500
118124
Date: Nov 2023
119125
KernelVersion: 6.8
@@ -127,6 +133,8 @@ Description:
127133
speed of 2500Mbps of the named network device.
128134
Setting this value also immediately changes the LED state.
129135

136+
Present only if the named network device supports 2500Mbps link speed.
137+
130138
What: /sys/class/leds/<led>/link_5000
131139
Date: Nov 2023
132140
KernelVersion: 6.8
@@ -140,6 +148,8 @@ Description:
140148
speed of 5000Mbps of the named network device.
141149
Setting this value also immediately changes the LED state.
142150

151+
Present only if the named network device supports 5000Mbps link speed.
152+
143153
What: /sys/class/leds/<led>/link_10000
144154
Date: Nov 2023
145155
KernelVersion: 6.8
@@ -153,6 +163,8 @@ Description:
153163
speed of 10000Mbps of the named network device.
154164
Setting this value also immediately changes the LED state.
155165

166+
Present only if the named network device supports 10000Mbps link speed.
167+
156168
What: /sys/class/leds/<led>/half_duplex
157169
Date: Jun 2023
158170
KernelVersion: 6.5

Documentation/ABI/testing/sysfs-class-led-trigger-tty

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
What: /sys/class/leds/<led>/ttyname
1+
What: /sys/class/leds/<tty_led>/ttyname
22
Date: Dec 2020
33
KernelVersion: 5.10
44
55
Description:
66
Specifies the tty device name of the triggering tty
77

8-
What: /sys/class/leds/<led>/rx
8+
What: /sys/class/leds/<tty_led>/rx
99
Date: February 2024
1010
KernelVersion: 6.8
1111
Description:
1212
Signal reception (rx) of data on the named tty device.
1313
If set to 0, the LED will not blink on reception.
1414
If set to 1 (default), the LED will blink on reception.
1515

16-
What: /sys/class/leds/<led>/tx
16+
What: /sys/class/leds/<tty_led>/tx
1717
Date: February 2024
1818
KernelVersion: 6.8
1919
Description:
2020
Signal transmission (tx) of data on the named tty device.
2121
If set to 0, the LED will not blink on transmission.
2222
If set to 1 (default), the LED will blink on transmission.
2323

24-
What: /sys/class/leds/<led>/cts
24+
What: /sys/class/leds/<tty_led>/cts
2525
Date: February 2024
2626
KernelVersion: 6.8
2727
Description:
@@ -31,7 +31,7 @@ Description:
3131
If set to 0 (default), the LED will not evaluate CTS.
3232
If set to 1, the LED will evaluate CTS.
3333

34-
What: /sys/class/leds/<led>/dsr
34+
What: /sys/class/leds/<tty_led>/dsr
3535
Date: February 2024
3636
KernelVersion: 6.8
3737
Description:
@@ -41,7 +41,7 @@ Description:
4141
If set to 0 (default), the LED will not evaluate DSR.
4242
If set to 1, the LED will evaluate DSR.
4343

44-
What: /sys/class/leds/<led>/dcd
44+
What: /sys/class/leds/<tty_led>/dcd
4545
Date: February 2024
4646
KernelVersion: 6.8
4747
Description:
@@ -51,7 +51,7 @@ Description:
5151
If set to 0 (default), the LED will not evaluate CAR (DCD).
5252
If set to 1, the LED will evaluate CAR (DCD).
5353

54-
What: /sys/class/leds/<led>/rng
54+
What: /sys/class/leds/<tty_led>/rng
5555
Date: February 2024
5656
KernelVersion: 6.8
5757
Description:

Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ maintainers:
1111

1212
description: >
1313
The Qualcomm Light Pulse Generator consists of three different hardware blocks;
14-
a ramp generator with lookup table, the light pulse generator and a three
14+
a ramp generator with lookup table (LUT), the light pulse generator and a three
1515
channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
1616
1717
properties:
@@ -63,6 +63,29 @@ properties:
6363
- description: dtest line to attach
6464
- description: flags for the attachment
6565

66+
nvmem:
67+
description: >
68+
This property is required for PMICs that supports PPG, which is when a
69+
PMIC stores LPG per-channel data and pattern LUT in SDAM modules instead
70+
of in a LUT peripheral. For PMICs, such as PM8350C, per-channel data
71+
and pattern LUT is separated into 2 SDAM modules. In that case, phandles
72+
to both SDAM modules need to be specified.
73+
minItems: 1
74+
maxItems: 2
75+
76+
nvmem-names:
77+
minItems: 1
78+
items:
79+
- const: lpg_chan_sdam
80+
- const: lut_sdam
81+
82+
qcom,pbs:
83+
$ref: /schemas/types.yaml#/definitions/phandle
84+
description: >
85+
Phandle of the Qualcomm Programmable Boot Sequencer node (PBS).
86+
PBS node is used to trigger LPG pattern sequences for PMICs that support
87+
single SDAM PPG.
88+
6689
multi-led:
6790
type: object
6891
$ref: leds-class-multicolor.yaml#
@@ -106,6 +129,52 @@ required:
106129

107130
additionalProperties: false
108131

132+
allOf:
133+
- if:
134+
properties:
135+
compatible:
136+
contains:
137+
enum:
138+
- qcom,pm660l-lpg
139+
- qcom,pm8150b-lpg
140+
- qcom,pm8150l-lpg
141+
- qcom,pm8916-pwm
142+
- qcom,pm8941-lpg
143+
- qcom,pm8994-lpg
144+
- qcom,pmc8180c-lpg
145+
- qcom,pmi8994-lpg
146+
- qcom,pmi8998-lpg
147+
- qcom,pmk8550-pwm
148+
then:
149+
properties:
150+
nvmem: false
151+
nvmem-names: false
152+
153+
- if:
154+
properties:
155+
compatible:
156+
contains:
157+
const: qcom,pmi632-lpg
158+
then:
159+
properties:
160+
nvmem:
161+
maxItems: 1
162+
nvmem-names:
163+
maxItems: 1
164+
165+
- if:
166+
properties:
167+
compatible:
168+
contains:
169+
enum:
170+
- qcom,pm8350c-pwm
171+
then:
172+
properties:
173+
nvmem:
174+
minItems: 2
175+
nvmem-names:
176+
minItems: 2
177+
109178
examples:
110179
- |
111180
#include <dt-bindings/leds/common.h>
@@ -191,4 +260,35 @@ examples:
191260
compatible = "qcom,pm8916-pwm";
192261
#pwm-cells = <2>;
193262
};
263+
- |
264+
#include <dt-bindings/leds/common.h>
265+
266+
led-controller {
267+
compatible = "qcom,pmi632-lpg";
268+
#address-cells = <1>;
269+
#size-cells = <0>;
270+
#pwm-cells = <2>;
271+
nvmem-names = "lpg_chan_sdam";
272+
nvmem = <&pmi632_sdam_7>;
273+
qcom,pbs = <&pmi632_pbs_client3>;
274+
275+
led@1 {
276+
reg = <1>;
277+
color = <LED_COLOR_ID_RED>;
278+
label = "red";
279+
};
280+
281+
led@2 {
282+
reg = <2>;
283+
color = <LED_COLOR_ID_GREEN>;
284+
label = "green";
285+
};
286+
287+
led@3 {
288+
reg = <3>;
289+
color = <LED_COLOR_ID_BLUE>;
290+
label = "blue";
291+
};
292+
};
293+
194294
...
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/onnn,ncp5623.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: ON Semiconductor NCP5623 multi-LED Driver
8+
9+
maintainers:
10+
- Abdel Alkuor <[email protected]>
11+
12+
description:
13+
NCP5623 Triple Output I2C Controlled LED Driver.
14+
https://www.onsemi.com/pdf/datasheet/ncp5623-d.pdf
15+
16+
properties:
17+
compatible:
18+
enum:
19+
- onnn,ncp5623
20+
21+
reg:
22+
const: 0x38
23+
24+
multi-led:
25+
type: object
26+
$ref: leds-class-multicolor.yaml#
27+
unevaluatedProperties: false
28+
29+
properties:
30+
"#address-cells":
31+
const: 1
32+
33+
"#size-cells":
34+
const: 0
35+
36+
patternProperties:
37+
"^led@[0-2]$":
38+
type: object
39+
$ref: common.yaml#
40+
unevaluatedProperties: false
41+
42+
properties:
43+
reg:
44+
minimum: 0
45+
maximum: 2
46+
47+
required:
48+
- reg
49+
- color
50+
51+
required:
52+
- "#address-cells"
53+
- "#size-cells"
54+
55+
required:
56+
- compatible
57+
- reg
58+
- multi-led
59+
60+
additionalProperties: false
61+
62+
examples:
63+
- |
64+
#include <dt-bindings/leds/common.h>
65+
66+
i2c {
67+
#address-cells = <1>;
68+
#size-cells = <0>;
69+
70+
led-controller@38 {
71+
compatible = "onnn,ncp5623";
72+
reg = <0x38>;
73+
74+
multi-led {
75+
color = <LED_COLOR_ID_RGB>;
76+
77+
#address-cells = <1>;
78+
#size-cells = <0>;
79+
80+
led@0 {
81+
reg = <0>;
82+
color = <LED_COLOR_ID_RED>;
83+
};
84+
85+
led@1 {
86+
reg = <1>;
87+
color = <LED_COLOR_ID_GREEN>;
88+
};
89+
90+
led@2 {
91+
reg = <2>;
92+
color = <LED_COLOR_ID_BLUE>;
93+
};
94+
};
95+
};
96+
};

drivers/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle/
135135
obj-y += mmc/
136136
obj-y += ufs/
137137
obj-$(CONFIG_MEMSTICK) += memstick/
138-
obj-$(CONFIG_NEW_LEDS) += leds/
138+
obj-y += leds/
139139
obj-$(CONFIG_INFINIBAND) += infiniband/
140140
obj-y += firmware/
141141
obj-$(CONFIG_CRYPTO) += crypto/

drivers/leds/Kconfig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ config LEDS_GPIO_REGISTER
66
As this function is used by arch code it must not be compiled as a
77
module.
88

9+
# This library does not depend on NEW_LEDS and must be independent so it can be
10+
# selected from other subsystems (specifically backlight).
11+
config LEDS_EXPRESSWIRE
12+
bool
13+
depends on GPIOLIB
14+
915
menuconfig NEW_LEDS
1016
bool "LED Support"
1117
help
@@ -399,7 +405,7 @@ config LEDS_LP3952
399405
config LEDS_LP50XX
400406
tristate "LED Support for TI LP5036/30/24/18/12/09 LED driver chip"
401407
depends on LEDS_CLASS && REGMAP_I2C
402-
depends on LEDS_CLASS_MULTICOLOR || !LEDS_CLASS_MULTICOLOR
408+
depends on LEDS_CLASS_MULTICOLOR
403409
help
404410
If you say yes here you get support for the Texas Instruments
405411
LP5036, LP5030, LP5024, LP5018, LP5012 and LP5009 LED driver.
@@ -410,7 +416,7 @@ config LEDS_LP50XX
410416
config LEDS_LP55XX_COMMON
411417
tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501"
412418
depends on LEDS_CLASS
413-
depends on LEDS_CLASS_MULTICOLOR || !LEDS_CLASS_MULTICOLOR
419+
depends on LEDS_CLASS_MULTICOLOR
414420
depends on OF
415421
depends on I2C
416422
select FW_LOADER

drivers/leds/flash/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ config LEDS_MAX77693
5252
config LEDS_MT6360
5353
tristate "LED Support for Mediatek MT6360 PMIC"
5454
depends on LEDS_CLASS && OF
55-
depends on LEDS_CLASS_FLASH || !LEDS_CLASS_FLASH
56-
depends on LEDS_CLASS_MULTICOLOR || !LEDS_CLASS_MULTICOLOR
55+
depends on LEDS_CLASS_FLASH
56+
depends on LEDS_CLASS_MULTICOLOR
5757
depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS
5858
depends on MFD_MT6360
5959
help

0 commit comments

Comments
 (0)