From patchwork Thu Jan 20 18:46:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 12718973 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 EB2D9C433F5 for ; Thu, 20 Jan 2022 18:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376742AbiATSql (ORCPT ); Thu, 20 Jan 2022 13:46:41 -0500 Received: from mail-4022.proton.ch ([185.70.40.22]:44178 "EHLO mail-4022.proton.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241417AbiATSqi (ORCPT ); Thu, 20 Jan 2022 13:46:38 -0500 Date: Thu, 20 Jan 2022 18:46:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1642704395; bh=BrSJa8CL9j+/2ci4r4jMebkxbmilq3QtxhBgHxAwDCA=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:From:To:Cc; b=kce+ma+VdvppR7D7YbXIygpTBXhTec3QFSSUCG0OfJppIwCvXZxShbo0UhIKyMZ/D TCcjS+5IBkoc6wpMH1nbA5qIRi8qIKTQAG5b2QSpOGEblYO3pVI3+0ik+GVJ1XN7Pp uvSw3/nNqIaoJ8AyAnG6HHli1pqU8nAAjBqmHxjQ= To: caleb@connolly.tech, Andy Gross , Bjorn Andersson , Rob Herring , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org From: Caleb Connolly Cc: ~postmarketos/upstreaming@lists.sr.ht Reply-To: Caleb Connolly Subject: [PATCH] arm64: dts: qcom: sdm845-oneplus-*: add fuel gauge Message-ID: <20220120184546.499030-1-caleb@connolly.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The OnePlus 6 and 6T feature a BQ27411 fuel gauge for reading the battery stats. Enable it and add a simple battery to document the battery specs of each device. Signed-off-by: Caleb Connolly --- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 11 +++++++++++ .../arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts | 12 ++++++++++++ arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts | 12 ++++++++++++ 3 files changed, 35 insertions(+) -- 2.34.1 diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi index 7f42e5315ecb..08deca53f0b2 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi @@ -376,6 +376,17 @@ zap-shader { }; }; +&i2c10 { + status = "okay"; + clock-frequency = <100000>; + + bq27441_fg: bq27441-battery@55 { + compatible = "ti,bq27411"; + status = "okay"; + reg = <0x55>; + }; +}; + &i2c12 { status = "okay"; clock-frequency = <400000>; diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts index 5936b47dee5f..bf2cf92e8976 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts @@ -13,6 +13,14 @@ / { chassis-type = "handset"; qcom,msm-id = <0x141 0x20001>; qcom,board-id = <8 0 17819 22>; + + battery: battery { + compatible = "simple-battery"; + + charge-full-design-microamp-hours = <3300000>; + voltage-min-design-microvolt = <3400000>; + voltage-max-design-microvolt = <4400000>; + }; }; &display_panel { @@ -20,3 +28,7 @@ &display_panel { compatible = "samsung,sofef00"; }; + +&bq27441_fg { + monitored-battery = <&battery>; +}; diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts index 78a0b99144e6..1b6b5bf368df 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts @@ -13,6 +13,14 @@ / { chassis-type = "handset"; qcom,msm-id = <0x141 0x20001>; qcom,board-id = <8 0 18801 41>; + + battery: battery { + compatible = "simple-battery"; + + charge-full-design-microamp-hours = <3700000>; + voltage-min-design-microvolt = <3400000>; + voltage-max-design-microvolt = <4400000>; + }; }; &display_panel { @@ -21,6 +29,10 @@ &display_panel { compatible = "samsung,s6e3fc2x01"; }; +&bq27441_fg { + monitored-battery = <&battery>; +}; + &rmi4_f12 { touchscreen-y-mm = <148>; };