From: "Adil Hüsrev Tepe" <tadilhusrev@gmail.com>
To: sre@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Adil Hüsrev Tepe" <tadilhusrev@gmail.com>
Subject: [PATCH 0/2] power: supply: add standalone S2MU106 fuel gauge (Samsung Galaxy XCover5)
Date: Tue, 17 Nov 2026 13:43:26 +0300 [thread overview]
Message-ID: <20261117104328.1176951-1-tadilhusrev@gmail.com> (raw)
This supersedes "[PATCH v1 0/3] power: supply: s2mu005-battery: add
S2MU106" (https://lore.kernel.org/all/20261116074000.355176-1-tadilhusrev@gmail.com/),
which I am withdrawing rather than sending a v2 of.
That series extended s2mu005-battery.c/its binding with a
samsung,s2mu106-fuel-gauge compatible falling back to
samsung,s2mu005-fuel-gauge. Sashiko AI's review pointed out that the
fallback is unsound: a board using it binds through the plain
samsung,s2mu005-fuel-gauge compatible with no guard at all, which
still exercises s2mu005_fg_get_voltage_avg()/get_current_avg()
against MONOUT registers the S2MU106 doesn't have, and the resulting
garbage current_avg can flip the reported POWER_SUPPLY_STATUS. Patch
3/3 of that series added a has_monout flag to keep the S2MU106 match
entry out of that path, but the binding still allowed the unguarded
fallback, which is the actual hole.
Rather than patch around that, this series gives the S2MU106 fuel
gauge its own compatible and its own standalone driver. It only
shares the S2MU005's STATUS/RVBAT/RCURCC/RSOC register layout and
scaling, not its device-tree node shape or its MONOUT path, so there
is nothing to usefully fall back to. samsung,s2mu005-fuel-gauge and
s2mu005-battery.c are untouched by this series.
Both patches were drafted with an AI coding assistant (Claude Code,
Anthropic); I reviewed every line, built both (arm64, 0 warnings),
ran checkpatch --strict and dt_binding_check (clean), and tested the
driver live on a Samsung Galaxy XCover5 (Exynos850; re-confirmed
2026-11-17, kernel 7.4.0-rc1-00023-gdcb8b91fb779+ #30): it probes, and
/sys/class/power_supply/s2mu106-battery/ reports plausible voltage,
capacity and charging-status values that track the device's actual
state, confirmed across a flash/reboot cycle.
Adil Hüsrev Tepe (2):
dt-bindings: power: supply: add samsung,s2mu106-fuelgauge
power: supply: s2mu106-fuelgauge: add standalone driver
.../power/supply/samsung,s2mu106-fuelgauge.yaml | 47 ++++++++
drivers/power/supply/Kconfig | 8 ++
drivers/power/supply/Makefile | 1 +
drivers/power/supply/s2mu106-fuelgauge.c | 240 +++++++++++++++++++++++
4 files changed, 296 insertions(+)
next reply other threads:[~2026-11-17 10:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 10:43 Adil Hüsrev Tepe [this message]
2026-11-17 10:43 ` [PATCH 1/2] dt-bindings: power: supply: add samsung,s2mu106-fuelgauge Adil Hüsrev Tepe
2026-11-17 10:43 ` [PATCH 2/2] power: supply: s2mu106-fuelgauge: add standalone driver Adil Hüsrev Tepe
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=20261117104328.1176951-1-tadilhusrev@gmail.com \
--to=tadilhusrev@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--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 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®