devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Sebastian Reichel <sre@kernel.org>, Lee Jones <lee.jones@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Beomho Seo <beomho.seo@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Stephan Gerhold <stephan@gerhold.net>
Subject: [PATCH 1/3] dt-bindings: power: supply: Add DT schema for richtek,rt5033-battery
Date: Mon, 17 May 2021 12:35:52 +0200	[thread overview]
Message-ID: <20210517103554.168159-2-stephan@gerhold.net> (raw)
In-Reply-To: <20210517103554.168159-1-stephan@gerhold.net>

The RT5033 PMIC provides a simple fuel gauge via I2C.
Add a DT schema to describe how to set it up in the device tree.

Note that although RT5033 is a MFD with lots of functionality
(also charger, regulator, LEDs, ...) the fuel gauge has a separate
I2C bus and is not part of the MFD.

Cc: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 .../power/supply/richtek,rt5033-battery.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt5033-battery.yaml

diff --git a/Documentation/devicetree/bindings/power/supply/richtek,rt5033-battery.yaml b/Documentation/devicetree/bindings/power/supply/richtek,rt5033-battery.yaml
new file mode 100644
index 000000000000..ae647d3355a2
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/richtek,rt5033-battery.yaml
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/power/supply/richtek,rt5033-battery.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Richtek RT5033 PMIC Fuel Gauge
+
+maintainers:
+  - Stephan Gerhold <stephan@gerhold.net>
+
+allOf:
+  - $ref: power-supply.yaml#
+
+properties:
+  compatible:
+    const: richtek,rt5033-battery
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      battery@35 {
+        compatible = "richtek,rt5033-battery";
+        reg = <0x35>;
+      };
+    };
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      battery@35 {
+        compatible = "richtek,rt5033-battery";
+        reg = <0x35>;
+        interrupt-parent = <&msmgpio>;
+        interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
+      };
+    };
-- 
2.31.1


  reply	other threads:[~2021-05-17 10:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 10:35 [PATCH 0/3] Fix RT5033 battery device tree probing Stephan Gerhold
2021-05-17 10:35 ` Stephan Gerhold [this message]
2021-05-17 10:35 ` [PATCH 2/3] power: supply: rt5033_battery: Fix device tree enumeration Stephan Gerhold
2021-05-17 10:46   ` Stephan Gerhold
2021-05-17 10:35 ` [PATCH 3/3] mfd: rt5033: Drop rt5033-battery sub-device Stephan Gerhold

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=20210517103554.168159-2-stephan@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=beomho.seo@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).