Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: "Luca Weiss" <luca.weiss@fairphone.com>
To: "Fenglin Wu" <quic_fenglinw@quicinc.com>, <kernel@quicinc.com>,
	<linux-arm-msm@vger.kernel.org>, "Pavel Machek" <pavel@ucw.cz>,
	"Lee Jones" <lee@kernel.org>
Cc: <linux-leds@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"David Collins" <quic_collinsd@quicinc.com>,
	"Subbaraman Narayanamurthy" <quic_subbaram@quicinc.com>
Subject: Re: [PATCH RESEND v3] leds: flash: leds-qcom-flash: limit LED current based on thermal condition
Date: Mon, 08 Jul 2024 09:39:08 +0200	[thread overview]
Message-ID: <D2JZJ6OV854S.JBNP47IB708D@fairphone.com> (raw)
In-Reply-To: <40dfeb9c-e420-4695-939f-ef9b1985d61c@quicinc.com>

On Mon Jul 8, 2024 at 4:59 AM CEST, Fenglin Wu wrote:
>
>
> On 7/5/2024 10:23 PM, Luca Weiss wrote:
> > On Fri Jul 5, 2024 at 9:55 AM CEST, Fenglin Wu via B4 Relay wrote:
> >> From: Fenglin Wu <quic_fenglinw@quicinc.com>
> >>
> >> The flash module has status bits to indicate different thermal
> >> conditions which are called as OTSTx. For each OTSTx status,
> >> there is a recommended total flash current for all channels to
> >> prevent the flash module entering into higher thermal level.
> >> For example, the total flash current should be limited to 1000mA/500mA
> >> respectively when the HW reaches the OTST1/OTST2 thermal level.
> > 
> > Hi Fenglin,
> > 
> > Only semi-related to this patch, but I wanted to ask.
> > 
> > Since most phones with a flash also have a thermistor for the flash led,
> > is there any plan to add support to be able to declare the flash led to
> > be a "cooling-device" for the relevant thermal zone? That way from a
> > Linux thermal API standpoint when the zone gets too hot that it can ask
> > the driver to throttle the brightness or turn the LED off completely.
> > 
> > Right now the only action the kernel can take is with type 'critical' to
> > just kill the entire system to mitigate the thermal situation.
> > 
> > Regards
> > Luca
> > 
>
> Hi Luca,
>
> This change provides the ability to throttle flash current based on the 
> thermal status sensed by the temperature sensor inside the flash module 
> HW , it doesn't need to register anything in Linux thermal framework.
>
> For the case that you mentioned, when an external thermistor is 
> installed nearby the flash LED component and normally the ADC_TM driver 
> registers a thermal_zone device with it, I agree that having the flash 
> LED driver providing a thermal_cooling device so that any cooling 
> mapping policy could be defined between the thermal sensor and the 
> cooling device would be a good option for better system level thermal 
> control. I would assume that this could be added in flash LED framework 
> driver instead of the client drivers considering this should be a common 
> request because of the big thermal dissipation of flash LED?

Right, the LED core getting the ability to register a cooling device
would probably be a reasonable solution, that way any flash LED driver
would be cooling-ready. Apart from decreasing brightness - or worst case
turning the LED off completely I can't think of many other actions that
could be taken anyways?

Pavel, Lee, your opinion?

Regards
Luca

>
> Fenglin
> >>
> >> ---
> >> base-commit: ca66b10a11da3c445c9c0ca1184f549bbe9061f2
> >> change-id: 20240507-qcom_flash_thermal_derating-260b1f3c757c
> >>
> >> Best regards,
> > 


  reply	other threads:[~2024-07-08  7:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05  7:55 [PATCH RESEND v3] leds: flash: leds-qcom-flash: limit LED current based on thermal condition Fenglin Wu via B4 Relay
2024-07-05 14:23 ` Luca Weiss
2024-07-08  2:59   ` Fenglin Wu
2024-07-08  7:39     ` Luca Weiss [this message]
2024-07-23  3:15 ` Fenglin Wu
2024-07-25 16:28 ` (subset) " Lee Jones

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=D2JZJ6OV854S.JBNP47IB708D@fairphone.com \
    --to=luca.weiss@fairphone.com \
    --cc=kernel@quicinc.com \
    --cc=lee@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=quic_collinsd@quicinc.com \
    --cc=quic_fenglinw@quicinc.com \
    --cc=quic_subbaram@quicinc.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