[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <DBAPR10MB42195CA4E52FDD30F0598AE98ACD9@DBAPR10MB4219.EURPRD10.PROD.OUTLOOK.COM>
Date: Wed, 1 Sep 2021 08:39:08 +0000
From: "hamza.farooq@...mens.com" <hamza.farooq@...mens.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux LED Subsystem <linux-leds@...r.kernel.org>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
"henning.schild@...mens.com" <henning.schild@...mens.com>,
"jan.kiszka@...mens.com" <jan.kiszka@...mens.com>,
"Haeussler, Gerd" <gerd.haeussler.ext@...mens.com>
Subject: Define LEDs with mixed colors
Hello all,
I am toying with the idea of writing a multicolor LED GPIO driver. What would be the right way to define mixed color LEDs (for leds-gpio), in device tree or ACPI?
Consider the following:
leds {
compatible = "gpio-leds";
led0 {
gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_RED>;
};
led1 {
gpios = <&mcu_pio 1 GPIO_ACTIVE_HIGH>;
color = <LED_COLOR_ID_GREEN>;
};
led2 {
gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW
&mcu_pio 1 GPIO_ACTIVE_LOW>;
color = <LED_COLOR_ID_AMBER>;
};
};
This probably won't work as "gpios" seem to be single object in gpio-leds driver code, but what can I do to achieve something similar?
It is important to define this LED in DT/ACPI in order for the user app to see it in the /sys/class/led folder, without having to write platform-specific driver.
Best,
Hamza
Powered by blists - more mailing lists