realtek: convert to new LED color/function format where possible

Initial conversion to new LED color/function format
and drop label format where possible. The same label
is composed at runtime.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi 2024-02-07 14:48:44 +01:00
parent f038c0c18f
commit db9f26cfcb
No known key found for this signature in database
GPG key ID: AC001D09ADBFEAD7
3 changed files with 11 additions and 4 deletions

View file

@ -3,6 +3,7 @@
#include "rtl838x.dtsi" #include "rtl838x.dtsi"
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
@ -79,7 +80,8 @@
compatible = "gpio-leds"; compatible = "gpio-leds";
led_power: led-0 { led_power: led-0 {
label = "green:power"; function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
}; };
@ -89,7 +91,8 @@
}; };
led_fault: led-2 { led_fault: led-2 {
label = "amber:fault"; function = LED_FUNCTION_FAULT;
color = <LED_COLOR_ID_AMBER>;
gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
}; };

View file

@ -3,6 +3,7 @@
#include "rtl838x.dtsi" #include "rtl838x.dtsi"
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
@ -38,7 +39,8 @@
compatible = "gpio-leds"; compatible = "gpio-leds";
led_power: led-0 { led_power: led-0 {
label = "green:power"; function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
}; };
}; };

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
@ -22,7 +23,8 @@
compatible = "gpio-leds"; compatible = "gpio-leds";
led_power: power { led_power: power {
label = "green:power"; function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_GREEN>;
gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
}; };
}; };