Re: [PATCH] leds: rgb: leds-qcom-lpg: Only enable TRILED when LPG is used by LED
From: Fenglin Wu
Date: Sun Nov 16 2025 - 21:22:43 EST
On 11/14/2025 10:56 PM, Bjorn Andersson wrote:
On Fri, Nov 14, 2025 at 03:13:18PM +0800, Fenglin Wu wrote:
On 11/14/2025 12:58 PM, Bjorn Andersson wrote:Sorry, it's been a while since I looked at this code, but isn't it
If chan->in_use, then the channel is exposed as a LED andYes, I agree.
lpg_pwm_request() should have returned -EBUSY, so we should never reach
lpg_pwm_apply()?
Change is trying to ignore enabling TRILED channel when the LPG channel
mapping to TRILED is not used for controlling the LED (not defining the LED
child nodes).
So the fix should be just removing this line instead of adding the if check.
possible to configure a channel going through the triled to be exposed
as a PWM channel and if so, don't we need to enable the TRILED driver
for this channel in those cases?
Yes, this is possible, and enabling TRILED is not necessary in this case. The signals from the LPG channels mapped to the TRILED channels can also be routed to the PMIC GPIOs by setting the GPIO pinctrl state to the "funcx" function. For example, for LPG channels in PMH0101, based on the PMIC GPIO usage table, these GPIOs can be used to output the PWM signals if they are configured to the "func1" function.
GPIO05 -- PWM1
GPIO06 -- PWM2
GPIO11 -- PWM3
GPIO08 -- PWM4
GPIO09 -- PWM4
No, the signals will not be routed to TRILED but through other PMIC GPIOs.
I will update it in patch v2.Is the signal still routed through the TRILED, or is it muxed to another
Why do you check chan->triled_mask? I guess we will still read/write theYes, there was a case that a LPG channel mapping to TRILED is repurposed to
triled regiter, but don't make any changes if this is 0?
Or is this the actual issue that you're fixing, that we read/write the
registers when we shouldn't? If so this should be clarified in the
commit message.
control a fan, and it was seen that the BOB1 (supplies to TRILED) voltage
bumped to higher voltage when the PWM channel was enabled.
driver?
Regards,
Bjorn
Regards,
Bjorn