Skip to content

Commit f80fa18

Browse files
committed
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
Pull LED driver updates from Jacek Anaszewski: "Three new LED class drivers and some minor fixes and improvementes to the leds-gpio driver, LED Trigger core and documentation" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: leds: triggers: Check return value of kobject_uevent_env() leds: triggers: Return from led_trigger_set() if there is nothing to do leds: gpio: fix and simplify error handling in gpio_leds_create leds: gpio: switch to managed version of led_classdev_register leds: gpio: fix and simplify reading property "label" leds: gpio: simplify gpio_leds_create leds: gpio: add helper cdev_to_gpio_led_data leds: gpio: fix an unhandled error case in create_gpio_led leds: gpio: introduce gpio_blink_set_t leds: add driver for Mellanox systems LEDs Documentation: move oneshot trigger attributes documentation to ABI leds: centralize definition of "default-state" property leds: add PM8058 LEDs driver leds: pm8058: add device tree bindings leds: do not overflow sysfs buffer in led_trigger_show leds: make triggers explicitly non-modular DT: leds: Add bindings for ISSI is31fl319x leds: is31fl319x: 1/3/6/9-channel light effect led driver
2 parents 21f54dd + 6f3bad9 commit f80fa18

20 files changed

Lines changed: 1446 additions & 99 deletions

‎Documentation/ABI/testing/sysfs-class-led‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Description:
2424
of led events.
2525
You can change triggers in a similar manner to the way an IO
2626
scheduler is chosen. Trigger specific parameters can appear in
27-
/sys/class/leds/<led> once a given trigger is selected.
27+
/sys/class/leds/<led> once a given trigger is selected. For
28+
their documentation see sysfs-class-led-trigger-*.
2829

2930
What: /sys/class/leds/<led>/inverted
3031
Date: January 2011
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
What: /sys/class/leds/<led>/delay_on
2+
Date: Jun 2012
3+
KernelVersion: 3.6
4+
Contact: linux-leds@vger.kernel.org
5+
Description:
6+
Specifies for how many milliseconds the LED has to stay at
7+
LED_FULL brightness after it has been armed.
8+
Defaults to 100 ms.
9+
10+
What: /sys/class/leds/<led>/delay_off
11+
Date: Jun 2012
12+
KernelVersion: 3.6
13+
Contact: linux-leds@vger.kernel.org
14+
Description:
15+
Specifies for how many milliseconds the LED has to stay at
16+
LED_OFF brightness after it has been armed.
17+
Defaults to 100 ms.
18+
19+
What: /sys/class/leds/<led>/invert
20+
Date: Jun 2012
21+
KernelVersion: 3.6
22+
Contact: linux-leds@vger.kernel.org
23+
Description:
24+
Reverse the blink logic. If set to 0 (default) blink on for
25+
delay_on ms, then blink off for delay_off ms, leaving the LED
26+
normally off. If set to 1, blink off for delay_off ms, then
27+
blink on for delay_on ms, leaving the LED normally on.
28+
Setting this value also immediately changes the LED state.
29+
30+
What: /sys/class/leds/<led>/shot
31+
Date: Jun 2012
32+
KernelVersion: 3.6
33+
Contact: linux-leds@vger.kernel.org
34+
Description:
35+
Write any non-empty string to signal an events, this starts a
36+
blink sequence if not already running.

‎Documentation/devicetree/bindings/leds/common.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ Optional properties for child nodes:
1919
a device, i.e. no other LED class device can be assigned the same
2020
label.
2121

22+
- default-state : The initial state of the LED. Valid values are "on", "off",
23+
and "keep". If the LED is already on or off and the default-state property is
24+
set the to same value, then no glitch should be produced where the LED
25+
momentarily turns off (or on). The "keep" setting will keep the LED at
26+
whatever its current state is, without producing a glitch. The default is
27+
off if this property is not present.
28+
2229
- linux,default-trigger : This parameter, if present, is a
2330
string defining the trigger assigned to the LED. Current triggers are:
2431
"backlight" - LED will act as a back-light, controlled by the framebuffer

