From patchwork Thu Jan 5 12:32:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 639780 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3547C54E76 for ; Thu, 5 Jan 2023 12:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbjAEMvb (ORCPT ); Thu, 5 Jan 2023 07:51:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232920AbjAEMv1 (ORCPT ); Thu, 5 Jan 2023 07:51:27 -0500 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ACDB48CD7; Thu, 5 Jan 2023 04:51:26 -0800 (PST) Received: from authenticated-user (box.trvn.ru [194.87.146.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.trvn.ru (Postfix) with ESMTPSA id 509D2420E9; Thu, 5 Jan 2023 17:34:01 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1672922041; bh=X/5AJksXQf17kf4+orqMNYWY3Pk7OE2P5lNRHc4uMus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KdHPXCU4DmUQaohQf+3WmjH7BUzIgX+SeiCg2HmlHBhw4WZq9VvvSDXGE4XMzo+vm 4vEIUckbcXq8uMCFngzqQXcCowhltz/K1Hj0nJIjJ/S5ETaOCSt2KiDs4oHyfSxOTw Vp7vBXUAvKI+l7Y622KE0NN5omDtPrhwB+YzNYKAH6hxkeFBzjfWfzlIW63KXI6ipW FtalGJwwl9ld+pfu5OTA8oSVcNYAhO1FdPVLQJEEDKI/D8VhLU1hGcGnA4JBnD2BJz v6sxoELVq5QdkRgw70tTpNvq1EKK6Wrizrnb4AoOkCxmLdJ+HbxVjg+j8FkTWAHgxH UwwVxNfMfdtDQ== From: Nikita Travkin To: Andy Gross , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Konrad Dybcio , Siddharth Manthan , Jasper Korten , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin Subject: [PATCH 7/8] arm64: dts: qcom: msm8916-samsung-gt5-common: Add fuelgauge Date: Thu, 5 Jan 2023 17:32:39 +0500 Message-Id: <20230105123240.1089375-8-nikita@trvn.ru> In-Reply-To: <20230105123240.1089375-1-nikita@trvn.ru> References: <20230105123240.1089375-1-nikita@trvn.ru> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org gt5 devices use additional MAX77849 MFD to handle battery, charging and usb switching. Fuel-gauge from this MFD has a separate i2c line. Signed-off-by: Nikita Travkin --- .../dts/qcom/msm8916-samsung-gt5-common.dtsi | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi index 9cdb33247691..9f97a8129278 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi @@ -63,6 +63,25 @@ hall-sensor-switch { }; }; +&blsp_i2c4 { + status = "okay"; + + fuelgauge@36 { + compatible = "maxim,max77849-battery"; + reg = <0x36>; + + maxim,rsns-microohm = <10000>; + maxim,over-heat-temp = <600>; + maxim,over-volt = <4400>; + + interrupt-parent = <&msmgpio>; + interrupts = <121 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-0 = <&fuelgauge_int_default>; + pinctrl-names = "default"; + }; +}; + &blsp1_uart2 { status = "okay"; }; @@ -218,6 +237,14 @@ l18 { }; &msmgpio { + fuelgauge_int_default: fuelgauge-int-default-state { + pins = "gpio121"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + gpio_keys_default: gpio-keys-default-state { pins = "gpio107", "gpio109"; function = "gpio";