Skip to content
Permalink
Browse files
leds: ktd20xx: Extension of the KTD20xx family of LED drivers from Ki…
…netic

Introducing the KTD2061/58/59/60 RGB LED drivers. The difference in
these are the address numbers on the I2C bus that the device listens to.

All KT20xx units can drive up to 12 LEDs.

Due to the hardware limitation, we can only set 7 colors and the color
black (LED off) for each LED independently and not the full RGB range.
This is because the chip only has two color registers.

To control the LEDs independently, the chip has to be configured in a
special way.

Color register 0 must be loaded with the current value 0mA, and color
register 1 must be loaded with the value 'kinetic,led-current' from the
device tree node. If the property is omitted, the register is loaded
with the default value (0x28 = 5mA).

To select a color for an LED, a combination must be written to the color
selection register of that LED. This range for selecting the value is 3
bits wide (RGB). A '0' in any of the bits uses color register '0' and a
'1' uses color register '1'.

So we could choose the following combination for each LED:
R G B
0 0 0 = Black (off)
0 0 1 = Blue
0 1 0 = green
0 1 1 = Cyan
1 0 0 = Red
1 0 1 = Magenta
1 1 0 = Yellow
1 1 1 = White

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
  • Loading branch information
feckert authored and intel-lab-lkp committed Jan 21, 2022
1 parent d949edb commit 8e24c9cc5b5a807f40eec9cc643c2ea43f75e8a3
Show file tree
Hide file tree
Showing 4 changed files with 601 additions and 0 deletions.
@@ -10632,6 +10632,12 @@ S: Maintained
F: Documentation/devicetree/bindings/leds/backlight/kinetic,ktd253.yaml
F: drivers/video/backlight/ktd253-backlight.c

KTD20XX LED CONTROLLER DRIVER
M: Florian Eckert <fe@dev.tdt.de>
L: linux-leds@vger.kernel.org
S: Maintained
F: drivers/leds/leds-ktd20xx.c

KTEST
M: Steven Rostedt <rostedt@goodmis.org>
M: John Hawley <warthog9@eaglescrag.net>
@@ -157,6 +157,18 @@ config LEDS_EL15203000
To compile this driver as a module, choose M here: the module
will be called leds-el15203000.

config LEDS_KTD20XX
tristate "LED Support for KTD2061/58/59/60 LED driver chip"
depends on LEDS_CLASS && I2C
depends on LEDS_CLASS_MULTICOLOR
select REGMAP_I2C
help
If you say yes here you get support for the Kinetic
KTD2061, KTD2058, KTD2059 and KTD2060 LED driver.

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

config LEDS_TURRIS_OMNIA
tristate "LED support for CZ.NIC's Turris Omnia"
depends on LEDS_CLASS_MULTICOLOR
@@ -34,6 +34,7 @@ obj-$(CONFIG_LEDS_IP30) += leds-ip30.o
obj-$(CONFIG_LEDS_IPAQ_MICRO) += leds-ipaq-micro.o
obj-$(CONFIG_LEDS_IS31FL319X) += leds-is31fl319x.o
obj-$(CONFIG_LEDS_IS31FL32XX) += leds-is31fl32xx.o
obj-${CONFIG_LEDS_KTD20XX} += leds-ktd20xx.o
obj-$(CONFIG_LEDS_LM3530) += leds-lm3530.o
obj-$(CONFIG_LEDS_LM3532) += leds-lm3532.o
obj-$(CONFIG_LEDS_LM3533) += leds-lm3533.o

0 comments on commit 8e24c9c

Please sign in to comment.