‎Documentation/devicetree/bindings/leds/leds-bcm6328.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ LED sub-node optional properties:
4949
- active-low : Boolean, makes LED active low.
5050
Default : false
5151
- default-state : see
52-
Documentation/devicetree/bindings/leds/leds-gpio.txt
52+
Documentation/devicetree/bindings/leds/common.txt
5353
- linux,default-trigger : see
5454
Documentation/devicetree/bindings/leds/common.txt
5555

‎Documentation/devicetree/bindings/leds/leds-bcm6358.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LED sub-node optional properties:
2828
- active-low : Boolean, makes LED active low.
2929
Default : false
3030
- default-state : see
31-
Documentation/devicetree/bindings/leds/leds-gpio.txt
31+
Documentation/devicetree/bindings/leds/common.txt
3232
- linux,default-trigger : see
3333
Documentation/devicetree/bindings/leds/common.txt
3434

‎Documentation/devicetree/bindings/leds/leds-gpio.txt‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@ LED sub-node properties:
1414
see Documentation/devicetree/bindings/leds/common.txt
1515
- linux,default-trigger : (optional)
1616
see Documentation/devicetree/bindings/leds/common.txt
17-
- default-state: (optional) The initial state of the LED. Valid
18-
values are "on", "off", and "keep". If the LED is already on or off
19-
and the default-state property is set the to same value, then no
20-
glitch should be produced where the LED momentarily turns off (or
21-
on). The "keep" setting will keep the LED at whatever its current
22-
state is, without producing a glitch. The default is off if this
23-
property is not present.
17+
- default-state: (optional) The initial state of the LED.
18+
see Documentation/devicetree/bindings/leds/common.txt
2419
- retain-state-suspended: (optional) The suspend state can be retained.Such
2520
as charge-led gpio.
2621
- panic-indicator : (optional)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
LEDs connected to is31fl319x LED controller chip
2+
3+
Required properties:
4+
- compatible : Should be any of
5+
"issi,is31fl3190"
6+
"issi,is31fl3191"
7+
"issi,is31fl3193"
8+
"issi,is31fl3196"
9+
"issi,is31fl3199"
10+
"si-en,sn3199".
11+
- #address-cells: Must be 1.
12+
- #size-cells: Must be 0.
13+
- reg: 0x64, 0x65, 0x66, or 0x67.
14+
15+
Optional properties:
16+
- audio-gain-db : audio gain selection for external analog modulation input.
17+
Valid values: 0 - 21, step by 3 (rounded down)
18+
Default: 0
19+
20+
Each led is represented as a sub-node of the issi,is31fl319x device.
21+
There can be less leds subnodes than the chip can support but not more.
22+
23+
Required led sub-node properties:
24+
- reg : number of LED line
25+
Valid values: 1 - number of leds supported by the chip variant.
26+
27+
Optional led sub-node properties:
28+
- label : see Documentation/devicetree/bindings/leds/common.txt.
29+
- linux,default-trigger :
30+
see Documentation/devicetree/bindings/leds/common.txt.
31+
- led-max-microamp : (optional)
32+
Valid values: 5000 - 40000, step by 5000 (rounded down)
33+
Default: 20000 (20 mA)
34+
Note: a driver will take the lowest of all led limits since the
35+
chip has a single global setting. The lowest value will be chosen
36+
due to the PWM specificity, where lower brightness is achieved
37+
by reducing the dury-cycle of pulses and not the current, which
38+
will always have its peak value equal to led-max-microamp.
39+
40+
Examples:
41+
42+
fancy_leds: leds@65 {
43+
compatible = "issi,is31fl3196";
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
reg = <0x65>;
47+
48+
red_aux: led@1 {
49+
label = "red:aux";
50+
reg = <1>;
51+
led-max-microamp = <10000>;
52+
};
53+
54+
green_power: led@5 {
55+
label = "green:power";
56+
reg = <5>;
57+
linux,default-trigger = "default-on";
58+
};
59+
};
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Qualcomm PM8058 LED driver
2+
3+
The Qualcomm PM8058 is a multi-functional device which contains
4+
an LED driver block for up to six LEDs: three normal LEDs, two
5+
"flash" LEDs and one "keypad backlight" LED. The names are
6+
quoted because sometimes these LED drivers are used for wildly
7+
different things than flash or keypad backlight: their names
8+
are more of a suggestion than a hard-wired usecase.
9+
10+
Hardware-wise the different LEDs support slightly different
11+
output currents. The "flash" LEDs do not need to charge nor
12+
do they support external triggers. They are just powerful LED
13+
drivers.
14+
15+
The LEDs appear as children to the PM8058 device, with the
16+
proper compatible string. For the PM8058 bindings see:
17+
mfd/qcom-pm8xxx.txt.
18+
19+
Each LED is represented as a sub-node of the syscon device. Each
20+
node's name represents the name of the corresponding LED.
21+
22+
LED sub-node properties:
23+
24+
Required properties:
25+
- compatible: one of
26+
"qcom,pm8058-led" (for the normal LEDs at 0x131, 0x132 and 0x133)
27+
"qcom,pm8058-keypad-led" (for the "keypad" LED at 0x48)
28+
"qcom,pm8058-flash-led" (for the "flash" LEDs at 0x49 and 0xFB)
29+
30+
Optional properties:
31+
- label: see Documentation/devicetree/bindings/leds/common.txt
32+
- default-state: see Documentation/devicetree/bindings/leds/common.txt
33+
- linux,default-trigger: see Documentation/devicetree/bindings/leds/common.txt
34+
35+
Example:
36+
37+
qcom,ssbi@500000 {
38+
pmicintc: pmic@0 {
39+
compatible = "qcom,pm8058";
40+
led@48 {
41+
compatible = "qcom,pm8058-keypad-led";
42+
reg = <0x48>;
43+
label = "pm8050:white:keypad";
44+
default-state = "off";
45+
};
46+
led@131 {
47+
compatible = "qcom,pm8058-led";
48+
reg = <0x131>;
49+
label = "pm8058:red";
50+
default-state = "off";
51+
};
52+
led@132 {
53+
compatible = "qcom,pm8058-led";
54+
reg = <0x132>;
55+
label = "pm8058:yellow";
56+
default-state = "off";
57+
linux,default-trigger = "mmc0";
58+
};
59+
led@133 {
60+
compatible = "qcom,pm8058-led";
61+
reg = <0x133>;
62+
label = "pm8058:green";
63+
default-state = "on";
64+
linux,default-trigger = "heartbeat";
65+
};
66+
};
67+
};

