diff mbox series

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

Message ID 20180219201623.6987-1-tmn505@gmail.com
State Deferred
Headers show
Series ARM: dtc: tegra: enable front panel leds in TrimSlice | expand

Commit Message

Tomasz Maciej Nowak Feb. 19, 2018, 8:16 p.m. UTC
Adds device nodes for two front panel LEDs.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
---
 arch/arm/boot/dts/tegra20-trimslice.dts | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

Comments

Stephen Warren Feb. 20, 2018, 7:55 p.m. UTC | #1
On 02/19/2018 01:16 PM, Tomasz Maciej Nowak wrote:
> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomasz Maciej Nowak Feb. 21, 2018, 4:20 p.m. UTC | #2
W dniu 20.02.2018 o 20:55, Stephen Warren pisze:
> On 02/19/2018 01:16 PM, Tomasz Maciej Nowak wrote:
>> 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
Stephen Warren Feb. 21, 2018, 4:46 p.m. UTC | #3
On 02/21/2018 09:20 AM, Tomasz Maciej Nowak wrote:
> W dniu 20.02.2018 o 20:55, Stephen Warren pisze:
>> On 02/19/2018 01:16 PM, Tomasz Maciej Nowak wrote:
>>> 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 

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts b/arch/arm/boot/dts/tegra20-trimslice.dts
index d55c6b240a30..31a8b088d386 100644
--- a/arch/arm/boot/dts/tegra20-trimslice.dts
+++ b/arch/arm/boot/dts/tegra20-trimslice.dts
@@ -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>;