Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions Documentation/devicetree/bindings/leds/leds-ltc3220.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/leds-ltc3220.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices LTC3220 LED Drivers

maintainers:
- Edelweise Escala <[email protected]>

description: Bindings for the Analog Devices LTC3220 18 channel LED Drivers.

For more product information please see the link below
https://www.analog.com/en/products/ltc3220.html

properties:
compatible:
enum:
- adi,ltc3220
- adi,ltc3220-1

reg:
maxItems: 1

'#address-cells':
const: 1

'#size-cells':
const: 0

reset-gpios:
maxItems: 1
description: GPIO attached to the chip's reset pin

adi,force-cpo-level:
$ref: /schemas/types.yaml#/definitions/string
description: Forces the Charge Pump Output to a specified multiplier.
enum:
- "0" # Auto(default) - Automatically selects optimal charge pump mode
- "1.5"
- "2"
- "1"
default: "0"

adi,quick-write:
type: boolean
description: If present, LED 1 output becomes a master control that
simultaneously updates all 18 LED outputs using the hardware's quick-write
mode. When enabled, led@1 must be defined in the device tree to provide
the control interface, even if no physical LED is connected to the D1
output pin. When disabled or not present, LED 1 operates as a normal
independent LED output.

patternProperties:
"^led@([1-9]|1[0-8])$":
type: object
$ref: /schemas/leds/common.yaml#
unevaluatedProperties: false
properties:
reg:
description: Output channel for the LED (1-18 maps to LED outputs D1-D18).
minimum: 1
maximum: 18

required:
- reg

required:
- compatible
- reg

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>

i2c {
#address-cells = <1>;
#size-cells = <0>;

led-controller@1c {
compatible = "adi,ltc3220";
reg = <0x1c>;
#address-cells = <1>;
#size-cells = <0>;
reset-gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
adi,force-cpo-level = "0";
adi,quick-write;

led@1 {
reg = <1>;
function = LED_FUNCTION_INDICATOR;
function-enumerator = <1>;
};

led@2 {
reg = <2>;
function = LED_FUNCTION_INDICATOR;
function-enumerator = <2>;
};

led@3 {
reg = <3>;
function = LED_FUNCTION_INDICATOR;
function-enumerator = <3>;
};

led@4 {
reg = <4>;
function = LED_FUNCTION_INDICATOR;
function-enumerator = <4>;
};

led@5 {
reg = <5>;
function = LED_FUNCTION_INDICATOR;
function-enumerator = <5>;
};

led@6 {
reg = <6>;
function = LED_FUNCTION_INDICATOR;
function-enumerator = <6>;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some of the properties coming from common.yaml that the device supports. Otherwise I wonder why we $ref it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added function and function-enumerator.

};
};

...
1 change: 1 addition & 0 deletions Kconfig.adi
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

# This file exists solely to be include in the main Kconfig

Expand Down Expand Up @@ -71,6 +71,7 @@
imply PMIC_ADP5520
imply PWM_AXI_PWMGEN
imply LEDS_ADP5520
imply LEDS_LTC3220
imply BACKLIGHT_ADP5520
imply BACKLIGHT_ADP8860
imply BACKLIGHT_ADP8870
Expand Down
10 changes: 10 additions & 0 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
config LEDS_GPIO_REGISTER
bool
Expand Down Expand Up @@ -931,6 +931,16 @@
Say Y to enable the LM36274 LED driver for TI LMU devices.
This supports the LED device LM36274.

config LEDS_LTC3220
tristate "LED Driver for LTC3220/LTC3220-1"
depends on I2C && LEDS_CLASS
help
If you have an 18-Channel LED Driver connected to LTC3220, or LTC3220-1
say Y here to enable this driver.

To compile this driver as a module, choose M here: the module will
be called ltc3220.

config LEDS_TPS6105X
tristate "LED support for TI TPS6105X"
depends on LEDS_CLASS
Expand Down
1 change: 1 addition & 0 deletions drivers/leds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ obj-$(CONFIG_LEDS_LP8501) += leds-lp8501.o
obj-$(CONFIG_LEDS_LP8788) += leds-lp8788.o
obj-$(CONFIG_LEDS_LP8860) += leds-lp8860.o
obj-$(CONFIG_LEDS_LT3593) += leds-lt3593.o
obj-$(CONFIG_LEDS_LTC3220) += leds-ltc3220.o
obj-$(CONFIG_LEDS_MAX5970) += leds-max5970.o
obj-$(CONFIG_LEDS_MAX77650) += leds-max77650.o
obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o
Expand Down
Loading