linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dtc: tegra: enable front panel leds in TrimSlice
@ 2018-02-19 20:16 Tomasz Maciej Nowak
  2018-02-20 19:55 ` Stephen Warren
  0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Maciej Nowak @ 2018-02-19 20:16 UTC (permalink / raw)
  To: thierry.reding, jonathanh, linux-tegra
  Cc: robh+dt, mark.rutland, linux, devicetree, linux-arm-kernel,
	linux-kernel, Tomasz Maciej Nowak

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(-)

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>;
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: dtc: tegra: enable front panel leds in TrimSlice
  2018-02-19 20:16 [PATCH] ARM: dtc: tegra: enable front panel leds in TrimSlice Tomasz Maciej Nowak
@ 2018-02-20 19:55 ` Stephen Warren
  2018-02-21 16:20   ` Tomasz Maciej Nowak
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Warren @ 2018-02-20 19:55 UTC (permalink / raw)
  To: Tomasz Maciej Nowak
  Cc: thierry.reding, jonathanh, linux-tegra, robh+dt, mark.rutland,
	linux, devicetree, linux-arm-kernel, linux-kernel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: dtc: tegra: enable front panel leds in TrimSlice
  2018-02-20 19:55 ` Stephen Warren
@ 2018-02-21 16:20   ` Tomasz Maciej Nowak
  2018-02-21 16:46     ` Stephen Warren
  0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Maciej Nowak @ 2018-02-21 16:20 UTC (permalink / raw)
  To: Stephen Warren
  Cc: thierry.reding, jonathanh, linux-tegra, robh+dt, mark.rutland,
	linux, devicetree, linux-arm-kernel, linux-kernel

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

-- 
Tomek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: dtc: tegra: enable front panel leds in TrimSlice
  2018-02-21 16:20   ` Tomasz Maciej Nowak
@ 2018-02-21 16:46     ` Stephen Warren
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2018-02-21 16:46 UTC (permalink / raw)
  To: Tomasz Maciej Nowak
  Cc: thierry.reding, jonathanh, linux-tegra, robh+dt, mark.rutland,
	linux, devicetree, linux-arm-kernel, linux-kernel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-21 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 20:16 [PATCH] ARM: dtc: tegra: enable front panel leds in TrimSlice Tomasz Maciej Nowak
2018-02-20 19:55 ` Stephen Warren
2018-02-21 16:20   ` Tomasz Maciej Nowak
2018-02-21 16:46     ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).