Skip to content

Commit e4a7b2d

Browse files
committed
Merge tag 'leds-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds
Pull LED updates from Pavel Machek: "Okay, so... this one is interesting. RGB LEDs are very common, and we need to have some kind of support for them. Multicolor is for arbitrary set of LEDs in one package, RGB is for LEDs that can produce full range of colors. We do not have real multicolor LED that is not RGB in the pipeline, so that one is disabled for now. You can expect this saga to continue with next pull requests" * tag 'leds-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: (37 commits) MAINTAINERS: Remove myself as LED subsystem maintainer leds: disallow /sys/class/leds/*:multi:* for now leds: add RGB color option, as that is different from multicolor. Make LEDS_LP55XX_COMMON depend on I2C to fix build errors: Documentation: ABI: leds-turris-omnia: document sysfs attribute leds: initial support for Turris Omnia LEDs dt-bindings: leds: add cznic,turris-omnia-leds binding leds: pattern trigger -- check pattern for validity leds: Replace HTTP links with HTTPS ones leds: trigger: add support for LED-private device triggers leds: lp5521: Add multicolor framework multicolor brightness support leds: lp5523: Update the lp5523 code to add multicolor brightness function leds: lp55xx: Add multicolor framework support to lp55xx leds: lp55xx: Convert LED class registration to devm_* dt-bindings: leds: Convert leds-lp55xx to yaml leds: multicolor: Introduce a multicolor class definition leds: Add multicolor ID to the color ID list dt: bindings: Add multicolor class dt bindings documention leds: lp5523: Fix various formatting issues in the code leds: lp55xx: Fix file permissions to use DEVICE_ATTR macros ...
2 parents fffe3ae + bba3747 commit e4a7b2d

Some content is hidden

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

50 files changed

