From patchwork Thu Jun 22 00:04:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Meng-Bo" X-Patchwork-Id: 695104 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 8A0D8C001DD for ; Thu, 22 Jun 2023 00:15:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbjFVAP3 (ORCPT ); Wed, 21 Jun 2023 20:15:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbjFVAPZ (ORCPT ); Wed, 21 Jun 2023 20:15:25 -0400 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C1AE1730; Wed, 21 Jun 2023 17:15:23 -0700 (PDT) Date: Thu, 22 Jun 2023 00:04:25 +0000 Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="J3HGnhIZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1687392279; x=1687651479; bh=7io2nYrzkHD3aXlPybSWf16LW6ApjJS6Dz0Z07AACno=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=J3HGnhIZuW2c0V617HbLENla7VuW4MpttI+pL/EhcZ8Mr1eOBgMbLIJj+1K67zdZl Hacf+Dud6NyVDwsZzt93pIoBg0p+uh6TLqcWg5mSoem5VR01qHfBDGTtFgiyMhpv4h hdWlex33whlRhAPD9u29aSiYinmwuGBzCMbHSwHgcUSXT8eGBEQkkDkSxcn2rk4b6B 9EFu0ggCqS4+ZKwmNMBm/WgwGNDimLKhjmoYK/Bfzgzt0bapLh/bynklunTvYFsyAx QgWuLf+SgkKuMY9Im5b2U22TtFzK2lynIkOx3yTuqmYpL5AAXt0gHf7E43PetSMzJ0 336O4ySxkjuoQ== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Arnd Bergmann , Olof Johansson , Stephan Gerhold , Nikita Travkin , soc@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ~postmarketos/upstreaming@lists.sr.ht, Joe Mason , "Lin, Meng-Bo" Subject: [PATCH 4/7] arm64: dts: qcom: msm8916-samsung-fortuna: Add rt5033 battery Message-ID: <20230622000338.48315-1-linmengbo0689@protonmail.com> In-Reply-To: <20230622000007.48219-1-linmengbo0689@protonmail.com> References: <20230622000007.48219-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Joe Mason Like the Samsung Galaxy A3/A5, the Grand Prime uses a Richtek RT5033 PMIC as battery fuel gauge, charger, flash LED and for some regulators. For now, only add the fuel gauge/battery device to the device tree, so we can check the remaining battery percentage. The other RT5033 drivers need some more work first before they can be used properly. Signed-off-by: Joe Mason Signed-off-by: Lin, Meng-Bo --- .../qcom/msm8916-samsung-fortuna-common.dtsi | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi index 40c8edc795b0..ca147310c27a 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi @@ -79,6 +79,21 @@ muic: extcon@25 { }; }; +&blsp_i2c4 { + status = "okay"; + + battery@35 { + compatible = "richtek,rt5033-battery"; + reg = <0x35>; + + interrupt-parent = <&tlmm>; + interrupts = <121 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-0 = <&fg_alert_default>; + pinctrl-names = "default"; + }; +}; + &blsp_uart2 { status = "okay"; }; @@ -127,6 +142,13 @@ &wcnss_iris { }; &tlmm { + fg_alert_default: fg-alert-default-state { + pins = "gpio121"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + gpio_keys_default: gpio-keys-default-state { pins = "gpio107", "gpio109"; function = "gpio";