Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings: leds: Add generic LED consumer documentation

Introduce common generic led consumer binding, where consumer defines
led(s) by phandle, as opposed to trigger-source binding where the
trigger source is defined in led itself.

Add already used in some schemas 'leds' parameter which expects
phandle-array. Additionally, introduce 'led-names' which could be used
by consumers to map LED devices to their respective functions.

Signed-off-by: Aleksandrs Vinarskis <alex@vinarskis.com>
Reviewed-by: "Rob Herring (Arm)" <robh@kernel.org>
Link: https://lore.kernel.org/r/20250910-leds-v5-1-bb90a0f897d5@vinarskis.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Aleksandrs Vinarskis and committed by
Lee Jones
3f5df639 96e048fa

+67
+67
Documentation/devicetree/bindings/leds/leds-consumer.yaml
··· 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-consumer.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Common leds consumer 8 + 9 + maintainers: 10 + - Aleksandrs Vinarskis <alex@vinarskis.com> 11 + 12 + description: 13 + Some LED defined in DT are required by other DT consumers, for example 14 + v4l2 subnode may require privacy or flash LED. Unlike trigger-source 15 + approach which is typically used as 'soft' binding, referencing LED 16 + devices by phandle makes things simpler when 'hard' binding is desired. 17 + 18 + Document LED properties that its consumers may define. 19 + 20 + select: true 21 + 22 + properties: 23 + leds: 24 + oneOf: 25 + - type: object 26 + - $ref: /schemas/types.yaml#/definitions/phandle-array 27 + description: 28 + A list of LED device(s) required by a particular consumer. 29 + items: 30 + maxItems: 1 31 + 32 + led-names: 33 + description: 34 + A list of device name(s). Used to map LED devices to their respective 35 + functions, when consumer requires more than one LED. 36 + 37 + additionalProperties: true 38 + 39 + examples: 40 + - | 41 + #include <dt-bindings/gpio/gpio.h> 42 + #include <dt-bindings/leds/common.h> 43 + 44 + leds { 45 + compatible = "gpio-leds"; 46 + 47 + privacy_led: privacy-led { 48 + color = <LED_COLOR_ID_RED>; 49 + default-state = "off"; 50 + function = LED_FUNCTION_INDICATOR; 51 + gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>; 52 + }; 53 + }; 54 + 55 + i2c { 56 + #address-cells = <1>; 57 + #size-cells = <0>; 58 + 59 + v4l2_node: camera@36 { 60 + reg = <0x36>; 61 + 62 + leds = <&privacy_led>; 63 + led-names = "privacy"; 64 + }; 65 + }; 66 + 67 + ...