[PATCH 1/4] ARM: dts: qcom: msm8974pro-htc-m8: add status LEDs

Alexandre Messier via B4 Relay posted 4 patches 4 months ago
[PATCH 1/4] ARM: dts: qcom: msm8974pro-htc-m8: add status LEDs
Posted by Alexandre Messier via B4 Relay 4 months ago
From: Alexandre Messier <alex@me.ssier.org>

Add support for the notification LEDs on the HTC One M8.

Two LEDs are available, one amber and one green.

Signed-off-by: Alexandre Messier <alex@me.ssier.org>
---
 arch/arm/boot/dts/qcom/qcom-msm8974pro-htc-m8.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974pro-htc-m8.dts b/arch/arm/boot/dts/qcom/qcom-msm8974pro-htc-m8.dts
index b896cc1ad6f7..9c3859069aba 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974pro-htc-m8.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-htc-m8.dts
@@ -3,6 +3,7 @@
 #include "pm8841.dtsi"
 #include "pm8941.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
 	model = "HTC One (M8)";
@@ -64,6 +65,24 @@ vreg_vph_pwr: vreg-vph-pwr {
 	};
 };
 
+&pm8941_lpg {
+	qcom,power-source = <1>;
+
+	status = "okay";
+
+	led@6 {
+		reg = <6>;
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_STATUS;
+	};
+
+	led@7 {
+		reg = <7>;
+		color = <LED_COLOR_ID_AMBER>;
+		function = LED_FUNCTION_STATUS;
+	};
+};
+
 &pm8941_vib {
 	status = "okay";
 };

-- 
2.51.0
Re: [PATCH 1/4] ARM: dts: qcom: msm8974pro-htc-m8: add status LEDs
Posted by Konrad Dybcio 4 months ago
On 10/7/25 7:55 AM, Alexandre Messier via B4 Relay wrote:
> From: Alexandre Messier <alex@me.ssier.org>
> 
> Add support for the notification LEDs on the HTC One M8.
> 
> Two LEDs are available, one amber and one green.

Do they form a single notification led, or are they supposed
to act separately?

Konrad
Re: [PATCH 1/4] ARM: dts: qcom: msm8974pro-htc-m8: add status LEDs
Posted by Alexandre Messier 4 months ago
On 2025-10-07 06:03, Konrad Dybcio wrote:
> On 10/7/25 7:55 AM, Alexandre Messier via B4 Relay wrote:
>> From: Alexandre Messier <alex@me.ssier.org>
>>
>> Add support for the notification LEDs on the HTC One M8.
>>
>> Two LEDs are available, one amber and one green.
> 
> Do they form a single notification led, or are they supposed
> to act separately?

Good point, I had to check the phone user manual to confirm. Indeed, it is
referred to as a one logical notification LED. It also mentions the color can
be either green or orange, it does not mention using the combined color of
the two LEDs.

So I would say they are supposed to act separately.

Hope this answers your question, and let me know if more details are needed.

BTW: I will be sending a V2 to update the color name, since the user
manual says the color is orange, not amber.


> 
> Konrad
>
Re: [PATCH 1/4] ARM: dts: qcom: msm8974pro-htc-m8: add status LEDs
Posted by Konrad Dybcio 3 months, 3 weeks ago
On 10/12/25 8:03 AM, Alexandre Messier wrote:
> On 2025-10-07 06:03, Konrad Dybcio wrote:
>> On 10/7/25 7:55 AM, Alexandre Messier via B4 Relay wrote:
>>> From: Alexandre Messier <alex@me.ssier.org>
>>>
>>> Add support for the notification LEDs on the HTC One M8.
>>>
>>> Two LEDs are available, one amber and one green.
>>
>> Do they form a single notification led, or are they supposed
>> to act separately?
> 
> Good point, I had to check the phone user manual to confirm. Indeed, it is
> referred to as a one logical notification LED. It also mentions the color can
> be either green or orange, it does not mention using the combined color of
> the two LEDs.
> 
> So I would say they are supposed to act separately.
> 
> Hope this answers your question, and let me know if more details are needed.
> 
> BTW: I will be sending a V2 to update the color name, since the user
> manual says the color is orange, not amber.

Let's describe it as a single LED then:

multi-led {
        color = <LED_COLOR_ID_MULTI>; // notice it's not RGB
        function = LED_FUNCTION_STATUS;

        #address-cells = <1>;
        #size-cells = <0>;

        led@6 {
                reg = <6>;
                color = <LED_COLOR_ID_GREEN>;
        };

        led@7 {
                reg = <7>;
                color = <LED_COLOR_ID_ORANGE>;
        };
};

+ Pavel the LED maintainer, please take a look if you think it makes sense

