diff mbox series

[2/3] leds: core: add missing LED color strings

Message ID TYAP286MB0315237004B02512C219026ABCA0A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
State New
Headers show
Series [1/3] dt-bindings: leds: sort LED color definitions by alphabet | expand

Commit Message

Shiji Yang Oct. 31, 2023, 11:15 a.m. UTC
Some new monochromatic LEDs have been introduced into DT bindings,
but they do not have corresponding descriptions on the led_colors
structure. This patch adds missing LED color strings and sorts
them in the order defined by the dt-bindings.

Fixes: 472d7b9e8141 ("dt-bindings: leds: Expand LED_COLOR_ID definitions")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
 drivers/leds/led-core.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 214ed81eb..67f53af3b 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -26,12 +26,17 @@  LIST_HEAD(leds_list);
 EXPORT_SYMBOL_GPL(leds_list);
 
 const char * const led_colors[LED_COLOR_ID_MAX] = {
-	[LED_COLOR_ID_WHITE] = "white",
-	[LED_COLOR_ID_RED] = "red",
-	[LED_COLOR_ID_GREEN] = "green",
-	[LED_COLOR_ID_BLUE] = "blue",
 	[LED_COLOR_ID_AMBER] = "amber",
+	[LED_COLOR_ID_BLUE] = "blue",
+	[LED_COLOR_ID_CYAN] = "cyan",
+	[LED_COLOR_ID_GREEN] = "green",
+	[LED_COLOR_ID_LIME] = "lime",
+	[LED_COLOR_ID_ORANGE] = "orange",
+	[LED_COLOR_ID_PINK] = "pink",
+	[LED_COLOR_ID_PURPLE] = "purple",
+	[LED_COLOR_ID_RED] = "red",
 	[LED_COLOR_ID_VIOLET] = "violet",
+	[LED_COLOR_ID_WHITE] = "white",
 	[LED_COLOR_ID_YELLOW] = "yellow",
 	[LED_COLOR_ID_IR] = "ir",
 	[LED_COLOR_ID_MULTI] = "multicolor",