From patchwork Mon Nov 20 14:03:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 167158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp2222381vqn; Mon, 20 Nov 2023 06:06:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPaycUAt7DJRENS94X75CazZYLV/7qn/tb29MV30bnqrVqaGad95B8Q2DnWkgE6FBlvOiJ X-Received: by 2002:a05:6870:82ac:b0:1ea:fd4:58fb with SMTP id q44-20020a05687082ac00b001ea0fd458fbmr8923205oae.52.1700489193599; Mon, 20 Nov 2023 06:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700489193; cv=none; d=google.com; s=arc-20160816; b=kpmXQsPIiivytHM1tK+gpdlaOjP7NTOEJ9R9zcCx7xpjYTUU9+8mEOayCIC7wsAt3I PEUGcEo7nSYMgEa0SZOOMvUb7R+vCYNs5CmZhEm0g5m8QeQoyegjL3q/rOfTrw7QXnit xtiLGAh8Ui6uibVp0WprozPFoCt8D3lQhXJbqM2b3MrnXPWMiEqqRLkZ737AtIfj2bI9 0LLO0txuLuI8sFnb+/3NbLwR7ieAy6dyJuZ950kt+39UHgB0BT7j4ebmMzFSHiDpBNbv Sz4oU7bbGUDtPX0e7spEjvWfrhn2DSlL66eRLYwWpaHLD7KjcFHZ9yQI1u8fiIT0ANxl axyw== 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=gKU2Hb5Ts8ACz6pXE/qz00/JtwGg1ALMTvmhW/lX6v4=; fh=U5mxiWMUuvTRq6alBZlLGQb1SMJA9nVYKnFjYXdNN2o=; b=t999sW4cDVjoPoIKEZ+dCbd6pK9z+eRdvGJHvk0hyKJQPS2r4WRXCHkmaMn+RA/7eh lUbq/jCzQ7Odl+QP4MuS84iBv6Xa/QurIqu/X5DSH0ZbhXnor4E/d2sUkIa3Fq8i9UM/ pKPVv4+5ac+/2xMi/xz5Y4EzpzXrxpfaewo5zawh6DnPq1Mic3myHAy9SY7GrctJI+/c BwbIITG8ku/JHiqMc7Yg/JINNivoK78ZgMNxH1HskD7BRbtQAhsmKLh2Wo1aQwuBWHAZ TluBEyeUAUt98va+I5Kia2p7BguUK04SrkDFp/qpHvqRMYgXtm0iU9EFuYbcL4g4ETrk +mug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=NetaeWoS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v13-20020a056870310d00b001d0fe4f5616si2777000oaa.168.2023.11.20.06.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:06:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=NetaeWoS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 6251C801C192; Mon, 20 Nov 2023 06:04:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233747AbjKTOEl (ORCPT + 27 others); Mon, 20 Nov 2023 09:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233626AbjKTOEV (ORCPT ); Mon, 20 Nov 2023 09:04:21 -0500 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6FFA10EF; Mon, 20 Nov 2023 06:03:46 -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 CE14641C8C; Mon, 20 Nov 2023 19:03:40 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1700489021; bh=cGxQVt+NVbaQIsSjfqmJUKIMf/PR6FSgo/FLAfIdsik=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NetaeWoSzy6hx0ThcsqTyd88xLdda1hsW7QjBpdxRda1PiaGgxi41LfXu6DEJ7cio 2eoiOAJFn89bUyp/ryBAEq0pBhpkY7juzPRV9302C/pqG/el1jw/B0wmIDJs96bxls rZdVZp/Ku7geSgkr0Q1C0TEurdqhmkw91nmVJYdtrGYdsunMieRuaS2d8Y7tPP9KDP pY5VDKn3/uLSA7ThX5xoAMedNdzEZdjLcG3dK4bJSFKUz1jYEiHs8e39NQuNfj5xsB RlevYlZGDKOk2ivUbg2m53TE22ysCC6779U4V4kZM3VRVz5yr/qDoWmk/kwNhpL7Og OKzbeTpSrFiHA== From: Nikita Travkin Date: Mon, 20 Nov 2023 19:03:04 +0500 Subject: [PATCH v4 2/3] arm64: dts: qcom: pm8916: Add BMS and charger MIME-Version: 1.0 Message-Id: <20231120-pm8916-dtsi-bms-lbc-v4-2-4f91056c8252@trvn.ru> References: <20231120-pm8916-dtsi-bms-lbc-v4-0-4f91056c8252@trvn.ru> In-Reply-To: <20231120-pm8916-dtsi-bms-lbc-v4-0-4f91056c8252@trvn.ru> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Stephen Boyd Cc: ~postmarketos/upstreaming@lists.sr.ht, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Nikita Travkin X-Developer-Signature: v=1; a=openpgp-sha256; l=2360; i=nikita@trvn.ru; h=from:subject:message-id; bh=cGxQVt+NVbaQIsSjfqmJUKIMf/PR6FSgo/FLAfIdsik=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlW2c6wY2c6XqAiTk2FnLRWhwUtpSFzC7/q00Nq OUIcnOCodOJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZVtnOgAKCRBDHOzuKBm/ dafFD/9F1dMePHKR/saUSqP6doyBMFABCcvg46qy03xY3VWDQF/6/hefPTC7sINYtptOf0YXuzN 5Ez25j+mAz+H2Qpt086020crP5NrNAJBxOeWlVLakJKK/L2+b9SKkrfQ6bQZ8Q7kYXtTw62sc3/ Q0aEHN/DTvpsJ6mZCP94HPzfKdkUWs1Eo3RrRzkvptPmXeDtSTzHbM1P/2XWYrejzCbyuTCqL9i mnnlVIamdAM+wYkVO3Fi/uOyfPIIDELvaNdkIf2GPHqxxTx1yusTskYtGPOptKaL5xiOsM2vd5D S750NWieowEX+xds7B2Er4f1kjgz1mD3bBQTq4oHZ2bB1zTd/FWZSKE/OcGWYWdmKchwQrkqwTQ PY3cvyWnoUVrbuM0LtU0dEZ6/EU7FKd7ITTbx4L/FlDmdb8miW3iuYb/mzjrrTYteDt/MKJWNa9 /HcwCd4TkmIqjWh7EpK9spCUG56e8G8H/Ld4+xyPxU1vzIhHu8nQ3VEnAjKn24LC0b8GeAZ+bE+ TX703tEQJNxIhZQb8cttY4mYVRvZ4T5YOvYaeEjwzYac89Yd9w/MLHe+4DxE+tnEXmimW6MTERz hpH3AzVEyo+10AvBXcP4s6lpobMFHiOGTw/UrrIAIPnpbbIUSQaXu6fCJaqjL/yCiE0LhNYv6lc cs+Cz3/xXZzEsCA== X-Developer-Key: i=nikita@trvn.ru; a=openpgp; fpr=C084AF54523FAA837E2EC547431CECEE2819BF75 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 20 Nov 2023 06:04:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783092156556302753 X-GMAIL-MSGID: 1783092156556302753 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 Acked-by: Konrad Dybcio --- 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 f4de86787743..4b2e8fb47d2d 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>;