Konrad
Re: [PATCH 1/4] ARM: dts: qcom: msm8974pro-htc-m8: add status LEDs
Posted by Alexandre Messier 3 months, 2 weeks ago
On 2025-10-20 08:02, Konrad Dybcio wrote:
> On 10/12/25 8:03 AM, Alexandre Messier wrote:
>> On 2025-10-07 06:03, Konrad Dybcio wrote:
>>> On 10/7/25 7:55 AM, Alexandre Messier via B4 Relay wrote:
>>>> From: Alexandre Messier <alex@me.ssier.org>
>>>>
>>>> Add support for the notification LEDs on the HTC One M8.
>>>>
>>>> Two LEDs are available, one amber and one green.
>>>
>>> Do they form a single notification led, or are they supposed
>>> to act separately?
>>
>> Good point, I had to check the phone user manual to confirm. Indeed, it is
>> referred to as a one logical notification LED. It also mentions the color can
>> be either green or orange, it does not mention using the combined color of
>> the two LEDs.
>>
>> So I would say they are supposed to act separately.
>>
>> Hope this answers your question, and let me know if more details are needed.
>>
>> BTW: I will be sending a V2 to update the color name, since the user
>> manual says the color is orange, not amber.
> 
> Let's describe it as a single LED then:
> 
> multi-led {
>         color = <LED_COLOR_ID_MULTI>; // notice it's not RGB
>         function = LED_FUNCTION_STATUS;
> 
>         #address-cells = <1>;
>         #size-cells = <0>;
> 
>         led@6 {
>                 reg = <6>;
>                 color = <LED_COLOR_ID_GREEN>;
>         };
> 
>         led@7 {
>                 reg = <7>;
>                 color = <LED_COLOR_ID_ORANGE>;
>         };
> };

Using multi-led is fine for me.

But currently, the "qcom-lpg" driver doesn't support LED_COLOR_ID_MULTI, only
LED_COLOR_ID_RGB. Adding support for LED_COLOR_ID_MULTI is trivial, I tested it
and it works.

Or I can also use the "leds-group-multicolor" driver, using the two individual
LEDs. I also tested this method and it works.

> 
> + Pavel the LED maintainer, please take a look if you think it makes sense

If Pavel agrees using multi-led makes sense, I think the first option is the
best. I will separate the LED patch into a new series, along with the change to
the qcom-lpg driver to support LED_COLOR_ID_MULTI.

Thanks
Alex

> 
> Konrad
Re: [PATCH 1/4] ARM: dts: qcom: msm8974pro-htc-m8: add status LEDs
Posted by Pavel Machek 2 months, 2 weeks ago
Hi!

> >>> Do they form a single notification led, or are they supposed
> >>> to act separately?
> >>
> >> Good point, I had to check the phone user manual to confirm. Indeed, it is
> >> referred to as a one logical notification LED. It also mentions the color can
> >> be either green or orange, it does not mention using the combined color of
> >> the two LEDs.
> >>
> >> So I would say they are supposed to act separately.
> >>
> >> Hope this answers your question, and let me know if more details are needed.
> >>
> >> BTW: I will be sending a V2 to update the color name, since the user
> >> manual says the color is orange, not amber.
> > 
> > Let's describe it as a single LED then:
> > 
> > multi-led {
> >         color = <LED_COLOR_ID_MULTI>; // notice it's not RGB
> >         function = LED_FUNCTION_STATUS;
> > 
> >         #address-cells = <1>;
> >         #size-cells = <0>;
> > 
> >         led@6 {
> >                 reg = <6>;
> >                 color = <LED_COLOR_ID_GREEN>;
> >         };
> > 
> >         led@7 {
> >                 reg = <7>;
> >                 color = <LED_COLOR_ID_ORANGE>;
> >         };
> > };
> 
> Using multi-led is fine for me.
> 
> But currently, the "qcom-lpg" driver doesn't support LED_COLOR_ID_MULTI, only
> LED_COLOR_ID_RGB. Adding support for LED_COLOR_ID_MULTI is trivial, I tested it
> and it works.
> 
> Or I can also use the "leds-group-multicolor" driver, using the two individual
> LEDs. I also tested this method and it works.
> 
> > 
> > + Pavel the LED maintainer, please take a look if you think it makes sense
> 
> If Pavel agrees using multi-led makes sense, I think the first option is the
> best. I will separate the LED patch into a new series, along with the change to
> the qcom-lpg driver to support LED_COLOR_ID_MULTI.

I see nothing horribly wrong here (and am late to the party). ID_MULTI
leds are pretty uncommon for phones, but if that's what you have...

Anyway:

LED SUBSYSTEM
M:      Lee Jones <lee@kernel.org>
M:      Pavel Machek <pavel@kernel.org>
L:      linux-leds@vger.kernel.org

Best regards,
								Pavel
-- 
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, Netanyahu and Musk!