diff mbox series

[v2,8/8] tegra: trimslice: adjust LED patch to upstream changes

Message ID 20240529143825.5472-9-tmn505@terefe.re
State New
Headers show
Series tegra: kernel 6.6 introduction | expand

Commit Message

Tomasz Maciej Nowak May 29, 2024, 2:24 p.m. UTC
From: Tomasz Maciej Nowak <tmn505@gmail.com>

LED subsystem has undergone changes how the function and color of LEDs
should be specified, so use that, while still keeping the old label.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
---
 ...enable-front-panel-leds-in-TrimSlice.patch | 28 ++++++++++++++-----
 1 file changed, 21 insertions(+), 7 deletions(-)

Comments

Hauke Mehrtens May 31, 2024, 12:14 p.m. UTC | #1
On 5/29/24 16:24, Tomasz Maciej Nowak wrote:
> From: Tomasz Maciej Nowak <tmn505@gmail.com>
> 
> LED subsystem has undergone changes how the function and color of LEDs
> should be specified, so use that, while still keeping the old label.
> 
> Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
> ---
>   ...enable-front-panel-leds-in-TrimSlice.patch | 28 ++++++++++++++-----
>   1 file changed, 21 insertions(+), 7 deletions(-)
> 
> diff --git a/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
> index 9ec7f8b839f6..fa6d6db861f4 100644
> --- a/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
> +++ b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
> @@ -1,6 +1,14 @@
>   --- a/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts
>   +++ b/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts
> -@@ -201,16 +201,17 @@
> +@@ -2,6 +2,7 @@
> + /dts-v1/;
> +
> + #include <dt-bindings/input/input.h>
> ++#include <dt-bindings/leds/common.h>
> + #include "tegra20.dtsi"
> + #include "tegra20-cpu-opp.dtsi"
> +
> +@@ -201,16 +202,17 @@
>    			conf_ata {
>    				nvidia,pins = "ata", "atc", "atd", "ate",
>    					"crtp", "dap2", "dap3", "dap4", "dta",
> @@ -23,20 +31,26 @@
>    				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
>    				nvidia,tristate = <TEGRA_PIN_DISABLE>;
>    			};
> -@@ -408,6 +409,20 @@
> +@@ -408,6 +410,26 @@
>    		};
>    	};
>    
> -+	gpio-leds {
> ++	leds {
>   +		compatible = "gpio-leds";
>   +
> -+		ds2 {
> -+			label = "trimslice:green:right";
> ++		led-ds2 {
> ++			label = "green:right";
> ++			color = <LED_COLOR_ID_GREEN>;
> ++			function = LED_FUNCTION_STATUS;
> ++			function-enumerator = <1>;

Normally the color, function and function-enumerator attribute will 
generate a label, if you set a label in addition it is useless. I think 
you should just remove the label property.

Maybe you have to migrate the configuration, is this led used in any UCI 
configuration

Hauke
Tomasz Maciej Nowak May 31, 2024, 7:14 p.m. UTC | #2
W dniu 31.05.2024 o 14:14, Hauke Mehrtens pisze:
> On 5/29/24 16:24, Tomasz Maciej Nowak wrote:
>> From: Tomasz Maciej Nowak <tmn505@gmail.com>
>>
>> LED subsystem has undergone changes how the function and color of LEDs
>> should be specified, so use that, while still keeping the old label.
>>
>> Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
>> ---
>>   ...enable-front-panel-leds-in-TrimSlice.patch | 28 ++++++++++++++-----
>>   1 file changed, 21 insertions(+), 7 deletions(-)
>>
>> diff --git a/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
>> index 9ec7f8b839f6..fa6d6db861f4 100644
>> --- a/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
>> +++ b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
>> @@ -1,6 +1,14 @@
>>   --- a/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts
>>   +++ b/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts
>> -@@ -201,16 +201,17 @@
>> +@@ -2,6 +2,7 @@
>> + /dts-v1/;
>> +
>> + #include <dt-bindings/input/input.h>
>> ++#include <dt-bindings/leds/common.h>
>> + #include "tegra20.dtsi"
>> + #include "tegra20-cpu-opp.dtsi"
>> +
>> +@@ -201,16 +202,17 @@
>>                conf_ata {
>>                    nvidia,pins = "ata", "atc", "atd", "ate",
>>                        "crtp", "dap2", "dap3", "dap4", "dta",
>> @@ -23,20 +31,26 @@
>>                    nvidia,pull = <TEGRA_PIN_PULL_NONE>;
>>                    nvidia,tristate = <TEGRA_PIN_DISABLE>;
>>                };
>> -@@ -408,6 +409,20 @@
>> +@@ -408,6 +410,26 @@
>>            };
>>        };
>>    -+    gpio-leds {
>> ++    leds {
>>   +        compatible = "gpio-leds";
>>   +
>> -+        ds2 {
>> -+            label = "trimslice:green:right";
>> ++        led-ds2 {
>> ++            label = "green:right";
>> ++            color = <LED_COLOR_ID_GREEN>;
>> ++            function = LED_FUNCTION_STATUS;
>> ++            function-enumerator = <1>;
> 
> Normally the color, function and function-enumerator attribute will generate a label, if you set a label in addition it is useless. I think you should just remove the label property.

I was floundering about stating the LED purpose, because vendor didn't explicitly
assign function for them and even the enclosure of the device lacks any marking.
The only markings are on PCB which nodes are named from. That's why I kept the
label property. I'll keep this patch lingering until conclusion which available
function to use.

> 
> Maybe you have to migrate the configuration, is this led used in any UCI configuration

I'll will add the migration, need to decide which function to use, from the ones
available.

> Hauke

Regards
diff mbox series

Patch

diff --git a/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
index 9ec7f8b839f6..fa6d6db861f4 100644
--- a/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
+++ b/target/linux/tegra/patches-6.6/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
@@ -1,6 +1,14 @@ 
 --- a/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts
 +++ b/arch/arm/boot/dts/nvidia/tegra20-trimslice.dts
-@@ -201,16 +201,17 @@
+@@ -2,6 +2,7 @@
+ /dts-v1/;
+ 
+ #include <dt-bindings/input/input.h>
++#include <dt-bindings/leds/common.h>
+ #include "tegra20.dtsi"
+ #include "tegra20-cpu-opp.dtsi"
+ 
+@@ -201,16 +202,17 @@
  			conf_ata {
  				nvidia,pins = "ata", "atc", "atd", "ate",
  					"crtp", "dap2", "dap3", "dap4", "dta",
@@ -23,20 +31,26 @@ 
  				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
  				nvidia,tristate = <TEGRA_PIN_DISABLE>;
  			};
-@@ -408,6 +409,20 @@
+@@ -408,6 +410,26 @@
  		};
  	};
  
-+	gpio-leds {
++	leds {
 +		compatible = "gpio-leds";
 +
-+		ds2 {
-+			label = "trimslice:green:right";
++		led-ds2 {
++			label = "green:right";
++			color = <LED_COLOR_ID_GREEN>;
++			function = LED_FUNCTION_STATUS;
++			function-enumerator = <1>;
 +			gpios = <&gpio TEGRA_GPIO(D, 2) GPIO_ACTIVE_LOW>;
 +		};
 +
-+		ds3 {
-+			label = "trimslice:green:left";
++		led-ds3 {
++			label = "green:left";
++			color = <LED_COLOR_ID_GREEN>;
++			function = LED_FUNCTION_STATUS;
++			function-enumerator = <2>;
 +			gpios = <&gpio TEGRA_GPIO(BB, 5) GPIO_ACTIVE_LOW>;
 +		};
 +	};