From patchwork Sun Jul 16 22:05:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markuss Broks X-Patchwork-Id: 13316371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qL9uP-00G1u6-22 for linux-arm-kernel@lists.infradead.org; Sun, 16 Jul 2023 22:08:06 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fb960b7c9dso6121466e87.0 for ; Sun, 16 Jul 2023 15:08:05 -0700 (PDT) From: Markuss Broks Subject: [PATCH 3/7] ARM: dts: exynos: k3g: Add fuel gauge support Date: Mon, 17 Jul 2023 01:05:05 +0300 Message-ID: <20230716220644.22158-5-markuss.broks@gmail.com> In-Reply-To: <20230716220644.22158-1-markuss.broks@gmail.com> References: <20230716220644.22158-1-markuss.broks@gmail.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+lwn-linux-arm-kernel=archive.lwn.net@lists.infradead.org List-Archive: To: Krzysztof Kozlowski Cc: Markuss Broks , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org This device has Maxim MAX17048 fuel gauge, just like its Snapdragon counterpart. It inherits the double capacity issue. Signed-off-by: Markuss Broks --- arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts index c3e006dc34ea..582faedd6aab 100644 --- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts +++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts @@ -80,6 +80,30 @@ firmware@2073000 { reg = <0x02073000 0x1000>; }; + i2c-battery { + compatible = "i2c-gpio"; + + sda-gpios = <&gpb0 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpb0 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <2>; + + #address-cells = <1>; + #size-cells = <0>; + + battery@36 { + compatible = "maxim,max17048"; + reg = <0x36>; + + interrupt-parent = <&gpx1>; + interrupts = <5 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-names = "default"; + pinctrl-0 = <&battery_irq>; + + maxim,double-soc; /* Reports double the capacity */ + }; + }; + tsp_vdd: regulator-tsp-vdd-en { compatible = "regulator-fixed"; regulator-name = "tsp_vdd_en"; @@ -703,6 +727,11 @@ s2mps11_irq: s2mps11-irq-pins { samsung,pin-drv = ; }; + battery_irq: battery-irq-pins { + samsung,pins = "gpx1-5"; + samsung,pin-pud = ; + }; + touch_irq: touch-irq-pins { samsung,pins = "gpx1-6"; samsung,pin-pud = ;