Skip to contentSkip to conversation

Add LED driver for TI LP5562 controller

PATCH New Doug Zobel 2 participants 3 messages Jan 10, 2019 – Jan 25, 2019

lore
Share & tools
lore

Doug Zobel

author
#0 lore raw

PATCH 1/1 Add LED driver for TI LP5562 controller

Add a DM driver for the TI LP5562 4 channel LED controller. Supports independent on/off control of all 4 channels (blue/green/red/white). Supports LED_BLINK on blue/green/red channels. White channel supports LED_BLINK, but the blink period is shared with the blue channel due to controller limitations.

Doug Zobel (1):
dm: led: add TI LP5562 LED driver

 doc/device-tree-bindings/leds/leds-lp5562.txt |  61 +++
 drivers/led/Kconfig                           |   8 +
 drivers/led/Makefile                          |   1 +
 drivers/led/led_lp5562.c                      | 571 ++++++++++++++++++++++++++
 4 files changed, 641 insertions(+)
 create mode 100644 doc/device-tree-bindings/leds/leds-lp5562.txt
 create mode 100644 drivers/led/led_lp5562.c
Signature · 26 lines
2.7.4


-- 










This email and any attachments are for the exclusive use of the 
intended recipient(s) and may contain confidential and/or privileged 
information.  Inadvertent disclosure of this message does not constitute a 
waiver of any privilege, right or remedy.  If you are not the intended 
recipient, please do not directly or indirectly use, disclose or distribute 
this message, and please contact the sender and delete this email, any 
attachments and all copies.  Climate and its affiliates may use, read or 
archive email communications (including attachments) through its computer 
network, as permitted by applicable law.  Climate and its affiliates (or an 
external service provider) may also scan emails and attachments on its 
computer network to ensure systems operate efficiently and to minimize 
security risks. Thank you.
author
#1 lore raw

PATCH 1/1 dm: led: add TI LP5562 LED driver

Driver for the TI LP5562 4 channel LED controller. Supports independent on/off control of all 4 channels. Supports LED_BLINK on 3 independent channels: blue/green/red. The white channel can blink, but shares the blue channel blink rate.

---
 doc/device-tree-bindings/leds/leds-lp5562.txt |  61 +++
 drivers/led/Kconfig                           |   8 +
 drivers/led/Makefile                          |   1 +
 drivers/led/led_lp5562.c                      | 571 ++++++++++++++++++++++++++
 4 files changed, 641 insertions(+)
 create mode 100644 doc/device-tree-bindings/leds/leds-lp5562.txt
 create mode 100644 drivers/led/led_lp5562.c
doc/device-tree-bindings/leds/leds-lp5562.txt new file +61 -0
new file mode 100644
index 0000000..d6e3192
@@ -0,0 +1,61 @@
+LEDs connected to TI LP5562 controller
+
+This driver works with a TI LP5562 4-channel LED controller.
+CONFIG_LED_BLINK is supported using the controller engines.  However
+there are only 3 engines available for the 4 channels.  This means
+that the blue and white channels share the same engine.  When both
+blue and white LEDs are set to blink, they will share the same blink
+rate.  Changing the blink rate of the blue LED will affect the white
+LED and vice-versa.  Manual on/off is handled independtly for all
+4 channels.
+
+Required properties:
+  - compatible : should be "ti,lp5562-leds".
+  - #address-cells : must be 1.
+  - #size-cells : must be 0.
+  - reg : LP5562 LED controller I2C address.
+
+Optional properties:
+  - gpios : Enable GPIO
+  - ti,external_clock : Boolean, configures controller for external
+    32 kHZ clock input.  Default : false (use internal clock)
+
+Each LED is represented as a sub-node of the ti,lp5562-leds device.
+
+LED sub-node required properties:
+  - reg : PWM register number for channel
+
+LED sub-node optional properties:
+  - label : see Documentation/devicetree/bindings/leds/common.txt
+  - ti,led_current : LED current at max brightness in 100uA steps (0x00 - 0xFF)
+    Default : 0x64 (10 ma)
+
+Example:
+        leds0: lp5562 at 30 {
+                compatible = "ti,lp5562-leds";
+                #address-cells = <1>;
+                #size-cells = <0>;
+                gpios = <&gpio3 9 GPIO_ACTIVE_HIGH>;
+                reg = <0x30>;
+
+                blue at 0 {
+                        reg = <0x2>;
+                        label = "blue";
+                        ti,led_current = <0xC8>; /* 20ma */
+                };
+                green at 1 {
+                        reg = <0x3>;
+                        label = "green";
+                        ti,led_current = <0xC8>; /* 20ma */
+                };
+                red at 2 {
+                        reg = <0x4>;
+                        label = "red";
+                        ti,led_current = <0xC8>; /* 20ma */
+                };
+                white at 3 {
+                        reg = <0xE>;
+                        label = "white";
+                        ti,led_current = <0xC8>; /* 20ma */
+                };
+        };
drivers/led/Kconfig +8 -0
index 5da5c4a..101ad94 100644
@@ -28,6 +28,14 @@ config LED_BCM6358
 	  LED HW controller accessed via MMIO registers.
 	  HW has no blinking capabilities and up to 32 LEDs can be controlled.
 
