Documentation/devicetree/bindings/leds/leds-gpio.yaml
Source file repositories/reference/linux-study-clean/Documentation/devicetree/bindings/leds/leds-gpio.yaml
File Facts
- System
- Linux kernel
- Corpus path
Documentation/devicetree/bindings/leds/leds-gpio.yaml- Extension
.yaml- Size
- 2124 bytes
- Lines
- 86
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: configuration, schema, or hardware description
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
dt-bindings/gpio/gpio.hdt-bindings/leds/common.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/leds-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: LEDs connected to GPIO lines
maintainers:
- Jacek Anaszewski <jacek.anaszewski@gmail.com>
- Pavel Machek <pavel@ucw.cz>
description:
Each LED is represented as a sub-node of the gpio-leds device. Each
node's name represents the name of the corresponding LED.
properties:
compatible:
const: gpio-leds
patternProperties:
# The first form is preferred, but fall back to just 'led' anywhere in the
# node name to at least catch some child nodes.
"(^led-[0-9a-f]$|led)":
type: object
$ref: common.yaml#
unevaluatedProperties: false
properties:
gpios:
maxItems: 1
retain-state-suspended:
description:
The suspend state can be retained.Such as charge-led gpio.
type: boolean
retain-state-shutdown:
description:
Retain the state of the LED on shutdown. Useful in BMC systems, for
example when the BMC is rebooted while the host remains up.
type: boolean
required:
- gpios
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
leds {
compatible = "gpio-leds";
led-0 {
gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "disk-activity";
function = LED_FUNCTION_DISK;
};
led-1 {
gpios = <&mcu_pio 1 GPIO_ACTIVE_HIGH>;
/* Keep LED on if BIOS detected hardware fault */
default-state = "keep";
function = LED_FUNCTION_FAULT;
};
};
Annotation
- Immediate include surface: `dt-bindings/gpio/gpio.h`, `dt-bindings/leds/common.h`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.