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: 39513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp284981wrt; Thu, 5 Jan 2023 04:54:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXulyVM7N9MpXp3SQ4VT78ff+r1ezwyMaPU+mbpCzSC/HiTivTwyq/HRrYt8rUvk8ft5pXYp X-Received: by 2002:a17:906:99d6:b0:7c1:7c3a:5c65 with SMTP id s22-20020a17090699d600b007c17c3a5c65mr43935848ejn.4.1672923260770; Thu, 05 Jan 2023 04:54:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672923260; cv=none; d=google.com; s=arc-20160816; b=fzZ70KA1xxj3DOEqizsng/IDNAfeuTjwd1zP7l0uhVkWNgzZe2H/17gOLSyltsZr2g T2KFkyRg5PhjPPwsFary0d13UNmTsUTbrDDpy2kI8yQwIWMw2gQ5cv6JnDPN+XiZyxJ+ MPj0cAwCKUwdctI4IAi+DT9QP5Gm09gxSEyeZWkE2FPoonusZ3vgd6c/Uj+bYw5h5QwO trixsjDdwvwN6ow71/jfKRIdnmTk5xu7Tazquvv34s5O6tl0pcXFBSfAhkzDajaCWgu8 r2Mdx8g9+cWWq1DRb7y2uleHtsmHKNeM8dUKC6wu0V8lAV9iH4Q493cXLk6VeggHAGCd mJtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bY/3o3zn+Pudlf2qbvhNM9aDFnw+OcwLEfR6izS8ZKA=; b=CZWhEHEpai7uRsZzWgEGz7UuyuIgtgZgcBm0H3pIxLYOscx1wySXX8VrCtHPH07BWh v3CuXnEpS5+oc/YGCxc7MyO3CZE6s/VZ5xOvoDZrgzP4Wl9nokS/txJugsr/1XDVIA1v lk0fUGouhy45vrA32YBv75O+2bQXCVwhV7wJ9t7MP5PmbNJ5fMCWgSUb6FCTRTdzuGUd 4PwzfysC4B7XOaRNMjrcrp5T+ncrgm/2gjmWakApdtp9atibmy6msr4E586Nbka04Q7I +DUy4oCaK028JbAaSjOizNu9z1+UzNeEHAJ5dQfd1jxf8upB+rD8hseNOLMxNXKz9VDK +UJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=KdHPXCU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae1-20020a17090725c100b00824f19f0717si30471789ejc.650.2023.01.05.04.53.56; Thu, 05 Jan 2023 04:54:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=KdHPXCU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233422AbjAEMvq (ORCPT + 99 others); Thu, 5 Jan 2023 07:51:46 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754187181064175976?= X-GMAIL-MSGID: =?utf-8?q?1754187181064175976?= 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";