mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>
Cc: kernel@oss.qualcomm.com, Lee Jones <lee@kernel.org>,
	Pavel Machek <pavel@kernel.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Subbaraman Narayanamurthy
	<subbaraman.narayanamurthy@oss.qualcomm.com>,
	Pavel Machek <pavel@ucw.cz>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: rgb: leds-qcom-lpg: Only enable TRILED when LPG is used by LED
Date: Mon, 17 Nov 2025 10:22:23 +0800	[thread overview]
Message-ID: <cc41233d-f270-4cbe-b355-64f4dcd0652d@oss.qualcomm.com> (raw)
In-Reply-To: <t453czpauswdttsl5cqxwk5ryc7aau3bz4jfwfe4istkffgp43@ffoiicvnbxzh>


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:
>>> If chan->in_use, then the channel is exposed as a LED and
>>> lpg_pwm_request() should have returned -EBUSY, so we should never reach
>>> lpg_pwm_apply()?
>> Yes, I agree.
>>
>> 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.
>>
> Sorry, it's been a while since I looked at this code, but isn't it
> 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

>
>> I will update it in patch v2.
>>
>>> Why do you check chan->triled_mask? I guess we will still read/write the
>>> 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.
>> Yes, there was a case that a LPG channel mapping to TRILED is repurposed to
>> control a fan, and it was seen that the BOB1 (supplies to TRILED) voltage
>> bumped to higher voltage when the PWM channel was enabled.
>>
> Is the signal still routed through the TRILED, or is it muxed to another
> driver?
No, the signals will not be routed to TRILED but through other PMIC GPIOs.
>
> Regards,
> Bjorn
>
>>> Regards,
>>> Bjorn

      reply	other threads:[~2025-11-17  2:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14  1:11 Fenglin Wu via B4 Relay
2025-11-14  4:58 ` Bjorn Andersson
2025-11-14  7:13   ` Fenglin Wu
2025-11-14 14:56     ` Bjorn Andersson
2025-11-17  2:22       ` Fenglin Wu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc41233d-f270-4cbe-b355-64f4dcd0652d@oss.qualcomm.com \
    --to=fenglin.wu@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=kernel@oss.qualcomm.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=pavel@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=subbaraman.narayanamurthy@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®