+config LED_LP5562
+	bool "LED Support for LP5562"
+	depends on LED && DM_I2C
+	help
+	  This option enables support for LEDs connected to the TI LP5562
+	  4 channel I2C LED controller.  Driver fully supports blink on the
+	  B/G/R LEDs.  White LED can blink, but re-uses the period from blue.
+
 config LED_BLINK
 	bool "Support LED blinking"
 	depends on LED
drivers/led/Makefile +1 -0
index 160a8f3..ef2ce1c 100644
@@ -7,3 +7,4 @@ obj-y += led-uclass.o
 obj-$(CONFIG_LED_BCM6328) += led_bcm6328.o
 obj-$(CONFIG_LED_BCM6358) += led_bcm6358.o
 obj-$(CONFIG_$(SPL_)LED_GPIO) += led_gpio.o
+obj-$(CONFIG_LED_LP5562) += led_lp5562.o
drivers/led/led_lp5562.c new file +571 -0

571 lines not on this page · raw message

Signature · 26 lines
2.7.4


-- 










This email and any attachments are for the exclusive use of the 
intended recipient(s) and may contain confidential and/or privileged 
information.  Inadvertent disclosure of this message does not constitute a 
waiver of any privilege, right or remedy.  If you are not the intended 
recipient, please do not directly or indirectly use, disclose or distribute 
this message, and please contact the sender and delete this email, any 
attachments and all copies.  Climate and its affiliates may use, read or 
archive email communications (including attachments) through its computer 
network, as permitted by applicable law.  Climate and its affiliates (or an 
external service provider) may also scan emails and attachments on its 
computer network to ensure systems operate efficiently and to minimize 
security risks. Thank you.
#2 lore raw

PATCH 1/1 dm: led: add TI LP5562 LED driver

Quoted 19 lines · Doug Zobel

Driver for the TI LP5562 4 channel LED controller. Supports independent on/off control of all 4 channels. Supports LED_BLINK on 3 independent channels: blue/green/red. The white channel can blink, but shares the blue channel blink rate.

---
 doc/device-tree-bindings/leds/leds-lp5562.txt |  61 +++
 drivers/led/Kconfig                           |   8 +
 drivers/led/Makefile                          |   1 +
 drivers/led/led_lp5562.c                      | 571 ++++++++++++++++++++++++++
 4 files changed, 641 insertions(+)
 create mode 100644 doc/device-tree-bindings/leds/leds-lp5562.txt
 create mode 100644 drivers/led/led_lp5562.c
doc/device-tree-bindings/leds/leds-lp5562.txt new file +0 -0
new file mode 100644
index 0000000..d6e3192

doc/device-tree-bindings/leds/leds-lp5562.txt line 10

Quoted 10 lines
doc/device-tree-bindings/leds/leds-lp5562.txt new file +10 -0
@@ -0,0 +1,61 @@
+LEDs connected to TI LP5562 controller
+
+This driver works with a TI LP5562 4-channel LED controller.
+CONFIG_LED_BLINK is supported using the controller engines.  However
+there are only 3 engines available for the 4 channels.  This means
+that the blue and white channels share the same engine.  When both
+blue and white LEDs are set to blink, they will share the same blink
+rate.  Changing the blink rate of the blue LED will affect the white
+LED and vice-versa.  Manual on/off is handled independtly for all
+4 channels.

My biggest concern here is that in Linux this is handled via bindings/leds/leds-lp55xx.txt with an entirely different compatible and so forth. Since the general goal is to be able to share trees and bindings, can you rework things with that binding instead? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190125/388c7ead/attachment.sig>