Skip to content

Commit 08df80a

Browse files
committed
Merge tag 'leds-next-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds
Pull LED updates from Lee Jones: "New Drivers: - Add support for Allwinner A100 RGB LED controller - Add support for Maxim 5970 Dual Hot-swap controller New Device Support: - Add support for AW20108 to Awinic LED driver New Functionality: - Extend support for Net speeds to include; 2.5G, 5G and 10G - Allow tx/rx and cts/dsr/dcd/rng TTY LEDS to be turned on and off via sysfs if required - Add support for hardware control in AW200xx Fix-ups: - Use safer methods for string handling - Improve error handling; return proper error values, simplify, avoid duplicates, etc - Replace Mutex use with the Completion mechanism - Fix include lists; alphabetise, remove unused, explicitly add used - Use generic platform device properties - Use/convert to new/better APIs/helpers/MACROs instead of hand-rolling implementations - Device Tree binding adaptions/conversions/creation - Continue work to remove superfluous platform .remove() call-backs - Remove superfluous/defunct code - Trivial; whitespace, unused variables, spelling, clean-ups, etc - Avoid unnecessary duplicate locks Bug Fixes: - Repair Kconfig based dependency lists - Ensure unused dynamically allocated data is freed after use - Fix support for brightness control - Add missing sufficient delays during reset to ensure correct operation - Avoid division-by-zero issues" * tag 'leds-next-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (45 commits) leds: trigger: netdev: Add core support for hw not supporting fallback to LED sw control leds: trigger: panic: Don't register panic notifier if creating the trigger failed leds: sun50i-a100: Convert to be agnostic to property provider leds: max5970: Add missing headers leds: max5970: Make use of dev_err_probe() leds: max5970: Make use of device properties leds: max5970: Remove unused variable leds: rgb: Drop obsolete dependency on COMPILE_TEST leds: sun50i-a100: Avoid division-by-zero warning leds: trigger: Remove unused function led_trigger_rename_static() leds: qcom-lpg: Introduce a wrapper for getting driver data from a pwm chip leds: gpio: Add kernel log if devm_fwnode_gpiod_get() fails dt-bindings: leds: qcom,spmi-flash-led: Fix example node name dt-bindings: leds: aw200xx: Fix led pattern and add reg constraints dt-bindings: leds: awinic,aw200xx: Add AW20108 device leds: aw200xx: Add support for aw20108 device leds: aw200xx: Improve autodim calculation method leds: aw200xx: Enable disable_locking flag in regmap config leds: aw200xx: Add delay after software reset dt-bindings: leds: aw200xx: Remove property "awinic,display-rows" ...
2 parents 2385018 + 4289e43 commit 08df80a

24 files changed

+1449
-201
lines changed

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,45 @@ Description:
114114
speed of 1000Mbps of the named network device.
115115
Setting this value also immediately changes the LED state.
116116

