LP50xx addition and remainder Multicolor patches
Subsystems (4)
v33 cover LP50xx addition and remainder Multicolor patches
Hello
These are the final patches from the original multicolor framework patchset.
Changes made were to the LP50xx to rework regmap_defaults to eliminate used only once #defines. Also fixed putting the child node in the dt parsing and changed regmap regcache type to flat.
Dan
Dan Murphy (6):
dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers
leds: lp50xx: Add the LP50XX family of the RGB LED driver
ARM: defconfig: u8500: Add LP55XX_COMMON config flag
ARM: dts: n900: Add reg property to the LP5523 channel node
ARM: dts: imx6dl-yapp4: Add reg property to the lp5562 channel node
ARM: dts: ste-href: Add reg property to the LP5521 channel nodes
.../devicetree/bindings/leds/leds-lp50xx.yaml | 130 ++++ arch/arm/boot/dts/imx6dl-yapp4-common.dtsi | 14 +- arch/arm/boot/dts/omap3-n900.dts | 29 +- arch/arm/boot/dts/ste-href.dtsi | 22 +- arch/arm/configs/u8500_defconfig | 1 + drivers/leds/Kconfig | 11 + drivers/leds/Makefile | 1 + drivers/leds/leds-lp50xx.c | 634 ++++++++++++++++++ 8 files changed, 823 insertions(+), 19 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/leds-lp50xx.yaml create mode 100644 drivers/leds/leds-lp50xx.c
Signature · 1 line
2.28.0
PATCH v33 1/6 dt: bindings: lp50xx: Introduce the lp50xx family of RGB drivers
Introduce the bindings for the Texas Instruments LP5036, LP5030, LP5024, LP5018, LP5012 and LP5009 RGB LED device driver. The LP5036/30/24/18/12/9 can control RGB LEDs individually or as part of a control bank group. These devices have the ability to adjust the mixing control for the RGB LEDs to obtain different colors independent of the overall brightness of the LED grouping.
Datasheet:
http://www.ti.com/lit/ds/symlink/lp5012.pdf
http://www.ti.com/lit/ds/symlink/lp5024.pdf
http://www.ti.com/lit/ds/symlink/lp5036.pdf
--- .../devicetree/bindings/leds/leds-lp50xx.yaml | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-lp50xx.yaml
Documentation/devicetree/bindings/leds/leds-lp50xx.yaml new file +130 -0
@@ -0,0 +1,130 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/leds-lp50xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: LED driver for LP50XX RGB LED from Texas Instruments. + +maintainers: + - Dan Murphy <[email protected]> + +description: | + The LP50XX is multi-channel, I2C RGB LED Drivers that can group RGB LEDs into + a LED group or control them individually. + + The difference in these RGB LED drivers is the number of supported RGB + modules. + + For more product information please see the link below: + https://www.ti.com/lit/ds/symlink/lp5012.pdf + https://www.ti.com/lit/ds/symlink/lp5024.pdf + https://www.ti.com/lit/ds/symlink/lp5036.pdf + +properties: + compatible: + enum: + - ti,lp5009 + - ti,lp5012 + - ti,lp5018 + - ti,lp5024 + - ti,lp5030 + - ti,lp5036 + + reg: + maxItems: 1 + description: + I2C slave address + lp5009/12 - 0x14, 0x15, 0x16, 0x17 + lp5018/24 - 0x28, 0x29, 0x2a, 0x2b + lp5030/36 - 0x30, 0x31, 0x32, 0x33 + + enable-gpios: + maxItems: 1 + description: GPIO pin to enable/disable the device. + + vled-supply: + description: LED supply. + +patternProperties: + '^multi-led@[0-9a-f]$': + type: object + allOf: + - $ref: leds-class-multicolor.yaml# + properties: + reg: + minItems: 1 + maxItems: 12 + description: + This property denotes the LED module number(s) that is used on the + for the child node. The LED modules can either be used stand alone + or grouped into a module bank. + + patternProperties: + "(^led-[0-9a-f]$|led)": + type: object + $ref: common.yaml# + +required: + - compatible + - reg + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/leds/common.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + led-controller@14 { + compatible = "ti,lp5009"; + reg = <0x14>; + #address-cells = <1>; + #size-cells = <0>; + enable-gpios = <&gpio1 16>; + + multi-led@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x1>; + color = <LED_COLOR_ID_RGB>; + function = LED_FUNCTION_CHARGING; + + led-0 { + color = <LED_COLOR_ID_RED>; + }; + + led-1 { + color = <LED_COLOR_ID_GREEN>; + }; + + led-2 { + color = <LED_COLOR_ID_BLUE>; + }; + }; + + multi-led@2 { + #address-cells = <1>; + #size-cells = <2>; + reg = <0x2 0x3 0x5>; + color = <LED_COLOR_ID_RGB>; + function = LED_FUNCTION_STANDBY; + + led-6 { + color = <LED_COLOR_ID_RED>; + }; + + led-7 { + color = <LED_COLOR_ID_GREEN>; + }; + + led-8 { + color = <LED_COLOR_ID_BLUE>; + }; + }; + }; + }; + +...
Signature · 1 line
2.28.0
PATCH v33 2/6 leds: lp50xx: Add the LP50XX family of the RGB LED driver
In reply to Dan MurphyIntroduce the LP5036/30/24/18/12/9 RGB LED driver. The difference in these parts are the number of LED outputs where the:
LP5036 can control 36 LEDs
LP5030 can control 30 LEDs
LP5024 can control 24 LEDs
LP5018 can control 18 LEDs
LP5012 can control 12 LEDs
LP5009 can control 9 LEDs
The device has the ability to group LED outputs into control banks so that multiple LED banks can be controlled with the same mixing and brightness. Or the LED outputs can also be controlled independently.
--- drivers/leds/Kconfig | 11 + drivers/leds/Makefile | 1 + drivers/leds/leds-lp50xx.c | 634 +++++++++++++++++++++++++++++++++++++ 3 files changed, 646 insertions(+) create mode 100644 drivers/leds/leds-lp50xx.c
drivers/leds/Kconfig +11 -0
@@ -395,6 +395,17 @@ config LEDS_LP3952 To compile this driver as a module, choose M here: the module will be called leds-lp3952. +config LEDS_LP50XX + tristate "LED Support for TI LP5036/30/24/18/12/9 LED driver chip" + depends on LEDS_CLASS && REGMAP_I2C + depends on LEDS_CLASS_MULTICOLOR || !LEDS_CLASS_MULTICOLOR + help + If you say yes here you get support for the Texas Instruments + LP5036, LP5030, LP5024, LP5018, LP5012 and LP5009 LED driver. + + To compile this driver as a module, choose M here: the + module will be called leds-lp50xx. + config LEDS_LP55XX_COMMON tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501" depends on LEDS_CLASS_MULTICOLOR || !LEDS_CLASS_MULTICOLOR
drivers/leds/Makefile +1 -0
@@ -49,6 +49,7 @@ obj-$(CONFIG_LEDS_LM3697) += leds-lm3697.o obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o obj-$(CONFIG_LEDS_LP3944) += leds-lp3944.o obj-$(CONFIG_LEDS_LP3952) += leds-lp3952.o +obj-$(CONFIG_LEDS_LP50XX) += leds-lp50xx.o obj-$(CONFIG_LEDS_LP5521) += leds-lp5521.o obj-$(CONFIG_LEDS_LP5523) += leds-lp5523.o obj-$(CONFIG_LEDS_LP5562) += leds-lp5562.o
drivers/leds/leds-lp50xx.c new file +634 -0
634 lines not on this page · raw message
Signature · 1 line
2.28.0
PATCH v33 3/6 ARM: defconfig: u8500: Add LP55XX_COMMON config flag
In reply to Dan MurphyThe dependencies for the LP55XX LED drivers have been updated so that the child devices (i.e. LP5521) now depends on the LP55XX_COMMON config flag as opposed to the device selecting the LP55XX_COMMON flag. The LP55XX_COMMON needs to be set in the defconfig.
--- arch/arm/configs/u8500_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/u8500_defconfig +1 -0
@@ -113,6 +113,7 @@ CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y CONFIG_LEDS_LM3530=y CONFIG_LEDS_GPIO=y +CONFIG_LEDS_LP55XX_COMMON=y CONFIG_LEDS_LP5521=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_RTC_CLASS=y
Signature · 1 line
2.28.0
PATCH v33 4/6 ARM: dts: n900: Add reg property to the LP5523 channel node
In reply to Dan MurphyAdd the reg property to each channel node. This update is to accommodate the multicolor framework. In addition to the accommodation this allows the LEDs to be placed on any channel and allow designs to skip channels as opposed to requiring sequential order.
--- arch/arm/boot/dts/omap3-n900.dts | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
arch/arm/boot/dts/omap3-n900.dts +20 -9
@@ -618,63 +618,74 @@ indicator { }; lp5523: lp5523@32 { + #address-cells = <1>; + #size-cells = <0>; compatible = "national,lp5523"; reg = <0x32>; clock-mode = /bits/ 8 <0>; /* LP55XX_CLOCK_AUTO */ enable-gpio = <&gpio2 9 GPIO_ACTIVE_HIGH>; /* 41 */ - chan0 { + chan@0 { chan-name = "lp5523:kb1"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <0>; }; - chan1 { + chan@1 { chan-name = "lp5523:kb2"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <1>; }; - chan2 { + chan@2 { chan-name = "lp5523:kb3"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <2>; }; - chan3 { + chan@3 { chan-name = "lp5523:kb4"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <3>; }; - chan4 { + chan@4 { chan-name = "lp5523:b"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <4>; }; - chan5 { + chan@5 { chan-name = "lp5523:g"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <5>; }; - chan6 { + chan@6 { chan-name = "lp5523:r"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <6>; }; - chan7 { + chan@7 { chan-name = "lp5523:kb5"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <7>; }; - chan8 { + chan@8 { chan-name = "lp5523:kb6"; led-cur = /bits/ 8 <50>; max-cur = /bits/ 8 <100>; + reg = <8>; }; };
Signature · 1 line
2.28.0
PATCH v33 5/6 ARM: dts: imx6dl-yapp4: Add reg property to the lp5562 channel node
In reply to Dan MurphyAdd the reg property to each channel node. This update is to accommodate the multicolor framework. In addition to the accommodation this allows the LEDs to be placed on any channel and allow designs to skip channels as opposed to requiring sequential order.
--- arch/arm/boot/dts/imx6dl-yapp4-common.dtsi | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx6dl-yapp4-common.dtsi +10 -4
@@ -258,29 +258,35 @@ leds: led-controller@30 { reg = <0x30>; clock-mode = /bits/ 8 <1>; status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; - chan0 { + chan@0 { chan-name = "R"; led-cur = /bits/ 8 <0x20>; max-cur = /bits/ 8 <0x60>; + reg = <0>; }; - chan1 { + chan@1 { chan-name = "G"; led-cur = /bits/ 8 <0x20>; max-cur = /bits/ 8 <0x60>; + reg = <1>; }; - chan2 { + chan@2 { chan-name = "B"; led-cur = /bits/ 8 <0x20>; max-cur = /bits/ 8 <0x60>; + reg = <2>; }; - chan3 { + chan@3 { chan-name = "W"; led-cur = /bits/ 8 <0x0>; max-cur = /bits/ 8 <0x0>; + reg = <3>; }; };
Signature · 1 line
2.28.0
Shawn Guo
AppliedRe: [PATCH v33 5/6] ARM: dts: imx6dl-yapp4: Add reg property to the lp5562 channel node
Quoted 6 lines · Dan Murphy
Add the reg property to each channel node. This update is to accommodate the multicolor framework. In addition to the accommodation this allows the LEDs to be placed on any channel and allow designs to skip channels as opposed to requiring sequential order.
Quoted 7 lines
Acked-by Pavel Machek <[email protected]>Signed-off-by Dan Murphy <[email protected]>CC Shawn Guo <[email protected]>CC Sascha Hauer <[email protected]>CC Pengutronix Kernel Team <[email protected]>CC Fabio Estevam <[email protected]>CC NXP Linux Team <[email protected]>
Applied, thanks.
PATCH v33 6/6 ARM: dts: ste-href: Add reg property to the LP5521 channel nodes
In reply to Dan MurphyAdd the reg property to each channel node. This update is to accommodate the multicolor framework. In addition to the accommodation this allows the LEDs to be placed on any channel and allow designs to skip channels as opposed to requiring sequential order.
--- arch/arm/boot/dts/ste-href.dtsi | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
arch/arm/boot/dts/ste-href.dtsi +16 -6
@@ -58,16 +58,21 @@ lp5521@33 { reg = <0x33>; label = "lp5521_pri"; clock-mode = /bits/ 8 <2>; - chan0 { + #address-cells = <1>; + #size-cells = <0>; + chan@0 { + reg = <0>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; linux,default-trigger = "heartbeat"; }; - chan1 { + chan@1 { + reg = <1>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; }; - chan2 { + chan@2 { + reg = <2>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; };
@@ -77,15 +82,20 @@ lp5521@34 { reg = <0x34>; label = "lp5521_sec"; clock-mode = /bits/ 8 <2>; - chan0 { + #address-cells = <1>; + #size-cells = <0>; + chan@0 { + reg = <0>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; }; - chan1 { + chan@1 { + reg = <1>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; }; - chan2 { + chan@2 { + reg = <2>; led-cur = /bits/ 8 <0x2f>; max-cur = /bits/ 8 <0x5f>; };
Signature · 1 line
2.28.0
Re: [PATCH v33 6/6] ARM: dts: ste-href: Add reg property to the LP5521 channel nodes
Quoted 9 lines · Dan Murphy
Add the reg property to each channel node. This update is to accommodate the multicolor framework. In addition to the accommodation this allows the LEDs to be placed on any channel and allow designs to skip channels as opposed to requiring sequential order.
Signed-off-by Dan Murphy <[email protected]>CC Linus Walleij <[email protected]>Acked-by Pavel Machek <[email protected]>
I don't knof if I should just apply these two patches or if there are dependencies that need to go in first. I guess yes?
Yours,
Linus Walleij
Re: [PATCH v33 6/6] ARM: dts: ste-href: Add reg property to the LP5521 channel nodes
Linus
Quoted 8 lines · Linus Walleij
Quoted 6 lines · Dan Murphy
Add the reg property to each channel node. This update is to accommodate the multicolor framework. In addition to the accommodation this allows the LEDs to be placed on any channel and allow designs to skip channels as opposed to requiring sequential order.
Quoted 7 lines
Quoted 3 lines
Signed-off-by Dan Murphy <[email protected]>CC Linus Walleij <[email protected]>Acked-by Pavel Machek <[email protected]>Acked-by Linus Walleij <[email protected]>I don't knof if I should just apply these two patches or if there are dependencies that need to go in first. I guess yes?
I believe all dependencies have been met for these
Dan
Quoted 2 lines
Yours,
Linus Walleij
Re: [PATCH v33 6/6] ARM: dts: ste-href: Add reg property to the LP5521 channel nodes
Quoted 4 lines · Dan Murphy
Quoted 2 lines
I don't knof if I should just apply these two patches or if there are dependencies that need to go in first. I guess yes?
I believe all dependencies have been met for these
OK I applied this patch to the Ux500 tree!
Yours,
Linus Walleij
Hi!
Quoted 5 lines
These are the final patches from the original multicolor framework patchset.
Changes made were to the LP50xx to rework
regmap_defaultsto eliminate used only once #defines. Also fixed putting the child node in the dt parsing and changed regmap regcache type to flat.
Thanks. I applied 1 and 2 of the series to the for-next branch.
Best regards,
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Pavel
Quoted 8 lines · Pavel Machek
Hi!
Quoted 5 lines
These are the final patches from the original multicolor framework patchset.
Changes made were to the LP50xx to rework
regmap_defaultsto eliminate used only once #defines. Also fixed putting the child node in the dt parsing and changed regmap regcache type to flat.Thanks. I applied 1 and 2 of the series to the for-next branch.
Thanks. The DT files are not really a major issue. But the defconfig is not sure who to ping to have them pull it.
Maybe Linus W?
Dan
Quoted 2 lines
Best regards,
Pavel