mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Fenglin Wu <fenglin.wu@oss.qualcomm.com>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: "György Kurucz" <me@kuruczgy.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"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>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Subbaraman Narayanamurthy"
	<subbaraman.narayanamurthy@oss.qualcomm.com>,
	"David Collins" <david.collins@oss.qualcomm.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, kernel@oss.qualcomm.com,
	devicetree@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 5/8] power: supply: qcom_battmgr: Add charge control support
Date: Tue, 10 Jun 2025 14:19:58 +0200	[thread overview]
Message-ID: <bc1daec6-9198-43af-b5a6-c1057d7f2392@oss.qualcomm.com> (raw)
In-Reply-To: <b938b358-301a-4842-bdf6-93ec3c459d41@oss.qualcomm.com>

On 6/9/25 9:17 AM, Dmitry Baryshkov wrote:
> On 09/06/2025 05:39, Fenglin Wu wrote:
>>
>> On 6/7/2025 5:46 PM, Konrad Dybcio wrote:
>>> On 6/3/25 12:37 PM, Dmitry Baryshkov wrote:
>>>> On Tue, Jun 03, 2025 at 01:48:11PM +0800, Fenglin Wu wrote:
>>>>> On 5/31/2025 6:36 PM, György Kurucz wrote:
>>>>>>> Add charge control support for SM8550 and X1E80100.
>>>>>> Thank you for this, tested on my Lenovo Yoga Slim 7x, the limiting works
>>>>>> well, I finally don't have to worry about leaving my laptop plugged in
>>>>>> for too long.
>>>>>>
>>>>>> One small thing I noticed is that after setting the sysfs values and
>>>>>> rebooting, they report 0 again. The limiting appears to stay in effect
>>>>>> though, so it seems that the firmware does keep the values, but Linux
>>>>>> does not read them back. Indeed, looking at the code, it seems that
>>>>>> actually reading back the values is only implemented for the SM8550.
>>>>> Right.
>>>>>
>>>>> Based on offline information, X1E80100 doesn't support reading back those
>>>>> threshold values in battery management firmware, so I can only use the
>>>>> cached values for sysfs read.
>>>> Which limits usablity of the attribute, it is now impossible to identify
>>>> whether it is enabled or disabled. Is there a chance of fixing that for
>>>> the X1E80100 platform?
>>> Is there a chance we store that value in SDAM and can read it back?
>>>
>>> Konrad
>>
>> The thresholds are stored in PMIC SDAM registers by ADSP after receiving the set requests, and ADSP reads them back during initialization. This is why ADSP retains them upon device reboot.
>>
>> I spoke with the battery management firmware team, and they have no plans to update the battery management firmware for X1E80100 further. Consequently, they cannot provide any interfaces to read these thresholds through PMIC Glink.
>>
>> Reading them from the existing SDAM registers requires adding "nvmem- cells" DT properties to specify the SDAM registers. However, the "pmic_glink.power-supply" device is an auxiliary device created by the pmic_glink driver and does not have an associated DT node. Is there any method to create a DT node and add DT properties for an auxiliary device?
> 
> Auxiliary-bus devices don't have their OF nodes. Instead they use the main device's of node thanks to the call to device_set_of_node_from_dev().

i.e. something like this is what we want:

---- socname.dtsi ----

pmic-glink {
	compatible = ...;
	[...]

	nvmem-cells = <&charge_limit_lower>, <&charge_limit_upper>;
	nvmem-cell-names = "charge-limit-lower", "charge-limit-upper";
}

---------------------

if you have better names for these cells than what i put here as
placeholders, go for it - just make sure to also add the -names
counterpart, as we won't be able to rely on just indices in the long run

Konrad

  reply	other threads:[~2025-06-10 12:20 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30  7:35 [PATCH v2 0/8] power: supply: Add several features support in qcom-battmgr driver Fenglin Wu via B4 Relay
2025-05-30  7:35 ` [PATCH v2 1/8] power: supply: core: Add resistance power supply property Fenglin Wu via B4 Relay
2025-06-22  1:26   ` Sebastian Reichel
2025-06-30  8:28     ` Fenglin Wu
2025-07-07  0:15       ` Sebastian Reichel
2025-07-25  8:33         ` Fenglin Wu
2025-05-30  7:35 ` [PATCH v2 2/8] power: supply: core: Add state_of_health " Fenglin Wu via B4 Relay
2025-06-02  6:17   ` Dmitry Baryshkov
2025-06-03  4:50     ` Fenglin Wu
2025-06-03 10:35       ` Dmitry Baryshkov
2025-06-05  6:08         ` Fenglin Wu
2025-06-05  6:34           ` Dmitry Baryshkov
2025-06-22  1:17             ` Sebastian Reichel
2025-07-25  8:17               ` Fenglin Wu
2025-05-30  7:35 ` [PATCH v2 3/8] power: supply: qcom_battmgr: Add resistance " Fenglin Wu via B4 Relay
2025-06-02  6:17   ` Dmitry Baryshkov
2025-05-30  7:35 ` [PATCH v2 4/8] power: supply: qcom_battmgr: Add state_of_health property Fenglin Wu via B4 Relay
2025-05-30  7:35 ` [PATCH v2 5/8] power: supply: qcom_battmgr: Add charge control support Fenglin Wu via B4 Relay
2025-05-30  8:48   ` Bryan O'Donoghue
2025-05-30  9:37     ` Fenglin Wu
2025-05-30 10:11       ` Bryan O'Donoghue
2025-06-03  5:43         ` Fenglin Wu
2025-05-31 10:36   ` György Kurucz
2025-06-03  5:48     ` Fenglin Wu
2025-06-03 10:37       ` Dmitry Baryshkov
2025-06-07  9:46         ` Konrad Dybcio
2025-06-09  2:39           ` Fenglin Wu
2025-06-09  7:17             ` Dmitry Baryshkov
2025-06-10 12:19               ` Konrad Dybcio [this message]
2025-05-30  7:35 ` [PATCH v2 6/8] dt-bindings: soc: qcom: pmic-glink: Move X1E80100 out of fallbacks Fenglin Wu via B4 Relay
2025-06-02  6:38   ` Dmitry Baryshkov
2025-06-02  7:40   ` Krzysztof Kozlowski
2025-06-03  6:42     ` Fenglin Wu
2025-06-03  6:47       ` Krzysztof Kozlowski
2025-06-03  6:59         ` Fenglin Wu
2025-06-03  7:06           ` Krzysztof Kozlowski
2025-06-03  7:41             ` Fenglin Wu
2025-06-03  9:34               ` Krzysztof Kozlowski
2025-06-04  9:40                 ` Fenglin Wu
2025-06-10 12:22                   ` Konrad Dybcio
2025-05-30  7:35 ` [PATCH v2 7/8] usb: typec: ucsi_glink: Add UCSI quirk for X1E80100 platform Fenglin Wu via B4 Relay
2025-05-30  8:35   ` Bryan O'Donoghue
2025-05-30  7:35 ` [PATCH v2 8/8] arm64: dts: qcom: x1*: Remove qcom,sm8550-pmic-glink fallback Fenglin Wu via B4 Relay
2025-06-02  7:41   ` Krzysztof Kozlowski

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=bc1daec6-9198-43af-b5a6-c1057d7f2392@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=david.collins@oss.qualcomm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=fenglin.wu@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kernel@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=linux-usb@vger.kernel.org \
    --cc=me@kuruczgy.com \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --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®