From patchwork Sat Sep 16 13:57:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 141072 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1728593vqi; Sat, 16 Sep 2023 08:52:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4JJdIdy9ro/tWFehpBCTeHgNxPGAe8xCFtLaU3nG7qWI6hhXcl4ELJxR4YMea7j6w/ERg X-Received: by 2002:a17:902:db03:b0:1c4:2ca5:8b7c with SMTP id m3-20020a170902db0300b001c42ca58b7cmr4672871plx.61.1694879520542; Sat, 16 Sep 2023 08:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694879520; cv=none; d=google.com; s=arc-20160816; b=QECK4kTzSsYNmjBHFYyMlvq4EmsdHIuij+O8KTwrk/tDr0AOFoO5ZUmMdVsUDJVMwB H/KS1x1NZFk7UqXVCPgS14skJXaKd/kBDUZSejQqb3txzo6T478oS3f73HdA8iORBBvq pG0/Y0xolsbO7JidgfFWWpwL3sqKeINg+1m1W9R48LURgm15nei+oop1qb0oAbc9rr/p d93UdjpcL6TX5GI2HjhVTBJ7p1fg440AQtE5NWbpWrL7Dk67S5Cq0vtHo7gnb3p4a5PO D+hdFBvwSROv6WeZfWdYR6j4q0D5p61R2cEmtXX2rdLmfdEl2SmpYiy0745owkOrjt6g Z/aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Hgw+d7f/denGahHBIzhITj1IxN6yVIU7Rq9r+yhH3Fc=; fh=wxvTvy8S4HsbZsby3Z97u7GcLaOoYa16rXKJ9e/v2/0=; b=Q0ELt3wRK2qmRNm5zfTsv1FDEen5T+2+wTbY/v+/+Y2QTw+wIRLZNQRLl9eSSpf32f rtXAjTn9CTn/2Euk6vWRGzWkcOFBqgaQPsCPrgudukKxeUFQ/xoLvVewnRoPu/R4quU0 kmEUM/YbBn7wnOSC3paQyV9h7hA6IhnoNqfUkxKekHaU1P+OW8NKuihPC7UeYrjxPRif yzxvHwtfFJdhiXy5gOJecORKv8/KtlW3csEUf/Vby99PHsmPUosczg7alrtnbp43FTY5 CswAY3M3vAvTRNJQibjuzRIlTbVK0aBJVNe2+0dgafzpulHdRbRLtMxIamluD+7Q1Bk/ C0sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=qyfkTH5E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j4-20020a170903028400b001bde0b58abesi5239446plr.161.2023.09.16.08.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 08:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=qyfkTH5E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 01B6D82DCA9B; Sat, 16 Sep 2023 07:07:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239338AbjIPN56 (ORCPT + 29 others); Sat, 16 Sep 2023 09:57:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236550AbjIPN5k (ORCPT ); Sat, 16 Sep 2023 09:57:40 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC051CE7; Sat, 16 Sep 2023 06:57:34 -0700 (PDT) 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 0869D42497; Sat, 16 Sep 2023 18:57:29 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1694872649; bh=847j1rUWJlDoCXhmyrnEuR7Aod2ZrxmdyV8KuAPhF8g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qyfkTH5Ej1qAyM2T1MMB2hY/k1qjl2axIRl/dfmpHcQKZGtjsakR1oReChRc5jnuf TinOxdFiK5XItql9pKaf51Sx8ZwfIMVkvNp3syu5Aybf6A1M3PXqXhS4AFJkvJ4bQw upL+xYkFCeBGOmWKQb5REAmip1weRWI8lnnsz7//V4H6wLyusZWv2j4/hNmtMdAZYo bNAbI+0ill6FNscnq1YoddJFTUvxtyIT0PR7/ICUqWC/08wSrwprFHCogjRVaWsD/h hbMQAkJHZSz0c5G2WFnfiIRv96kV0YzryDynmtweYvWEWQ2QbeJoyXuY3gt6zgMvaO afv75LB1hEqEA== From: Nikita Travkin Date: Sat, 16 Sep 2023 18:57:05 +0500 Subject: [PATCH 2/3] arm64: dts: qcom: pm8916: Add BMS and charger MIME-Version: 1.0 Message-Id: <20230916-pm8916-dtsi-bms-lbc-v1-2-7db0b42f9fb1@trvn.ru> References: <20230916-pm8916-dtsi-bms-lbc-v1-0-7db0b42f9fb1@trvn.ru> In-Reply-To: <20230916-pm8916-dtsi-bms-lbc-v1-0-7db0b42f9fb1@trvn.ru> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin X-Developer-Signature: v=1; a=openpgp-sha256; l=2360; i=nikita@trvn.ru; h=from:subject:message-id; bh=847j1rUWJlDoCXhmyrnEuR7Aod2ZrxmdyV8KuAPhF8g=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlBbQ7E/Bvhtz4C1q2oHH6JfjSWnn48h6MmpVQc NJYTmCgJImJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZQW0OwAKCRBDHOzuKBm/ dZ7ID/4kmWxwrFkSKflGg9d7sObwPEj3GDmKlDRwMS+Gz9ONTbicJYLjF79R8q28jYC5L+XA+Pu vMnqhMIoODfHBAL6su+0ZcDcUQ2isX/OiqeOh2BNBdWskSR+RQf4yaMZo9AUosDdU5tRx+lNYmG MMlv0WxaTB6M+cXRJACOHI26/Z0vwOefwEVmXOGtWDfHCpGl9+4H/qo0aAGbHL/z+i1l6e7TOYs CcleLZlw23Pp4+gDdxpgLoH6o2s3BDMmFlb7SytyQ9j8IiRdJT0fbFuUm/aX5ec8h7gBMUo35my limVuUPkEVtjvjzSvQExSmQrIZ/CUsh3slk3uVnKiRpb4gUMr7Vyk2rQ+ren/icEGPhqTsklEcX ndS2Vj5QcLY14RnjHCb0DG2sMXNJy7j6hFLzB8DNy91LQgiNiEs45OxgYbCugsDSqx5IhA0lfcH Sxt87wDUYfZZr7GMUWJ6SXGy+ejZyXWBpTPBwQQtiAO1UX9r2I9HxR/WCA9Eb0vwPo0xqnGXzH6 NOZa1p/TMJCA6mdNCymWZizzlIEAPI8v6KvpgVYcjqVdbZNc9d7fHW+eWCNeWDKSZy9NTVH4u5R k17zMLK35LYzEMza8BsPBKenntbm5/3SypOfWcXKODrLPF7Ru9Ofc4lFPXknXZLm/ov+rOWWp45 o+brSB0giSay+aw== X-Developer-Key: i=nikita@trvn.ru; a=openpgp; fpr=C084AF54523FAA837E2EC547431CECEE2819BF75 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 16 Sep 2023 07:07:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777209988360576647 X-GMAIL-MSGID: 1777209988360576647 pm8916 contains some hardware blocks for battery powered devices: - VM-BMS: Battery voltage monitoring block. - LBC: Linear battery charger. Add them to the pmic dtsi so the devices that make use of those blocks can enable them. Signed-off-by: Nikita Travkin --- arch/arm64/boot/dts/qcom/pm8916.dtsi | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm8916.dtsi b/arch/arm64/boot/dts/qcom/pm8916.dtsi index 223442f909f1..24690cfdabb6 100644 --- a/arch/arm64/boot/dts/qcom/pm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8916.dtsi @@ -41,6 +41,35 @@ watchdog { }; }; + pm8916_charger: charger@1000 { + compatible = "qcom,pm8916-lbc"; + reg = <0x1000>, <0x1200>, <0x1300>, <0x1600>; + reg-names = "chgr", "bat_if", "usb", "misc"; + + interrupts = <0x0 0x10 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 6 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 4 IRQ_TYPE_EDGE_BOTH>; + interrupt-names = "vbat_det", + "fast_chg", + "chg_fail", + "chg_done", + "bat_pres", + "temp_ok", + "coarse_det", + "usb_vbus", + "chg_gone", + "overtemp"; + + status = "disabled"; + }; + pm8916_usbin: usb-detect@1300 { compatible = "qcom,pm8941-misc"; reg = <0x1300>; @@ -91,6 +120,25 @@ channel@f { }; }; + pm8916_bms: battery@4000 { + compatible = "qcom,pm8916-bms-vm"; + reg = <0x4000>; + interrupts = <0x0 0x40 0 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 1 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 2 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 3 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 4 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 5 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "cv_leave", + "cv_enter", + "ocv_good", + "ocv_thr", + "fifo", + "state_chg"; + + status = "disabled"; + }; + rtc@6000 { compatible = "qcom,pm8941-rtc"; reg = <0x6000>, <0x6100>;