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>; From patchwork Thu Oct 26 05:53:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 158405 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp449027vqb; Wed, 25 Oct 2023 22:54:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4XG7xwu/iKA4KPtLLpoCRknlI6eOK5LDOO4Ng/ZuDK+sxGSki1Jxt/RJ71fwtkXuytF+G X-Received: by 2002:a81:6cc2:0:b0:5a8:19b0:513f with SMTP id h185-20020a816cc2000000b005a819b0513fmr19462130ywc.14.1698299673270; Wed, 25 Oct 2023 22:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698299673; cv=none; d=google.com; s=arc-20160816; b=02pfUfrcui1FnN4IkfRLkE/VY+sN3uYUNWYQxRkIwT0OM7m7dKFBq6mHmVAWGokMrv 3caolpzqv3oKWcm/zjrzbZror4bi8ruOHJbtDRntv4mX1UjTU7vBmfrx0tOtOLmBDotH it0OqYcLCL2z0Kg+mlS1CDI2cyM5gL1bOiUM0C7O/7XtFJ+Ssp10+4PKdTeB4X8oou+b 4jTYGIGaEI3v16iqHRN4Ir3axIFXcIFa3GRbjl8xf7ref6ftFeol1EtBfRIZgB5HqAe8 a0Vhv0gfwwUEUB1d85GR4GkxZT42kLCLH9Hm3cNU4pgfKtVyxlYxu8flgHoCQD9iYwEO Rkdw== 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=+LTOzod19apFmdq/7Cba2dVppV9U8yQ6xT8sTq2FbaI=; fh=MinvCrbEH/5r9phSqDbaHyFZUTzOu0CkbEibBNEs/So=; b=tQ8KPTSFPzIAn084IkDlgY0zWtswAu+dzueAb9dCu+sW9KtCqwXUucoRVknjfyA/Rt lnv0llBIKlVhTUXLtaMXLpU+KVyPDfgMFZ4S0hWnUxeosUd0MlLmn8EvbJcvKzPFiROS 35xCLPvtMCJqYlLOTPMrulrGVFgiL6ASRd/4VyYt0PBcdD/MKjkTcROV35PXQKXmz8+i upyScJ7N4qObI0NpAvoTENjXZ9PDBtIUtp1NyMSfNWNL1f+vMqqgnJlIbHq0u4HNGZHQ 3mMRdMDPMSifJjDJLpWSLhkuFeu22M6psKZyVbFa6eMuPgc3gUXUKLWaU0hIxEX9EcDP +aDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b="uA1oWc/i"; 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 cp11-20020a05690c0e0b00b005a7aab31b17si2584699ywb.36.2023.10.25.22.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 22:54:33 -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="uA1oWc/i"; 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 D6CD48115459; Wed, 25 Oct 2023 22:54:30 -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 S234728AbjJZFyT (ORCPT + 26 others); Thu, 26 Oct 2023 01:54:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233203AbjJZFyM (ORCPT ); Thu, 26 Oct 2023 01:54:12 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A808184; Wed, 25 Oct 2023 22:54:10 -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 32A5943024; Thu, 26 Oct 2023 10:54:06 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1698299646; bh=m2R8nwNx74fi7ZyA9GViMO/2RFQPpiuD8601klTAY8Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uA1oWc/i6nHNB1eoaqz/5EtSoqhREpX4vYPINveJWPSxDrgsKvPtfWXb28ZDAYUCY jKrX+s0JK2wF8xrnxGs3p5KfKbVmMxkKFdYuox+6rgSjE25tKuJ8GOJf3Ft1O2IBmm oPTB3jKPRKgPG9WLI9AYmNobwTjVPfYL7yHzOxEF4cBKR+My1ZtmHw0RCZ1cePPeaf 82SKsG7wTimH6yY1IEkyVDC4VVxG7S0wq94QutIRPJM14Ee/NGUU3cHrJKMKDLLrpj 7DtMldlY+TXZyZMGzs1AT52vPHZOgBuz9sYGcuCH5rhtNuKGZTCnX5ETp7YOclNL2J 8Fa1Q/MkSa8JQ== From: Nikita Travkin Date: Thu, 26 Oct 2023 10:53:45 +0500 Subject: [PATCH v3 2/2] arm64: dts: qcom: msm8916-longcheer-l8150: Add battery and charger MIME-Version: 1.0 Message-Id: <20231026-pm8916-dtsi-bms-lbc-v3-2-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=2477; i=nikita@trvn.ru; h=from:subject:message-id; bh=m2R8nwNx74fi7ZyA9GViMO/2RFQPpiuD8601klTAY8Y=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlOf78t9B+W4YKSvV7oqzbkAguV9xEVdI3quokP D9+7iU1IMaJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZTn+/AAKCRBDHOzuKBm/ dYJqD/9Ch+W0ZvItovOMaQrb2cwtSEVbcTdGK789rKwTb1y/Zsa1mr9o7b4U9JvS5mWJMrovhHd R6w8RtZm2lcVbVfhg0LAPjZXmwXz1RnuM5QI0wfvbKAvuLRqNZ+kZYXzJXXBK7JoEES08bN/8oO dHTEff4cK+dTW1rJ4c9d0h/43jLBNW0Zun/gzGARzpTnPLMbFaj8Ml8hIFbf0DO3PCXgD87COD8 9fDz2p4/qu98Ez2cKKIPmhTOtVC7brLPEmNpPMAZw1AsdrqGy5HI5uZVlSLX7gZshDy79dSXBJa EcUXd8d/8bMLpIgBooRwS6eDHesKkJxSF5HnHAOM5T8ikUMB2tXOPAxZwpYcAwdQn7mrGTEL/nz Lem83BVLSknGbOhd9ZyiiFh84hhaRfvmA/1Ijj21xEHZe3ilCsJWwhJpcnT5ZXAOocxjQ07+TD3 jIRQ3e9lr8jy6k9oh/Dtet7/0l0VIwkhPQ0eyCimQ2o6rrMSrC6IGgfvhW9czjRwj0wNfDSmZ2r pWwWZ0ymK9KywbXP/hTMCANpDK2K4AIlcgWbasQYQVFZ4569t//Mz8bDvEdiHcWCJgr3erKdNUE WBiEnDQu4gYckusPB7+/R/A/kVYG+uI/Mb/s/3TT6htrwr+/VmpJDzwq20jI/Kwhgmpo5LIFygD JbfGh4D7qDdtkVw== 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:30 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780796278171600628 X-GMAIL-MSGID: 1780796278171600628 Longcheer L8150 doesn't have any dedicated fuel-gauge or charger, instead making use of the pmic hardware blocks for those purposes. Add pm8916 bms and charger, as well as the battery cell description that those blocks rely on. Signed-off-by: Nikita Travkin Reviewed-by: Konrad Dybcio --- .../boot/dts/qcom/msm8916-longcheer-l8150.dts | 43 +++++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts index 37fa55166918..8e4c77003109 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts @@ -49,6 +49,25 @@ mpss_mem: mpss@8e800000 { }; }; + battery: battery { + compatible = "simple-battery"; + voltage-min-design-microvolt = <3400000>; + voltage-max-design-microvolt = <4350000>; + energy-full-design-microwatt-hours = <9500000>; + charge-full-design-microamp-hours = <2500000>; + + ocv-capacity-celsius = <25>; + ocv-capacity-table-0 = <4330000 100>, <4265000 95>, + <4208000 90>, <4153000 85>, <4100000 80>, <4049000 75>, + <4001000 70>, <3962000 65>, <3919000 60>, <3872000 55>, + <3839000 50>, <3817000 45>, <3798000 40>, <3783000 35>, + <3767000 30>, <3747000 25>, <3729000 20>, <3709000 16>, + <3688000 13>, <3681000 11>, <3680000 10>, <3679000 9>, + <3677000 8>, <3674000 7>, <3666000 6>, <3641000 5>, + <3597000 4>, <3537000 3>, <3457000 2>, <3336000 1>, + <3000000 0>; + }; + gpio-keys { compatible = "gpio-keys"; @@ -236,6 +255,22 @@ &blsp_uart2 { status = "okay"; }; +&pm8916_bms { + status = "okay"; + + monitored-battery = <&battery>; + power-supplies = <&pm8916_charger>; +}; + +&pm8916_charger { + status = "okay"; + + monitored-battery = <&battery>; + + qcom,fast-charge-safe-current = <900000>; + qcom,fast-charge-safe-voltage = <4300000>; +}; + &pm8916_codec { qcom,micbias-lvl = <2800>; qcom,mbhc-vthreshold-low = <75 150 237 450 500>; @@ -255,10 +290,6 @@ pm8916_l17: l17 { }; }; -&pm8916_usbin { - status = "okay"; -}; - &pm8916_vib { status = "okay"; }; @@ -282,11 +313,11 @@ &sound { &usb { status = "okay"; dr_mode = "peripheral"; - extcon = <&pm8916_usbin>; + extcon = <&pm8916_charger>; }; &usb_hs_phy { - extcon = <&pm8916_usbin>; + extcon = <&pm8916_charger>; }; &venus {