All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
	 Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	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,
	jishnu.prakash@oss.qualcomm.com, kamal.wadhwa@oss.qualcomm.com
Subject: Re: [PATCH 0/2] qcom_battmgr: Add batteryless DC-adapter MAINS support
Date: Thu, 16 Jul 2026 18:54:36 -0500	[thread overview]
Message-ID: <alltBcYWULOv7nEv@baldur> (raw)
In-Reply-To: <20260716084850.gssw67izy6vq36tg@hu-kotarake-hyd.qualcomm.com>

On Thu, Jul 16, 2026 at 02:18:50PM +0530, Rakesh Kota wrote:
> On Fri, Jul 03, 2026 at 11:16:59AM +0200, Krzysztof Kozlowski wrote:
> > On 03/07/2026 11:13, Rakesh Kota wrote:
> > > On Thu, Jul 02, 2026 at 01:28:35PM +0200, Krzysztof Kozlowski wrote:
> > >> On 02/07/2026 13:17, Rakesh Kota wrote:
> > >>> On Tue, Jun 30, 2026 at 04:16:13PM +0200, Konrad Dybcio wrote:
> > >>>> On 5/22/26 12:56 AM, Bjorn Andersson wrote:
> > >>>>> On Tue, May 19, 2026 at 12:29:38PM +0530, Rakesh Kota wrote:
> > >>>>>> On Mon, May 18, 2026 at 04:36:32PM +0200, Konrad Dybcio wrote:
> > >>>>>>> On 5/18/26 3:49 PM, Rakesh Kota wrote:
> > >>>>>>>> On batteryless boards powered by 12V DC adapters, registering the
> > >>>>>>>> power supply as BATTERY causes userspace to incorrectly trigger
> > >>>>>>>> battery power-saving sequences.
> > >>>>>>>
> > >>>>>>> Does battman really offer no way of differentiating whether a battery
> > >>>>>>> is *actually* present in such cases?
> > >>>>>>>
> > >>>>>>> What boards are affected?
> > >>>>>>>
> > >>>>>> Currently, batteryless support is only implemented for the
> > >>>>>> qcs6490-rb3gen2(Kodiak) board.
> > >>>>>>
> > >>>>>
> > >>>>> What do you mean?
> > >>>>>
> > >>>>> Are you saying that the pmic_glink firmware in Kodiak has a one-off hack
> > >>>>> that no other implementation of this firmware has?
> > >>>>>
> > >>>>> My Lenovo IdeaCentre (hamoa) doesn't have battery, what should I do now?
> > >>>>
> > >>>> I was going through my inbox.
> > >>>> This remains unanswered, and I don't see the discussion progressing
> > >>>> without resolving this.
> > >>>>
> > >>> To clarify — there is no platform-side hack involved. The Kodiak board
> > >>> has a batteryless variant, but the pmic_glink firmware provides no way
> > >>> to distinguish whether a battery is physically present or not. Since
> > >>> this can't be determined from firmware, we introduced a DT-based
> > >>> property to describe the hardware configuration explicitly.
> > >>>
> > >>> This is not Kodiak-specific — any batteryless board, including hamoa,
> > >>> can use the same DT property to avoid incorrect BATTERY registration
> > >>
> > >> Unfortunately the answer might be: fix your firmware. Since your
> > >> firmware is the interface and we do not expose battery in DT, then you
> > >> do not get additional properties. You made conscious design choice of
> > >> abstracting some things in the firmware, so you do control that part of
> > >> the software stack. If you make one choice, it might lead to other, like
> > >> rejecting such properties.
> > >>
> > > 
> > > This is a hardware limitation — both the debug board and batteryless
> > > platform use the same Batt_ID resistor (10K), so the firmware has no way
> > > to distinguish between the two at runtime. There is nothing to fix on
> > > the firmware side.
> > > 
> > > Given this, would a new compatible string (e.g.,qcom,pmic-glink-batteryless)
> > > be preferred over a DT property, or do you have another suggestion?
> > 
> > Debug board is not a end device, thus you basically have only one real
> > use case: battery less. Treat everything that.
> 
> 
> can we have 2 supplies added - (fake) battery and mains?  if we detect 10K bat id?
> since mobile/production platforms share the same firmware and driver code,
> the debug board still requires a fake battery registration to keep the common
> code path functional. In that scenario, should we register both the main power
> supply (DC adapter) and a fake battery, so the shared code continues to work
> correctly without requiring platform-specific divergence?
> 