+1640
-453
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
What: /sys/class/leds/<led>/device/brightness
2+
Date: July 2020
3+
KernelVersion: 5.9
4+
Contact: Marek Behún <[email protected]>
5+
Description: (RW) On the front panel of the Turris Omnia router there is also
6+
a button which can be used to control the intensity of all the
7+
LEDs at once, so that if they are too bright, user can dim them.
8+
9+
The microcontroller cycles between 8 levels of this global
10+
brightness (from 100% to 0%), but this setting can have any
11+
integer value between 0 and 100. It is therefore convenient to be
12+
able to change this setting from software.
13+
14+
Format: %i
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
What: /sys/class/leds/<led>/brightness
2+
Date: March 2020
3+
KernelVersion: 5.9
4+
Contact: Dan Murphy <[email protected]>
5+
Description: read/write
6+
Writing to this file will update all LEDs within the group to a
7+
calculated percentage of what each color LED intensity is set
8+
to. The percentage is calculated for each grouped LED via the
9+
equation below:
10+
11+
led_brightness = brightness * multi_intensity/max_brightness
12+
13+
For additional details please refer to
14+
Documentation/leds/leds-class-multicolor.rst.
15+
16+
The value of the LED is from 0 to
17+
/sys/class/leds/<led>/max_brightness.
18+
19+
What: /sys/class/leds/<led>/multi_index
20+
Date: March 2020
21+
KernelVersion: 5.9
22+
Contact: Dan Murphy <[email protected]>
23+
Description: read
24+
The multi_index array, when read, will output the LED colors
25+
as an array of strings as they are indexed in the
26+
multi_intensity file.
27+
28+
What: /sys/class/leds/<led>/multi_intensity
29+
Date: March 2020
30+
KernelVersion: 5.9
31+
Contact: Dan Murphy <[email protected]>
32+
Description: read/write
33+
This file contains array of integers. Order of components is
34+
described by the multi_index array. The maximum intensity should
35+
not exceed /sys/class/leds/<led>/max_brightness.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/cznic,turris-omnia-leds.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: CZ.NIC's Turris Omnia LEDs driver
8+
9+
maintainers:
10+
- Marek Behún <[email protected]>
11+
12+
description:
13+
This module adds support for the RGB LEDs found on the front panel of the
14+
Turris Omnia router. There are 12 RGB LEDs that are controlled by a
15+
microcontroller that communicates via the I2C bus. Each LED is described
16+
as a subnode of this I2C device.
17+
18+
properties:
19+
compatible:
20+
const: cznic,turris-omnia-leds
21+
22+
reg:
23+
description: I2C slave address of the microcontroller.
24+
maxItems: 1
25+
26+
"#address-cells":
27+
const: 1
28+
29+
"#size-cells":
30+
const: 0
31+
32+
patternProperties:
33+
"^multi-led[0-9a-f]$":
34+
type: object
35+
allOf:
36+
- $ref: leds-class-multicolor.yaml#
37+
description:
38+
This node represents one of the RGB LED devices on Turris Omnia.
39+
No subnodes need to be added for subchannels since this controller only
40+
supports RGB LEDs.
41+
42+
properties:
43+
reg:
44+
minimum: 0
45+
maximum: 11
46+
description:
47+
This property identifies one of the LEDs on the front panel of the
48+
Turris Omnia router.
49+
50+
required:
51+
- reg
52+
53+
additionalProperties: false
54+
55+
examples:
56+
- |
57+
58+
#include <dt-bindings/leds/common.h>
59+
60+
i2c0 {
61+
#address-cells = <1>;
62+
#size-cells = <0>;
63+
64+
led-controller@2b {
65+
compatible = "cznic,turris-omnia-leds";
66+
reg = <0x2b>;
67+
#address-cells = <1>;
68+
#size-cells = <0>;
69+
70+
multi-led@0 {
71+
/*
72+
* No subnodes are needed, this controller only supports RGB
73+
* LEDs.
74+
*/
75+
reg = <0>;
76+
color = <LED_COLOR_ID_MULTI>;
77+
function = LED_FUNCTION_POWER;
78+
linux,default-trigger = "heartbeat";
79+
};
80+
81+
multi-led@a {
82+
reg = <0xa>;
83+
color = <LED_COLOR_ID_MULTI>;
84+
function = LED_FUNCTION_INDICATOR;
85+
function-enumerator = <1>;
86+
};
87+
};
88+
};
89+
90+
...
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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-class-multicolor.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Common properties for the multicolor LED class.
8+
9+
maintainers:
10+
- Dan Murphy <[email protected]>
11+
12+
description: |
13+
Bindings for multi color LEDs show how to describe current outputs of
14+
either integrated multi-color LED elements (like RGB, RGBW, RGBWA-UV
15+
etc.) or standalone LEDs, to achieve logically grouped multi-color LED
16+
modules. This is achieved by adding multi-led nodes layer to the
17+
monochrome LED bindings.
18+
The nodes and properties defined in this document are unique to the multicolor
19+
LED class. Common LED nodes and properties are inherited from the common.txt
20+
within this documentation directory.
21+
22+
patternProperties:
23+
"^multi-led@([0-9a-f])$":
24+
type: object
25+
description: Represents the LEDs that are to be grouped.
26+
properties:
27+
color:
28+
const: 8 # LED_COLOR_ID_MULTI
29+
description: |
30+
For multicolor LED support this property should be defined as
31+
LED_COLOR_ID_MULTI which can be found in include/linux/leds/common.h.
32+
33+
$ref: "common.yaml#"
34+
35+
required:
36+
- color
37+
...

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ led-controller@38 {
102102
};
103103

104104
For more product information please see the links below:
105-
http://www.ti.com/product/LM3532
105+
https://www.ti.com/product/LM3532

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ led-controller@64 {
4747
}
4848

4949
For more product information please see the links below:
50-
http://www.ti.com/product/LM36010
51-
http://www.ti.com/product/LM36011
50+
https://www.ti.com/product/LM36010
51+
https://www.ti.com/product/LM36011

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ lm36274@11 {
8282
};
8383

8484
For more product information please see the link below:
85-
http://www.ti.com/lit/ds/symlink/lm36274.pdf
85+
https://www.ti.com/lit/ds/symlink/lm36274.pdf

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ led-controller@36 {
6262
}
6363

6464
For more product information please see the link below:
65-
http://www.ti.com/lit/ds/snvsa29/snvsa29.pdf
65+
https://www.ti.com/lit/ds/snvsa29/snvsa29.pdf

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ led-controller@36 {
7070
}
7171

7272
For more product information please see the link below:
73-
http://www.ti.com/lit/ds/symlink/lm3697.pdf
73+
https://www.ti.com/lit/ds/symlink/lm3697.pdf

0 commit comments

Comments
 (0)