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
48 changes: 48 additions & 0 deletions Documentation/ABI/testing/sysfs-class-led-driver-ltc3220
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
What: /sys/class/leds/<led>/shutdown
Date: November 2025
Contact: Edelweise Escala <edelweise.escala@analog.com>
Description: LTC3220 shutdown command. If you write 1 it
shuts down part while preserving data in registers.
If you write 0 device is in normal operation.

What: /sys/class/leds/<led>/force_cpo_mode
Date: November 2025
Contact: Edelweise Escala <edelweise.escala@analog.com>
Description: LTC3220 force charge pump settings (0..3):
0 - Enables mode logic to control mode changes based on dropout signal
1 - Forces charge pump into 1.5x mode
2 - Forces charge pump into 2x mode
3 - Forces charge pump into 1x mode

What: /sys/class/leds/<led>/quick_write
Date: November 2025
Contact: Edelweise Escala <edelweise.escala@analog.com>
Description: LTC3220 quick_write setting. LTC3220 has a quick write configuration
which allows parallel write on all 18 LED registers, when data is being written on
REG1. If you write 1 quick_write is enabled, 0 to disable.

What: /sys/class/leds/<led>/gradation_speed
Date: November 2025
Contact: Edelweise Escala <edelweise.escala@analog.com>
Description: LTC3220 gradation speed (0..3) where:
0 - disabled
1 - Ramp time of 0.24s and Period of 0.313s
2 - Ramp time of 0.48s and Period of 0.625s
3 - Ramp time of 0.96s and Period of 1.25s

What: /sys/class/leds/<led>/gradation_is_increasing
Date: November 2025
Contact: Edelweise Escala <edelweise.escala@analog.com>
Description: LTC3220 gradation increasing command. This sets if gradation
will ramp up or down. If you write 1 it gradation will ramp up, 0 will
ramp down.

What: /sys/class/leds/<led>/blink_cfg
Date: November 2025
Contact: Edelweise Escala <edelweise.escala@analog.com>
Description: LTC3220 device blink setting. The blink settings for all LEDs
(0..3) where:
0 - On Time of 0.625s and Period of 1.25s
1 - On Time of 0.156s and Period of 1.25s
2 - On Time of 0.625s and Period of 2.5s
3 - On Time of 0.156s and Period of 2.5s
114 changes: 114 additions & 0 deletions Documentation/devicetree/bindings/leds/leds-ltc3220.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just regarding the commit subject. Don't say "add bindings". That is pretty obvious. Instead something like "Document LTC3220 18 channel LED Driver"

%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 <edelweise.escala@analog.com>

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

patternProperties:
"(^led@([1-9]|1[0-8])$|led)":
type: object
$ref: common.yaml#
Copy link
Collaborator

Choose a reason for hiding this comment

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

you need unevaluatedProperties: false

unevaluatedProperties: false
properties:
reg:
description: Output channel for the LED. reg value to output to LED output number
enum:
- 1 # LED output D1
- 2 # LED output D2
- 3 # LED output D3
- 4 # LED output D4
- 5 # LED output D5
- 6 # LED output D6
- 7 # LED output D7
- 8 # LED output D8
- 9 # LED output D9
- 10 # LED output D10
- 11 # LED output D11
- 12 # LED output D12
- 13 # LED output D13
- 14 # LED output D14
- 15 # LED output D15
- 16 # LED output D16
- 17 # LED output D17
- 18 # LED output D18
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess the reg property is required in the child node.

required:
- reg

required:
- compatible
- reg
- reset-gpios

additionalProperties: false

examples:
- |
#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 0>;

led@1 {
reg = <1>;
};

led@2 {
reg = <2>;
};

led@3 {
reg = <3>;
};

led@4 {
reg = <4>;
};

led@5 {
reg = <5>;
};

led@6 {
reg = <6>;
};
};
};

...
1 change: 1 addition & 0 deletions Kconfig.adi
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ config KERNEL_ALL_ADI_DRIVERS
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
Expand Up @@ -931,6 +931,16 @@ config LEDS_LM36274
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
Loading