[PATCH 1/2] dt-bindings: power: supply: document Samsung S2MU005 battery fuel gauge

Kaustabh Chakraborty posted 2 patches 7 hours ago
[PATCH 1/2] dt-bindings: power: supply: document Samsung S2MU005 battery fuel gauge
Posted by Kaustabh Chakraborty 7 hours ago
Samsung S2MU005 is a PMIC device which has LED controllers, an MUIC and
a battery charger. The battery charger is paired with an independent
device connected via I2C which can be used to access various metrics of
the battery. Document the device as a schema.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
---
 .../power/supply/samsung,s2mu005-fuel-gauge.yaml   | 49 ++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/supply/samsung,s2mu005-fuel-gauge.yaml b/Documentation/devicetree/bindings/power/supply/samsung,s2mu005-fuel-gauge.yaml
new file mode 100644
index 0000000000000..5f945a5369dc8
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/samsung,s2mu005-fuel-gauge.yaml
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/supply/samsung,s2mu005-fuel-gauge.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Battery Fuel Gauge for Samsung S2M series PMICs
+
+maintainers:
+  - Kaustabh Chakraborty <kauschluss@disroot.org>
+
+allOf:
+  - $ref: power-supply.yaml#
+
+properties:
+  compatible:
+    enum:
+      - samsung,s2mu005-fuel-gauge
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      fuelgauge@3b {
+        compatible = "samsung,s2mu005-fuel-gauge";
+        reg = <0x3b>;
+
+        interrupt-parent = <&gpa0>;
+        interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
+
+        monitored-battery = <&battery>;
+      };
+    };

-- 
2.52.0
Re: [PATCH 1/2] dt-bindings: power: supply: document Samsung S2MU005 battery fuel gauge
Posted by Conor Dooley 2 hours ago
On Mon, Jan 26, 2026 at 09:09:48PM +0530, Kaustabh Chakraborty wrote:
> Samsung S2MU005 is a PMIC device which has LED controllers, an MUIC and
> a battery charger. The battery charger is paired with an independent
> device connected via I2C which can be used to access various metrics of
> the battery. Document the device as a schema.
> 
> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
> ---
>  .../power/supply/samsung,s2mu005-fuel-gauge.yaml   | 49 ++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/samsung,s2mu005-fuel-gauge.yaml b/Documentation/devicetree/bindings/power/supply/samsung,s2mu005-fuel-gauge.yaml
> new file mode 100644
> index 0000000000000..5f945a5369dc8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/samsung,s2mu005-fuel-gauge.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/supply/samsung,s2mu005-fuel-gauge.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Battery Fuel Gauge for Samsung S2M series PMICs
> +
> +maintainers:
> +  - Kaustabh Chakraborty <kauschluss@disroot.org>
> +
> +allOf:
> +  - $ref: power-supply.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - samsung,s2mu005-fuel-gauge
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    i2c {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      fuelgauge@3b {

Should be "fuel-gauge" iirc (at least, that's what all the bindings do).
Seems fine to me though otherwise,
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable

> +        compatible = "samsung,s2mu005-fuel-gauge";
> +        reg = <0x3b>;
> +
> +        interrupt-parent = <&gpa0>;
> +        interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
> +
> +        monitored-battery = <&battery>;
> +      };
> +    };
> 
> -- 
> 2.52.0
> 
Re: [PATCH 1/2] dt-bindings: power: supply: document Samsung S2MU005 battery fuel gauge
Posted by Kaustabh Chakraborty 2 hours ago
On 2026-01-26 20:06 +00:00, Conor Dooley wrote:
> On Mon, Jan 26, 2026 at 09:09:48PM +0530, Kaustabh Chakraborty wrote:
>> +examples:
>> +  - |
>> +    #include <dt-bindings/interrupt-controller/irq.h>
>> +
>> +    i2c {
>> +      #address-cells = <1>;
>> +      #size-cells = <0>;
>> +
>> +      fuelgauge@3b {
>
> Should be "fuel-gauge" iirc (at least, that's what all the bindings do).

There are a few which use "fuelgauge", but majority use "fuel-gauge".
Will change in the next revision.

> Seems fine to me though otherwise,
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> pw-bot: not-applicable
>
>> +        compatible = "samsung,s2mu005-fuel-gauge";
>> +        reg = <0x3b>;
>> +
>> +        interrupt-parent = <&gpa0>;
>> +        interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
>> +
>> +        monitored-battery = <&battery>;
>> +      };
>> +    };
>> 
>> -- 
>> 2.52.0
>>