From: Hugo Karlsson <huggek@klattorp.se>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: sre@kernel.org, linux-pm@vger.kernel.org,
matheus@castello.eng.br, me@iskren.info, krzk@kernel.org,
m.szyprowski@samsung.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] power: supply: max17040: report charging status from a gpio-charger
Date: Sun, 8 Nov 2026 16:44:36 +0100 [thread overview]
Message-ID: <ce39c36e-cb6e-4239-b14d-528eab9b132d@klattorp.se> (raw)
In-Reply-To: <CAPVz0n0KjpfuNNG=r-Zgf6gNX68UnvUARQm4KUS5FNGH439F0w@mail.gmail.com>
Thanks, I've resent the series with LKML:
https://lore.kernel.org/lkml/20261108154241.198160-1-huggek@klattorp.se/
//Hugo, completely new on the sending side of mailing lists
On 08/11/2026 16:20, Svyatoslav Ryhel wrote:
> нд, 8 лист. 2026 р. о 17:09 Hugo Karlsson <huggek@klattorp.se> пише:
>> Adding the other MAX17040 reviewers, LKML, and Svyatoslav as the
>> author of the commit in the Fixes: tag, whom I missed when sending.
>> Sorry for the noise.
>>
> I do not see your patches on https://lore.kernel.org/lkml/
>
>> //Hugo
>>
>> On 08/11/2026 15:45, Hugo Karlsson wrote:
>>> Hi,
>>>
>>> I work on OpenFlight [1], an open-source golf launch monitor built on a
>>> Raspberry Pi 5 with a Geekworm X1202 UPS board. The board pairs a
>>> MAX1704x fuel gauge at I2C address 0x36 with a GPIO that is high while
>>> input power is present.
>>>
>>> With the gauge and a gpio-charger described in DT and linked by
>>> power-supplies, the battery still always reports status "Unknown", and
>>> capacity reads above 100 when the cell is full (103 here). Desktop
>>> battery indicators then show the wrong state, so we have been shipping
>>> a patched taskbar plugin to work around it.
>>>
>>> Patch 1 passes the device fwnode to the power supply core. Without it,
>>> power-supplies is never parsed, so the supplier status lookup added in
>>> commit f4b782af61ae never finds a supplier.
>>>
>>> Patch 2 covers suppliers that only report "online", such as a
>>> gpio-charger without a charge-status GPIO: the status is derived from
>>> power_supply_am_i_supplied(), and the battery now sends a change event
>>> when its supplier changes.
>>>
>>> Patch 3 clamps the reported capacity to 100.
>>>
>>> The series is based on for-next. I tested it on a Raspberry Pi 5 with an
>>> X1202, on rpi-6.18.y (6.18.50), where max17040_battery.c only differs
>>> in the style of the i2c_device_id table:
>>>
>>> stock driver: status Unknown, capacity 103
>>> on mains at 100 %: Full, capacity 100
>>> unplugged: Discharging
>>> plugged in at 98 %: Charging
>>>
>>> The battery's uevent follows the charger's within 1 ms.
>>>
>>> Related changes for the same boards, for context:
>>> - Raspberry Pi overlay that links the gauge to the charger [2]
>>> - Raspberry Pi OS taskbar battery plugin reading capacity [3]
>>>
>>> The patches and changelogs were written with Claude Code
>>> (claude-opus-5-5) from my description of the problem. I reviewed them
>>> and did the hardware testing above.
>>>
>>> [1] https://github.com/open-flight/openflight
>>> [2] https://github.com/raspberrypi/linux/pull/7744
>>> [3] https://github.com/raspberrypi-ui/pplug-batt/pull/17
>>>
>>> Thanks,
>>> Hugo
>>>
>>> Hugo Karlsson (3):
>>> power: supply: max17040: pass the device fwnode to the power supply
>>> core
>>> power: supply: max17040: derive status from an online supplier
>>> power: supply: max17040: clamp the reported capacity to 100 %
>>>
>>> drivers/power/supply/max17040_battery.c | 28 +++++++++++++++++++++++--
>>> 1 file changed, 26 insertions(+), 2 deletions(-)
>>>
prev parent reply other threads:[~2026-11-08 15:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261108144548.190622-1-huggek@klattorp.se>
2026-11-08 15:09 ` Hugo Karlsson
2026-11-08 15:20 ` Svyatoslav Ryhel
2026-11-08 15:44 ` Hugo Karlsson [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=ce39c36e-cb6e-4239-b14d-528eab9b132d@klattorp.se \
--to=huggek@klattorp.se \
--cc=clamor95@gmail.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=matheus@castello.eng.br \
--cc=me@iskren.info \
--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®