117+
What: /sys/class/leds/<led>/link_2500
118+
Date: Nov 2023
119+
KernelVersion: 6.8
120+
Contact: linux-leds@vger.kernel.org
121+
Description:
122+
Signal the link speed state of 2500Mbps of the named network device.
123+
124+
If set to 0 (default), the LED's normal state is off.
125+
126+
If set to 1, the LED's normal state reflects the link state
127+
speed of 2500Mbps of the named network device.
128+
Setting this value also immediately changes the LED state.
129+
130+
What: /sys/class/leds/<led>/link_5000
131+
Date: Nov 2023
132+
KernelVersion: 6.8
133+
Contact: linux-leds@vger.kernel.org
134+
Description:
135+
Signal the link speed state of 5000Mbps of the named network device.
136+
137+
If set to 0 (default), the LED's normal state is off.
138+
139+
If set to 1, the LED's normal state reflects the link state
140+
speed of 5000Mbps of the named network device.
141+
Setting this value also immediately changes the LED state.
142+
143+
What: /sys/class/leds/<led>/link_10000
144+
Date: Nov 2023
145+
KernelVersion: 6.8
146+
Contact: linux-leds@vger.kernel.org
147+
Description:
148+
Signal the link speed state of 10000Mbps of the named network device.
149+
150+
If set to 0 (default), the LED's normal state is off.
151+
152+
If set to 1, the LED's normal state reflects the link state
153+
speed of 10000Mbps of the named network device.
154+
Setting this value also immediately changes the LED state.
155+
117156
What: /sys/class/leds/<led>/half_duplex
118157
Date: Jun 2023
119158
KernelVersion: 6.5

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,59 @@ KernelVersion: 5.10
44
Contact: linux-leds@vger.kernel.org
55
Description:
66
Specifies the tty device name of the triggering tty
7+
8+
What: /sys/class/leds/<led>/rx
9+
Date: February 2024
10+
KernelVersion: 6.8
11+
Description:
12+
Signal reception (rx) of data on the named tty device.
13+
If set to 0, the LED will not blink on reception.
14+
If set to 1 (default), the LED will blink on reception.
15+
16+
What: /sys/class/leds/<led>/tx
17+
Date: February 2024
18+
KernelVersion: 6.8
19+
Description:
20+
Signal transmission (tx) of data on the named tty device.
21+
If set to 0, the LED will not blink on transmission.
22+
If set to 1 (default), the LED will blink on transmission.
23+
24+
What: /sys/class/leds/<led>/cts
25+
Date: February 2024
26+
KernelVersion: 6.8
27+
Description:
28+
CTS = Clear To Send
29+
DCE is ready to accept data from the DTE.
30+
If the line state is detected, the LED is switched on.
31+
If set to 0 (default), the LED will not evaluate CTS.
32+
If set to 1, the LED will evaluate CTS.
33+
34+
What: /sys/class/leds/<led>/dsr
35+
Date: February 2024
36+
KernelVersion: 6.8
37+
Description:
38+
DSR = Data Set Ready
39+
DCE is ready to receive and send data.
40+
If the line state is detected, the LED is switched on.
41+
If set to 0 (default), the LED will not evaluate DSR.
42+
If set to 1, the LED will evaluate DSR.
43+
44+
What: /sys/class/leds/<led>/dcd
45+
Date: February 2024
46+
KernelVersion: 6.8
47+
Description:
48+
DCD = Data Carrier Detect
49+
DTE is receiving a carrier from the DCE.
50+
If the line state is detected, the LED is switched on.
51+
If set to 0 (default), the LED will not evaluate CAR (DCD).
52+
If set to 1, the LED will evaluate CAR (DCD).
53+
54+
What: /sys/class/leds/<led>/rng
55+
Date: February 2024
56+
KernelVersion: 6.8
57+
Description:
58+
RNG = Ring Indicator
59+
DCE has detected an incoming ring signal on the telephone
60+
line. If the line state is detected, the LED is switched on.
61+
If set to 0 (default), the LED will not evaluate RNG.
62+
If set to 1, the LED will evaluate RNG.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/allwinner,sun50i-a100-ledc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Allwinner A100 LED Controller
8+
9+
maintainers:
10+
- Samuel Holland <samuel@sholland.org>
11+
12+
description:
13+
The LED controller found in Allwinner sunxi SoCs uses a one-wire serial
14+
interface to drive up to 1024 RGB LEDs.
15+
16+
properties:
17+
compatible:
18+
oneOf:
19+
- const: allwinner,sun50i-a100-ledc
20+
- items:
21+
- enum:
22+
- allwinner,sun20i-d1-ledc
23+
- allwinner,sun50i-r329-ledc
24+
- const: allwinner,sun50i-a100-ledc
25+
26+
reg:
27+
maxItems: 1
28+
29+
"#address-cells":
30+
const: 1
31+
32+
"#size-cells":
33+
const: 0
34+
35+
interrupts:
36+
maxItems: 1
37+
38+
clocks:
39+
items:
40+
- description: Bus clock
41+
- description: Module clock
42+
43+
clock-names:
44+
items:
45+
- const: bus
46+
- const: mod
47+
48+
resets:
49+
maxItems: 1
50+
51+
dmas:
52+
maxItems: 1
53+
description: TX DMA channel
54+
55+
dma-names:
56+
const: tx
57+
58+
allwinner,pixel-format:
59+
description: Pixel format (subpixel transmission order), default is "grb"
60+
enum:
61+
- bgr
62+
- brg
63+
- gbr
64+
- grb
65+
- rbg
66+
- rgb
67+
68+
allwinner,t0h-ns:
69+
default: 336
70+
description: Length of high pulse when transmitting a "0" bit
71+
72+
allwinner,t0l-ns:
73+
default: 840
74+
description: Length of low pulse when transmitting a "0" bit
75+
76+
allwinner,t1h-ns:
77+
default: 882
78+
description: Length of high pulse when transmitting a "1" bit
79+
80+
allwinner,t1l-ns:
81+
default: 294
82+
description: Length of low pulse when transmitting a "1" bit
83+
84+
allwinner,treset-ns:
85+
default: 300000
86+
description: Minimum delay between transmission frames
87+
88+
patternProperties:
89+
"^multi-led@[0-9a-f]+$":
90+
type: object
91+
$ref: leds-class-multicolor.yaml#
92+
unevaluatedProperties: false
93+
properties:
94+
reg:
95+
minimum: 0
96+
maximum: 1023
97+
description: Index of the LED in the series (must be contiguous)
98+
99+
required:
100+
- reg
101+
102+
required:
103+
- compatible
104+
- reg
105+
- interrupts
106+
- clocks
107+
- clock-names
108+
- resets
109+
110+
additionalProperties: false
111+
112+
examples:
113+
- |
114+
#include <dt-bindings/interrupt-controller/irq.h>
115+
#include <dt-bindings/leds/common.h>
116+
117+
ledc: led-controller@2008000 {
118+
compatible = "allwinner,sun20i-d1-ledc",
119+
"allwinner,sun50i-a100-ledc";
120+
reg = <0x2008000 0x400>;
121+
interrupts = <36 IRQ_TYPE_LEVEL_HIGH>;
122+
clocks = <&ccu 12>, <&ccu 34>;
123+
clock-names = "bus", "mod";
124+
resets = <&ccu 12>;
125+
dmas = <&dma 42>;
126+
dma-names = "tx";
127+
#address-cells = <1>;
128+
#size-cells = <0>;
129+
130+
multi-led@0 {
131+
reg = <0x0>;
132+
color = <LED_COLOR_ID_RGB>;
133+
function = LED_FUNCTION_INDICATOR;
134+
};
135+
};
136+
137+
...

Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,27 @@ maintainers:
1010
- Martin Kurbanov <mmkurbanov@sberdevices.ru>
1111

