Skip to content

Commit db3ecde

Browse files
committed
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED subsystem update from Bryan Wu: "The big change of LED subsystem is introducing a new LED class for Flash type LEDs which will be used for V4L2 subsystem. Also we got some cleanup and fixes" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: leds: leds-gpio: Pass on error codes unmodified DT: leds: Add led-sources property leds: Add LED Flash class extension to the LED subsystem leds: leds-mc13783: Use of_get_child_by_name() instead of refcount hack leds: Use setup_timer leds: Don't allow brightness values greater than max_brightness DT: leds: Add flash LED devices related properties
2 parents a42cf70 + c6e71f8 commit db3ecde

10 files changed

Lines changed: 748 additions & 8 deletions

File tree

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
Common leds properties.
22

3+
LED and flash LED devices provide the same basic functionality as current
4+
regulators, but extended with LED and flash LED specific features like
5+
blinking patterns, flash timeout, flash faults and external flash strobe mode.
6+
7+
Many LED devices expose more than one current output that can be connected
8+
to one or more discrete LED component. Since the arrangement of connections
9+
can influence the way of the LED device initialization, the LED components
10+
have to be tightly coupled with the LED device binding. They are represented
11+
by child nodes of the parent LED device binding.
12+
313
Optional properties for child nodes:
14+
- led-sources : List of device current outputs the LED is connected to. The
15+
outputs are identified by the numbers that must be defined
16+
in the LED device binding documentation.
417
- label : The label for this LED. If omitted, the label is
518
taken from the node name (excluding the unit address).
619

@@ -14,10 +27,27 @@ Optional properties for child nodes:
1427
"ide-disk" - LED indicates disk activity
1528
"timer" - LED flashes at a fixed, configurable rate
1629

30+
- max-microamp : maximum intensity in microamperes of the LED
31+
(torch LED for flash devices)
32+
- flash-max-microamp : maximum intensity in microamperes of the
33+
flash LED; it is mandatory if the LED should
34+
support the flash mode
35+
- flash-timeout-us : timeout in microseconds after which the flash
36+
LED is turned off
37+
38+
1739
Examples:
1840

1941
system-status {
2042
label = "Status";
2143
linux,default-trigger = "heartbeat";
2244
...
2345
};
46+
47+
camera-flash {
48+
label = "Flash";
49+
led-sources = <0>, <1>;
50+
max-microamp = <50000>;
51+
flash-max-microamp = <320000>;
52+
flash-timeout-us = <500000>;
53+
};

‎drivers/leds/Kconfig‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ config LEDS_CLASS
2222
This option enables the led sysfs class in /sys/class/leds. You'll
2323
need this to do anything useful with LEDs. If unsure, say N.
2424

25+
config LEDS_CLASS_FLASH
26+
tristate "LED Flash Class Support"
27+
depends on LEDS_CLASS
28+
help
29+
This option enables the flash led sysfs class in /sys/class/leds.
30+
It wrapps LED Class and adds flash LEDs specific sysfs attributes
31+
and kernel internal API to it. You'll need this to provide support
32+
for the flash related features of a LED device. It can be built
33+
as a module.
34+
2535
comment "LED drivers"
2636

2737
config LEDS_88PM860X

‎drivers/leds/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# LED Core
33
obj-$(CONFIG_NEW_LEDS) += led-core.o
44
obj-$(CONFIG_LEDS_CLASS) += led-class.o
5+
obj-$(CONFIG_LEDS_CLASS_FLASH) += led-class-flash.o
56
obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o
67

78
# LED Platform Drivers

0 commit comments

Comments
 (0)