mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Dhruvin Rajpura <dhruvin.rajpura@oss.qualcomm.com>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Sebastian Reichel <sre@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	kamal.wadhwa@oss.qualcomm.com, jishnu.prakash@oss.qualcomm.com,
	Dhruvin Rajpura <drajpura@qti.qualcomm.com>
Subject: Re: [PATCH 1/2] bindings: power: supply: qcom,pmic-glink: Document thermal-mitigation
Date: Tue, 16 Jun 2026 06:35:02 +0200	[thread overview]
Message-ID: <9ec90be4-81b1-4a90-a7ac-62af4175f5f7@kernel.org> (raw)
In-Reply-To: <CAB8MRjTwN6J3oSFVeF-w7WpZQamEyyQ6Ckyd=TAB=-N22b8k1g@mail.gmail.com>

On 15/06/2026 12:46, Dhruvin Rajpura wrote:
> On Wed, Jun 10, 2026 at 2:34 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
>>
>>> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>>> +    description:
>>> +      Array of fast charge current limit values for different system
>> thermal
>>> +      mitigation levels. This should be a flat array that denotes the
>> maximum
>>> +      charging current (in uA) for each thermal level. Elements should
>> be listed
>>> +      in monotonically decreasing (non-increasing) order.
>>
>> What is a thermal level? How do you define it? How does it map to
>> thermal bindings?
>>
> 
> A thermal level corresponds to a cooling state in the Linux
> thermal framework. The driver registers a thermal cooling device
> with N states, where state 0 represents no throttling (hardware
> maximum FCC queried from firmware via BATT_CHG_CTRL_LIM_MAX)
> and states 1..N map to the array entries in decreasing current
> order.
> 
> When a thermal zone trips, the thermal framework calls
> set_cur_state(N) which sends the corresponding current value
> to the firmware via BATT_CHG_CTRL_LIM over PMIC GLink,
> limiting the battery charging current to reduce heat generation.
> 
> The array must be monotonically decreasing since higher cooling
> states represent more aggressive throttling requiring lower
> charging currents.
> 
> Will add this explanation to the binding patch commit message
> in the next version.


+Cc Daniel, Zhang and Lukasz,

This feels like broader problem, so should not be done only in this one
aspect for Qualcomm device. IMO, there should be a generic binding for
defining charging constraints and mapping them to thermal zones. That's
not only about current, but might be about voltage or charging level
speed (consider quick charging with lower amps but higher voltage).  Or
actually power is the factor here, not even current and voltage.

This should be solved in generic way. Both from the point of charger's
OPP-like data but also cooling cells for the charger.

One more thing:
Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters


Best regards,
Krzysztof

  parent reply	other threads:[~2026-06-16  4:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  9:16 [PATCH 0/2] power: supply: qcom_battmgr: Add thermal mitigation support DhruvinRajpura
2026-06-09  9:16 ` [PATCH 1/2] bindings: power: supply: qcom,pmic-glink: Document thermal-mitigation DhruvinRajpura
2026-06-10  9:04   ` Krzysztof Kozlowski
     [not found]     ` <CAB8MRjTwN6J3oSFVeF-w7WpZQamEyyQ6Ckyd=TAB=-N22b8k1g@mail.gmail.com>
2026-06-16  4:35       ` Krzysztof Kozlowski [this message]
2026-06-09  9:16 ` [PATCH 2/2] power: supply: qcom_battmgr: Add thermal mitigation support DhruvinRajpura
2026-06-09  9:42   ` Konrad Dybcio
     [not found]     ` <CAB8MRjTAbpwcrD==eZuaJdaprQoEsgr2L1EEU6x+gEu8tAVijQ@mail.gmail.com>
2026-06-19 15:15       ` Konrad Dybcio

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=9ec90be4-81b1-4a90-a7ac-62af4175f5f7@kernel.org \
    --to=krzk@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dhruvin.rajpura@oss.qualcomm.com \
    --cc=drajpura@qti.qualcomm.com \
    --cc=jishnu.prakash@oss.qualcomm.com \
    --cc=kamal.wadhwa@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=robh@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=sre@kernel.org \
    /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®