Skip to contentSkip to conversation

ARM: dtc: tegra: enable front panel leds in TrimSlice

PATCH In review Tomasz Maciej Nowak 2 participants 4 messages Feb 19, 2018 – Feb 21, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dtc: tegra: enable front panel leds in TrimSlice

Adds device nodes for two front panel LEDs.

---
 arch/arm/boot/dts/tegra20-trimslice.dts | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)
arch/arm/boot/dts/tegra20-trimslice.dts +20 -5
index d55c6b240a30..31a8b088d386 100644
@@ -200,16 +200,17 @@
 			conf_ata {
 				nvidia,pins = "ata", "atc", "atd", "ate",
 					"crtp", "dap2", "dap3", "dap4", "dta",
-					"dtb", "dtc", "dtd", "dte", "gmb",
-					"gme", "i2cp", "pta", "slxc", "slxd",
-					"spdi", "spdo", "uda";
+					"dtb", "dtc", "dtd", "gmb", "gme",
+					"i2cp", "pta", "slxc", "slxd", "spdi",
+					"spdo", "uda";
 				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
 				nvidia,tristate = <TEGRA_PIN_ENABLE>;
 			};
 			conf_atb {
 				nvidia,pins = "atb", "cdev1", "cdev2", "dap1",
-					"gma", "gmc", "gmd", "gpu", "gpu7",
-					"gpv", "sdio1", "slxa", "slxk", "uac";
+					"dte", "gma", "gmc", "gmd", "gpu",
+					"gpu7", "gpv", "sdio1", "slxa", "slxk",
+					"uac";
 				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
 				nvidia,tristate = <TEGRA_PIN_DISABLE>;
 			};
@@ -402,6 +403,20 @@
 		};
 	};
 
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		ds2 {
+			label = "trimslice:green:right";
+			gpios = <&gpio TEGRA_GPIO(D, 2) GPIO_ACTIVE_LOW>;
+		};
+
+		ds3 {
+			label = "trimslice:green:left";
+			gpios = <&gpio TEGRA_GPIO(BB, 5) GPIO_ACTIVE_LOW>;
+		};
+	};
+
 	poweroff {
 		compatible = "gpio-poweroff";
 		gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>;
Signature · 1 line
2.16.2
#1 lore raw
Quoted 1 line · Tomasz Maciej Nowak

Adds device nodes for two front panel LEDs.

Why do you need to change the pinmux settings? Configuring a pin as a GPIO should override any pinmux special function selection and hence make it irrelevant, so I don't think you should need to change the pinmux.

#2 lore raw

W dniu 20.02.2018 o?20:55, Stephen Warren pisze:

Quoted 6 lines · Tomasz Maciej Nowak
Quoted 1 line

Adds device nodes for two front panel LEDs.

Why do you need to change the pinmux settings? Configuring a pin as a GPIO should override any pinmux special function selection and hence make it irrelevant, so I don't think you should need to change the pinmux.

At first I did exactly that without changing the pinmux, but the LEDs didn't light up. After that I compared with CompuLab source tree [1]. The pinmux was specified as in my patch. With this change the LEDs are fully functional.

1.
https://gitorious.org/trimslice-kernel/trimslice-kernel?p=trimslice-kernel:trimslice-kernel.git;a=blob;f=arch/arm/mach-tegra/board-trimslice-pinmux.c;h=cc6d5225d97eb9327c820bf1d5b2bc16ab8c6dda;hb=d25bf45d6314089489b30d218ed8a0d6d94417f9#l45

Signature · 1 line
Tomek
#3 lore raw
Quoted 9 lines · Tomasz Maciej Nowak

W dniu 20.02.2018 o?20:55, Stephen Warren pisze:

Quoted 7 lines · Tomasz Maciej Nowak
Quoted 1 line

Adds device nodes for two front panel LEDs.

Why do you need to change the pinmux settings? Configuring a pin as a GPIO should override any pinmux special function selection and hence make it irrelevant, so I don't think you should need to change the pinmux.

Quoted 7 lines

At first I did exactly that without changing the pinmux, but the LEDs didn't light up. After that I compared with CompuLab source tree [1]. The pinmux was specified as in my patch. With this change the LEDs are fully functional.

1.
https://gitorious.org/trimslice-kernel/trimslice-kernel?p=trimslice-kernel:trimslice-kernel.git;a=blob;f=arch/arm/mach-tegra/board-trimslice-pinmux.c;h=cc6d5225d97eb9327c820bf1d5b2bc16ab8c6dda;hb=d25bf45d6314089489b30d218ed8a0d6d94417f9#l45

Oh I see. Your patch isn't changing the pinmux function selection but the other configuration bits, which are relevant even when the pin is in GPIO mode. In particular, it clears the tristate bit for the dte pingroup. That makes perfect sense.