My Hamoa-based PC (desktop) currently reports: ac, battery, usb, and
wireless. I would expect that it reports on AC (or no battmgr
interfaces?).

If I understand what you're saying, the pmic-glink firmware is generic
across all Hamoa targets, so there is no configuration in that firmware
to differentiate between this and a laptop usecase?

Similarly, my Hamoa laptop doesn't have wireless charging, but you're
saying the pmic-glink firmware doesn't know about this - it just don't
get any input power on those pins?


I think this is similar to if we had a discrete charger block that we
describe in DeviceTree, we would somehow have to describe the
"configuration" of that component.

But I don't think you considered those other use cases. Perhaps this
should be an optional qcom,battmgr-interfaces = "ac", "usb" ...; taking
the list of interfaces that is actually implemented.

Regards,
Bjorn

> regards
> Rakesh Kota

  reply	other threads:[~2026-07-16 23:54 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 13:49 [PATCH 0/2] qcom_battmgr: Add batteryless DC-adapter MAINS support Rakesh Kota
2026-05-18 13:49 ` [PATCH 1/2] dt-bindings: soc: qcom: pmic-glink: Document batteryless property Rakesh Kota
2026-05-18 13:59   ` sashiko-bot
2026-05-19  7:09     ` Rakesh Kota
2026-05-18 15:27   ` Krzysztof Kozlowski
2026-05-19  8:25     ` Rakesh Kota
2026-05-19 10:35       ` Krzysztof Kozlowski
2026-05-19 10:47         ` Konrad Dybcio
2026-05-19 10:49           ` Krzysztof Kozlowski
2026-05-21  7:13         ` Kamal Wadhwa
2026-05-21  7:20           ` Krzysztof Kozlowski
2026-05-21  8:46             ` Konrad Dybcio
2026-05-21  9:58               ` Krzysztof Kozlowski
2026-05-22  9:24                 ` Konrad Dybcio
2026-05-22 10:32                   ` Krzysztof Kozlowski
2026-05-22 10:34                     ` Konrad Dybcio
2026-05-25 12:01                   ` Rakesh Kota
2026-07-02 11:30                     ` Rakesh Kota
2026-07-02 11:48                       ` Krzysztof Kozlowski
2026-07-02 11:49                       ` Dmitry Baryshkov
2026-07-17  0:14                         ` Bjorn Andersson
2026-05-21 12:38               ` Rakesh Kota
2026-05-21 23:34           ` Dmitry Baryshkov
2026-05-18 13:49 ` [PATCH 2/2] power: supply: qcom_battmgr: Add support batteryless boards as MAINS Rakesh Kota
2026-05-18 15:10   ` sashiko-bot
2026-05-19  6:55     ` Rakesh Kota
2026-07-17  0:12   ` Bjorn Andersson
2026-05-18 14:36 ` [PATCH 0/2] qcom_battmgr: Add batteryless DC-adapter MAINS support Konrad Dybcio
2026-05-19  6:59   ` Rakesh Kota
2026-05-19 10:58     ` Konrad Dybcio
2026-05-21 12:28       ` Rakesh Kota
2026-05-21 22:56     ` Bjorn Andersson
2026-06-30 14:16       ` Konrad Dybcio
2026-07-02 11:17         ` Rakesh Kota
2026-07-02 11:28           ` Krzysztof Kozlowski
2026-07-03  9:13             ` Rakesh Kota
2026-07-03  9:16               ` Krzysztof Kozlowski
2026-07-16  8:48                 ` Rakesh Kota
2026-07-16 23:54                   ` Bjorn Andersson [this message]
2026-07-17 10:00                     ` Rakesh Kota

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=alltBcYWULOv7nEv@baldur \
    --to=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jishnu.prakash@oss.qualcomm.com \
    --cc=kamal.wadhwa@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rakesh.kota@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.