1212
description: |
13-
This controller is present on AW20036/AW20054/AW20072.
14-
It is a 3x12/6x9/6x12 matrix LED programmed via
15-
an I2C interface, up to 36/54/72 LEDs or 12/18/24 RGBs,
16-
3 pattern controllers for auto breathing or group dimming control.
13+
It is a matrix LED driver programmed via an I2C interface. Devices have
14+
a set of individually controlled leds and support 3 pattern controllers
15+
for auto breathing or group dimming control. Supported devices:
16+
- AW20036 (3x12) 36 LEDs
17+
- AW20054 (6x9) 54 LEDs
18+
- AW20072 (6x12) 72 LEDs
19+
- AW20108 (9x12) 108 LEDs
1720
1821
For more product information please see the link below:
1922
aw20036 - https://www.awinic.com/en/productDetail/AW20036QNR#tech-docs
2023
aw20054 - https://www.awinic.com/en/productDetail/AW20054QNR#tech-docs
2124
aw20072 - https://www.awinic.com/en/productDetail/AW20072QNR#tech-docs
25+
aw20108 - https://www.awinic.com/en/productDetail/AW20108QNR#tech-docs
2226
2327
properties:
2428
compatible:
2529
enum:
2630
- awinic,aw20036
2731
- awinic,aw20054
2832
- awinic,aw20072
33+
- awinic,aw20108
2934

