Re: [PATCH v1 0/3] power: supply: s2mu005-battery: add S2MU106 (Samsung Galaxy XCover5)
From: Adil Hüsrev Tepe
Date: Sun Nov 22 2026 - 13:54:43 EST
On Fri, 20 Nov 2026 21:22:14 +0530, Kaustabh Chakraborty wrote:
> Actually, this one was just fine. I didn't look at the patches
> meticulously but it seems like it does belong here. The correct approach
> would be to adjust the driver correctly so that it accepts both.
>
> The compatible patch is, in fact incorrect. The driver clearly uses two
> separate compatibles for the two devices, so there should not be any
> fallback.
Hi Kaustabh,
Thanks for taking a look. To be precise about what I was reacting to: the
unsoundness wasn't that the same driver matches two compatibles -- patch 3
did add a distinct match entry for each, with has_monout set correctly per
chip. It's that patch 1's binding declared the S2MU106 compatible as a
fallback to the S2MU005 one:
compatible = "samsung,s2mu106-fuel-gauge", "samsung,s2mu005-fuel-gauge";
That pattern exists so a kernel with no S2MU106-specific knowledge still
binds correctly via the old compatible alone. It doesn't hold here: a DT
node that lists only the old compatible (no S2MU106 string at all) still
matches s2mu005-battery.c's existing entry and takes the has_monout=true
path, reading MONOUT registers the S2MU106 doesn't have.
You're right that the actual fix is narrower than what I did: drop the
fallback from the binding (require samsung,s2mu106-fuel-gauge on its own),
keep extending s2mu005-battery.c as patches 2-3 did. I went further and
withdrew the whole series for a standalone driver, partly because I'd also
talked myself into a chip sharing three register offsets and their scaling
with another, on its own I2C address, not really belonging in that other
chip's device tree node/driver file. That's a shape preference more than a
bug fix, and I should have said so as a separate point rather than folding
it into the same withdrawal.
The standalone series (dt-bindings: power: supply: add
samsung,s2mu106-fuelgauge + power: supply: s2mu106-fuelgauge: add standalone
driver) is already out and hasn't had review yet. If you still think
reusing s2mu005-battery.c (minus the fallback) is the better shape, I'd
rather hear that case on that thread than have it settled by default --
I don't have a strong attachment either way beyond not wanting the MONOUT
bug back.
(Resent for the lists: my two earlier copies of this reply went out as
HTML and vger rejected both, so only you received them. Sorry for the
duplicate.)
Adil