‎Documentation/devicetree/bindings/leds/register-bit-led.txt‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@ Optional properties:
2323
see Documentation/devicetree/bindings/leds/common.txt
2424
- linux,default-trigger : (optional)
2525
see Documentation/devicetree/bindings/leds/common.txt
26-
- default-state: (optional) The initial state of the LED. Valid
27-
values are "on", "off", and "keep". If the LED is already on or off
28-
and the default-state property is set the to same value, then no
29-
glitch should be produced where the LED momentarily turns off (or
30-
on). The "keep" setting will keep the LED at whatever its current
31-
state is, without producing a glitch. The default is off if this
32-
property is not present.
26+
- default-state: (optional) The initial state of the LED
27+
see Documentation/devicetree/bindings/leds/common.txt
3328

3429
Example:
3530

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
Kernel driver for Mellanox systems LEDs
2+
=======================================
3+
4+
Provide system LED support for the nex Mellanox systems:
5+
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410",
6+
"msn2410", "msb7800", "msn2740", "msn2100".
7+
8+
Description
9+
-----------
10+
Driver provides the following LEDs for the systems "msx6710", "msx6720",
11+
"msb7700", "msn2700", "msx1410", "msn2410", "msb7800", "msn2740":
12+
mlxcpld:fan1:green
13+
mlxcpld:fan1:red
14+
mlxcpld:fan2:green
15+
mlxcpld:fan2:red
16+
mlxcpld:fan3:green
17+
mlxcpld:fan3:red
18+
mlxcpld:fan4:green
19+
mlxcpld:fan4:red
20+
mlxcpld:psu:green
21+
mlxcpld:psu:red
22+
mlxcpld:status:green
23+
mlxcpld:status:red
24+
25+
"status"
26+
CPLD reg offset: 0x20
27+
Bits [3:0]
28+
29+
"psu"
30+
CPLD reg offset: 0x20
31+
Bits [7:4]
32+
33+
"fan1"
34+
CPLD reg offset: 0x21
35+
Bits [3:0]
36+
37+
"fan2"
38+
CPLD reg offset: 0x21
39+
Bits [7:4]
40+
41+
"fan3"
42+
CPLD reg offset: 0x22
43+
Bits [3:0]
44+
45+
"fan4"
46+
CPLD reg offset: 0x22
47+
Bits [7:4]
48+
49+
Color mask for all the above LEDs:
50+
[bit3,bit2,bit1,bit0] or
51+
[bit7,bit6,bit5,bit4]:
52+
[0,0,0,0] = LED OFF
53+
[0,1,0,1] = Red static ON
54+
[1,1,0,1] = Green static ON
55+
[0,1,1,0] = Red blink 3Hz
56+
[1,1,1,0] = Green blink 3Hz
57+
[0,1,1,1] = Red blink 6Hz
58+
[1,1,1,1] = Green blink 6Hz
59+
60+
Driver provides the following LEDs for the system "msn2100":
61+
mlxcpld:fan:green
62+
mlxcpld:fan:red
63+
mlxcpld:psu1:green
64+
mlxcpld:psu1:red
65+
mlxcpld:psu2:green
66+
mlxcpld:psu2:red
67+
mlxcpld:status:green
68+
mlxcpld:status:red
69+
mlxcpld:uid:blue
70+
71+
"status"
72+
CPLD reg offset: 0x20
73+
Bits [3:0]
74+
75+
"fan"
76+
CPLD reg offset: 0x21
77+
Bits [3:0]
78+
79+
"psu1"
80+
CPLD reg offset: 0x23
81+
Bits [3:0]
82+
83+
"psu2"
84+
CPLD reg offset: 0x23
85+
Bits [7:4]
86+
87+
"uid"
88+
CPLD reg offset: 0x24
89+
Bits [3:0]
90+
91+
Color mask for all the above LEDs, excepted uid:
92+
[bit3,bit2,bit1,bit0] or
93+
[bit7,bit6,bit5,bit4]:
94+
[0,0,0,0] = LED OFF
95+
[0,1,0,1] = Red static ON
96+
[1,1,0,1] = Green static ON
97+
[0,1,1,0] = Red blink 3Hz
98+
[1,1,1,0] = Green blink 3Hz
99+
[0,1,1,1] = Red blink 6Hz
100+
[1,1,1,1] = Green blink 6Hz
101+
102+
Color mask for uid LED:
103+
[bit3,bit2,bit1,bit0]:
104+
[0,0,0,0] = LED OFF
105+
[1,1,0,1] = Blue static ON
106+
[1,1,1,0] = Blue blink 3Hz
107+
[1,1,1,1] = Blue blink 6Hz
108+
109+
Driver supports HW blinking at 3Hz and 6Hz frequency (50% duty cycle).
110+
For 3Hz duty cylce is about 167 msec, for 6Hz is about 83 msec.

0 commit comments

Comments
 (0)