linux-loongson/Documentation/devicetree/bindings/leds/leds-aw2013.yaml
Stephan Gerhold 2cccb179ad dt-bindings: leds: Document pull-up supply for interrupt and I2C
Since the interrupt and I2C lines of AW2013 operate in open drain low
active mode a pull-up supply is needed for correct operation.
Unfortunately there is no ideal place to describe it in the DT: The
pull-up needed for the I2C lines could be described on the I2C bus.
However, the pull-up needed for the interrupt line belongs neither
directly to the interrupt controller nor to AW2013. Since the AW2013
driver will be typically in control of the power management and
interrupt masking it makes more sense to describe it inside the AW2013
device tree node.

Add it to the AW2013 DT schema together with a comment that makes it
clear what exactly it represents.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Nikita Travkin <nikita@trvn.ru>
Link: https://lore.kernel.org/r/20230815-aw2013-vio-v3-2-2505296b0856@gerhold.net
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 16:47:21 +01:00

105 lines
2.5 KiB
YAML

# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/leds-aw2013.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: AWINIC AW2013 3-channel LED Driver
maintainers:
- Nikita Travkin <nikitos.tr@gmail.com>
description: |
The AW2013 is a 3-channel LED driver with I2C interface. It can control
LED brightness with PWM output.
properties:
compatible:
const: awinic,aw2013
reg:
maxItems: 1
interrupts:
maxItems: 1
description: Open-drain, low active interrupt pin "INTN".
Used to report completion of operations (power up, LED breath effects).
vcc-supply:
description: Regulator providing power to the "VCC" pin.
vio-supply:
description: Regulator providing power for pull-up of the I/O lines.
"VIO1" in the typical application circuit example of the datasheet.
Note that this regulator does not directly connect to AW2013, but is
needed for the correct operation of the interrupt and I2C lines.
"#address-cells":
const: 1
"#size-cells":
const: 0
patternProperties:
"^led@[0-2]$":
type: object
$ref: common.yaml#
unevaluatedProperties: false
properties:
reg:
description: Index of the LED.
minimum: 0
maximum: 2
required:
- compatible
- reg
- "#address-cells"
- "#size-cells"
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
led-controller@45 {
compatible = "awinic,aw2013";
reg = <0x45>;
interrupts = <42 IRQ_TYPE_LEVEL_LOW>;
#address-cells = <1>;
#size-cells = <0>;
vcc-supply = <&pm8916_l17>;
led@0 {
reg = <0>;
led-max-microamp = <5000>;
function = LED_FUNCTION_INDICATOR;
color = <LED_COLOR_ID_RED>;
};
led@1 {
reg = <1>;
led-max-microamp = <5000>;
function = LED_FUNCTION_INDICATOR;
color = <LED_COLOR_ID_GREEN>;
};
led@2 {
reg = <2>;
led-max-microamp = <5000>;
function = LED_FUNCTION_INDICATOR;
color = <LED_COLOR_ID_BLUE>;
};
};
};
...