mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 1/2] dt-bindings: power: supply: add samsung,s2mu106-fuelgauge
Date: Tue, 17 Nov 2026 13:43:27 +0300	[thread overview]
Message-ID: <20261117104328.1176951-2-tadilhusrev@gmail.com> (raw)
In-Reply-To: <20261117104328.1176951-1-tadilhusrev@gmail.com>

Add a binding for the Samsung S2MU106 PMIC's fuel gauge, as a
standalone I2C device (own address, 0x3b) rather than a fallback
compatible on samsung,s2mu005-fuel-gauge.

A previous version of this series
(https://lore.kernel.org/all/20261116074000.355176-1-tadilhusrev@gmail.com/)
extended the S2MU005 fuel-gauge binding and driver instead, with
samsung,s2mu106-fuel-gauge falling back to samsung,s2mu005-fuel-gauge.
Sashiko AI's review of that series pointed out that the fallback let a
board bind through the plain samsung,s2mu005-fuel-gauge compatible
with no guard at all, which runs s2mu005_fg_get_voltage_avg()/
get_current_avg() against MONOUT registers the S2MU106 doesn't have,
and can misreport charging status from the resulting garbage reads.

Rather than add a flag to close that specific hole, this binding
avoids the fallback-compatible construction entirely: the S2MU106
fuel gauge only shares the S2MU005's STATUS/RVBAT/RCURCC/RSOC register
layout and scaling, not its device-tree node shape, so it gets its own
compatible and its own driver
("power: supply: s2mu106-fuelgauge: add standalone driver").
samsung,s2mu005-fuel-gauge is left untouched.

Signed-off-by: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
---
 .../supply/samsung,s2mu106-fuelgauge.yaml     | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/samsung,s2mu106-fuelgauge.yaml

diff --git a/Documentation/devicetree/bindings/power/supply/samsung,s2mu106-fuelgauge.yaml b/Documentation/devicetree/bindings/power/supply/samsung,s2mu106-fuelgauge.yaml
new file mode 100644
index 000000000..3dd91412e
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/samsung,s2mu106-fuelgauge.yaml
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/supply/samsung,s2mu106-fuelgauge.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S2MU106 Fuel Gauge
+
+maintainers:
+  - Adil Hüsrev Tepe <tadilhusrev@gmail.com>
+
+description:
+  Fuel-gauge sub-function of the Samsung S2MU106 PMIC, on its own I2C address
+  (separate from the 0x3d charger/MUIC/FLED block). As on the Galaxy XCover5.
+
+allOf:
+  - $ref: power-supply.yaml#
+
+properties:
+  compatible:
+    const: samsung,s2mu106-fuelgauge
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  monitored-battery: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        fuel-gauge@3b {
+            compatible = "samsung,s2mu106-fuelgauge";
+            reg = <0x3b>;
+            interrupt-parent = <&gpa1>;
+            interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+            monitored-battery = <&battery>;
+        };
+    };
+...
-- 
2.53.0


  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 [PATCH 0/2] power: supply: add standalone S2MU106 fuel gauge (Samsung Galaxy XCover5) Adil Hüsrev Tepe
2026-11-17 10:43 ` Adil Hüsrev Tepe [this message]
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-2-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®