From patchwork Thu Oct 26 05:53:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 158404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp448995vqb; Wed, 25 Oct 2023 22:54:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEt7XSYmFXi2TF9qngwxk8Il0S3XLoE2X+7ycqOrqt4jkkj29sOPDY68wbGVaLfSOY+Aexk X-Received: by 2002:a25:408f:0:b0:d9c:a3dd:664e with SMTP id n137-20020a25408f000000b00d9ca3dd664emr16059152yba.56.1698299667912; Wed, 25 Oct 2023 22:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698299667; cv=none; d=google.com; s=arc-20160816; b=K2Fqi0AaAlbLJwqrPFlP9tvl7qzqLhXOJbOuSwu7AsQSMQRQI4f297XnnXch4pQegj VtL4r55f8YRqHmo/uOqdJsVv+WKLxeMALVLi9saogr9fxxsibqObDbEikBS/Bu9oiiKf ufpfkHT0pPSO3U07xxfrt80Fmu8t+EUyet1HoqQBFgPI6p/9CmoSGMkLqs9s1hx0GmI4 rmLY7F92SfsYyBmHO+YEgNM0GiTM7M3AVzmfPs6gY6cPyukNLXMbmUzV1IffoWYXrLwZ bXpciJlJ6fyegXkpSZ5IChdy8CK52ZweeEeVaJJODp8Si2InI+SA3yX4lxWVvQRq66M1 NCAg== 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=MinvCrbEH/5r9phSqDbaHyFZUTzOu0CkbEibBNEs/So=; b=CS7h0fCU45eg9qw6g9jPUAxX/vXu0Wh0XZqQozsl2ezobQh6dmbk8444dy8N+2X/4p OqkuLvmGEhuttIq87QE+zS24Rk75ea82d5EH52cLZD3DVtDVp0e/46bgu3g7OLHT4AED JUOLjfjwRvQcfHA+LVgnI/VSVQ+Za4O6sjNbjha2b7gaPgFlah0wmzkhHI66x6fw+uXP MLVVdn0YcWdq9e3Ddz3GwPgJSBzjNaXv0yGTtiFWePb+fwNvpIK51AEXWOg5ikyWquAS 9cRDUp3pj548DiDQ0Pd0X0xJzwyQQNsuv0MEHNGM/2jO1nx7GdHKVDkm93YAg1gmew/r JIMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=cMRIFO8i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id d31-20020a25addf000000b00d9ca7235c3dsi14032563ybe.737.2023.10.25.22.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 22:54:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=cMRIFO8i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 663558115468; Wed, 25 Oct 2023 22:54:22 -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 S1343868AbjJZFyN (ORCPT + 26 others); Thu, 26 Oct 2023 01:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232431AbjJZFyL (ORCPT ); Thu, 26 Oct 2023 01:54:11 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E73E115; Wed, 25 Oct 2023 22:54:09 -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 A5F3F408DC; Thu, 26 Oct 2023 10:54:05 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1698299646; bh=cGxQVt+NVbaQIsSjfqmJUKIMf/PR6FSgo/FLAfIdsik=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cMRIFO8iR4u7ni/wvP438REG8eTCIjhISo4W+J8afGG095biNsazGkd3IxX/2OpzP UgqXL2BK6uYzdSUyAMf99oLS2lDCOPDAJdZSz6LJOQd7AQ9sSx9nT9fA4uhG30xgFy r+PZnZO7jXke7YAq9uyoRKYxpHCncdBVSdHtj33SS7/+a50+qoBg9x04aVJdf04vN/ J4qc8+LKyOeejHBAv5iuh6+jA3jfyUZAELDzqtPFZYQZlj0c3eSTO2YHd6cDmP8384 DOkpqFTWxlIGXgRKjjITwuYV2b8CDjovsncWrG4ybgr+fCWkzSKnCbIrqJEfPGMdqj q2yN+n9Yf/CWA== From: Nikita Travkin Date: Thu, 26 Oct 2023 10:53:44 +0500 Subject: [PATCH v3 1/2] arm64: dts: qcom: pm8916: Add BMS and charger MIME-Version: 1.0 Message-Id: <20231026-pm8916-dtsi-bms-lbc-v3-1-fad1ff22306e@trvn.ru> References: <20231026-pm8916-dtsi-bms-lbc-v3-0-fad1ff22306e@trvn.ru> In-Reply-To: <20231026-pm8916-dtsi-bms-lbc-v3-0-fad1ff22306e@trvn.ru> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley 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/ZANAwAIAUMc7O4oGb91AcsmYgBlOf786mSA7Fd6gRwKZ9lU+BF+J3LEVXlUCvRPl GQO5qfR/H+JAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZTn+/AAKCRBDHOzuKBm/ dVGoD/9bDMivDCFrNYXKGHF181bxTzkVoolGqOSJbmR1N8eXHP/wD0uj69lmVNV4CxxJAgLhFaI D//aPiG20VqZ7pWzkvHxg1TfWOL5ICw4XDt2SigFjUluTPHTwisUjk2aNbyk6TnSqukvmwwN+Nn QUWYpRSzDddytCbqP1yBPSRsbrH5Gor/hQr0hD5BHcYk6h75YSu92cHjBypFAoG68rXo9gPzvUy 8gBAlWLWq+eZIms9FOiGEBnWU7s3HX7lCohLvWuncxIb5aD6pFyEnLKHYbqW7dP5W9Zl3b9sfi5 HSEo7q3oiQbIkBOt55q8+JF7al3Bs0yilZM6zfeyqXc5PODWFL161SK1onuA0bNs7ZTCCPnXM7I BGh3iP62DLy8zdK5n9eEEksu7sHgyetk1kTMP1BwazASDvgfuQubAO1RRYltdc6zKEevoiga7/a ytqebVIVhPQVATLq/v74KZCrfbquDpY9HkQFrBfg1Ww4QNcM8e+dq9J/T7LQ1k0FaJEdO7qbCft zleBtYSy7qKGJMxANOceaBake48Vvkv62DxQ8rEg2uvWBZ5lboMV75CClfQiKRZgNgZdQ6uGg6D i3nyFITPhJbK+R6UZhIb9qjwVtLP7B+9k+iOUwyxKcUVRZ4wujDhfskvt6WdWdXnC1cKypwNJmW DtO998XZeDJDA/g== 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 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]); Wed, 25 Oct 2023 22:54:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780796272216866129 X-GMAIL-MSGID: 1780796272216866129 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 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>;