Skip to contentSkip to conversation

arm64: dts: ti: k3-am642-sk: Add DT entry for onboard LEDs

PATCH Applied Vignesh Raghavendra 2 participants 3 messages Aug 30, 2022 – Sep 9, 2022

Subsystems (2)
lore
Share & tools
lore

Vignesh Raghavendra

author maintainer
#0 lore raw

PATCH v3 1/1 arm64: dts: ti: k3-am642-sk: Add DT entry for onboard LEDs

From: Aparna M <[email protected]>

AM642 SK has 8 leds connected to tpic2810 onboard. Add support for these gpio leds.

---
v3:
Fix compile error due to missing header
Fix whitespace issues

v2: https://lore.kernel.org/all/[email protected]/

 arch/arm64/boot/dts/ti/k3-am642-sk.dts | 70 ++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-sk.dts +70 -0
index 2620469a7517..cc36b9368356 100644
@@ -9,6 +9,7 @@
 #include <dt-bindings/phy/phy.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/net/ti-dp83867.h>
+#include <dt-bindings/leds/common.h>
 #include "k3-am642.dtsi"
 
 / {
@@ -150,6 +151,67 @@ wlan_en: regulator-2 {
 		vin-supply = <&com8_ls_en>;
 		gpio = <&main_gpio0 48 GPIO_ACTIVE_HIGH>;
 	};
+
+	led-controller {
+		compatible = "gpio-leds";
+
+		led-0 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <1>;
+			gpios = <&exp2 0 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+		led-1 {
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <2>;
+			gpios = <&exp2 1 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+		led-2 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <3>;
+			gpios = <&exp2 2 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+		led-3 {
+			color = <LED_COLOR_ID_AMBER>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <4>;
+			gpios = <&exp2 3 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+		led-4 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <5>;
+			gpios = <&exp2 4 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+		led-5 {
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <6>;
+			gpios = <&exp2 5 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+		led-6 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <7>;
+			gpios = <&exp2 6 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+		led-7 {
+			color = <LED_COLOR_ID_AMBER>;
+			function = LED_FUNCTION_HEARTBEAT;
+			function-enumerator = <8>;
+			linux,default-trigger = "heartbeat";
+			gpios = <&exp2 7 GPIO_ACTIVE_HIGH>;
+		};
+	};
 };
 
 &main_pmx0 {
@@ -330,6 +392,14 @@ exp1: gpio@70 {
 				  "VPP_LDO_EN", "RPI_PS_3V3_En",
 				  "RPI_PS_5V0_En", "RPI_HAT_DETECT";
 	};
+
+	exp2: gpio@60 {
+		compatible = "ti,tpic2810";
+		reg = <0x60>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		gpio-line-names = "LED1","LED2","LED3","LED4","LED5","LED6","LED7","LED8";
+	};
 };
 
 &main_i2c3 {
Signature · 1 line
2.37.2
Reviewed-by on v3 1/1
#1 lore raw

Hi Aparna & Vignesh!

On August 30, 2022 thus sayeth Vignesh Raghavendra:

Quoted 7 lines

From: Aparna M <[email protected]>

AM642 SK has 8 leds connected to tpic2810 onboard. Add support for these gpio leds.

Looks great to me!

Quoted 10 lines

---
v3:
Fix compile error due to missing header
Fix whitespace issues

v2: https://lore.kernel.org/all/[email protected]/

 arch/arm64/boot/dts/ti/k3-am642-sk.dts | 70 ++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

Thanks for getting the leds working :)
~Bryan

author maintainer Applied
#2 lore raw
In reply to Vignesh Raghavendra

Hi Vignesh Raghavendra,

Quoted 6 lines · Vignesh Raghavendra

From: Aparna M <[email protected]>

AM642 SK has 8 leds connected to tpic2810 onboard. Add support for these gpio leds.

I have applied the following to branch master on [1]. Thank you!

[1/1] arm64: dts: ti: k3-am642-sk: Add DT entry for onboard LEDs

      commit: b216dc1a41f787620636376bf2be666f08c031d0

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent up the chain during the next merge window (or sooner if it is a relevant bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Vignesh