3035
reg:
3136
maxItems: 1
@@ -36,13 +41,11 @@ properties:
3641
"#size-cells":
3742
const: 0
3843

39-
awinic,display-rows:
40-
$ref: /schemas/types.yaml#/definitions/uint32
41-
description:
42-
Leds matrix size
44+
enable-gpios:
45+
maxItems: 1
4346

4447
patternProperties:
45-
"^led@[0-9a-f]$":
48+
"^led@[0-9a-f]+$":
4649
type: object
4750
$ref: common.yaml#
4851
unevaluatedProperties: false
@@ -60,16 +63,11 @@ patternProperties:
6063
since the chip has a single global setting.
6164
The maximum output current of each LED is calculated by the
6265
following formula:
63-
IMAXled = 160000 * (592 / 600.5) * (1 / display-rows)
66+
IMAXled = 160000 * (592 / 600.5) * (1 / max-current-switch-number)
6467
And the minimum output current formula:
65-
IMINled = 3300 * (592 / 600.5) * (1 / display-rows)
66-
67-
required:
68-
- compatible
69-
- reg
70-
- "#address-cells"
71-
- "#size-cells"
72-
- awinic,display-rows
68+
IMINled = 3300 * (592 / 600.5) * (1 / max-current-switch-number)
69+
where max-current-switch-number is determinated by led configuration
70+
and depends on how leds are physically connected to the led driver.
7371
7472
allOf:
7573
- if:
@@ -78,18 +76,67 @@ allOf:
7876
contains:
7977
const: awinic,aw20036
8078
then:
79+
patternProperties:
80+
"^led@[0-9a-f]+$":
81+
properties:
82+
reg:
83+
items:
84+
minimum: 0
85+
maximum: 36
86+
87+
- if:
8188
properties:
82-
awinic,display-rows:
83-
enum: [1, 2, 3]
84-
else:
89+
compatible:
90+
contains:
91+
const: awinic,aw20054
92+
then:
93+
patternProperties:
94+
"^led@[0-9a-f]+$":
95+
properties:
96+
reg:
97+
items:
98+
minimum: 0
99+
maximum: 54
100+
101+
- if:
85102
properties:
86-
awinic,display-rows:
87-
enum: [1, 2, 3, 4, 5, 6, 7]
103+
compatible:
104+
contains:
105+
const: awinic,aw20072
106+
then:
107+
patternProperties:
108+
"^led@[0-9a-f]+$":
109+
properties:
110+
reg:
111+
items:
112+
minimum: 0
113+
maximum: 72
114+
115+
- if:
116+
properties:
117+
compatible:
118+
contains:
119+
const: awinic,aw20108
120+
then:
121+
patternProperties:
122+
"^led@[0-9a-f]+$":
123+
properties:
124+
reg:
125+
items:
126+
minimum: 0
127+
maximum: 108
128+
129+
required:
130+
- compatible
131+
- reg
132+
- "#address-cells"
133+
- "#size-cells"
88134

89135
additionalProperties: false
90136

91137
examples:
92138
- |
139+
#include <dt-bindings/gpio/gpio.h>
93140
#include <dt-bindings/leds/common.h>
94141
95142
i2c {
@@ -101,7 +148,7 @@ examples:
101148
reg = <0x3a>;
102149
#address-cells = <1>;
103150
#size-cells = <0>;
104-
awinic,display-rows = <3>;
151+
enable-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
105152
106153
led@0 {
107154
reg = <0x0>;

0 commit comments

Comments
 (0)