From patchwork Sat Sep 16 13:57: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: 141099 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1814863vqi; Sat, 16 Sep 2023 12:20:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXIa2w87AU1LnZlpe+qFwZnjgM7ITtrJLFZRCTBJ0UrWwb/nwtmuz7XkDNlj9kWg2ojvIf X-Received: by 2002:a05:6a20:a120:b0:158:1e6d:23c8 with SMTP id q32-20020a056a20a12000b001581e6d23c8mr10195221pzk.3.1694892037897; Sat, 16 Sep 2023 12:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694892037; cv=none; d=google.com; s=arc-20160816; b=1Ej6kmKfa9Lhp1+OC/g0H57va2kmnPmhtEELWeXnYHu6x/LkNsX7nGelV3/9IKW+aN TiRedVFb3mOCkCLjvVJ9tSPwVco7dtQgBS7PZR7QyTCCWZpsfwtYv3OF4WufWppXFpUw sC3YRjkOs3CfDCkOMIq0nIDhOVN887HV2dBa+NvZ8IrbMgTsOuCW5WvKm10NiMyyEWIA WpXG8GEu7BhzWgXpoXplrqlAeQgOYhw/XU2Vz7sLUqziTRNrB0GnpTuaT8SyrKLnWS/t Mcf0hahyKhaVQxNzz88f2f2jkmoZDovQ/hf04UK+9szhaQ/sobNVq3HsOZVfEN//mD/2 8Kag== 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=ZpYQhJMqx+kvYAqbcUL9AtkiEjzdpCmlsLo0TO63APY=; fh=wxvTvy8S4HsbZsby3Z97u7GcLaOoYa16rXKJ9e/v2/0=; b=JJ09//hLbfuD2AF9eU/HLS9qo4W9nCaTK6jN5Ot9vu1ZY/humWqYWjUVCIpwJ72Plo +tzOrH64Wj5OoOzhN9CGQ7KAsArRV7nG9tKG9vvZ1MFHU2Ffp8ojddjcM0+duhvLB+90 FwNKkaUKpRJSWUZuHHkke0LfJQLQGPdU4jAjiOa00M0Ir5a/RegmlYL8K+zOCnRpkLfE TcaeqZCoLLjEd3p1b/LE7NY2D2WQBSwzB1nN6MrWMxSs+QzK9GMUYUpExhwHwZenEyVt mPUuqGpqsN0SuPXV8Cs+9R6XLyI0zUGCGpWHTp2521Wt6Skhji/Hp0EFUa7DzMC4kVDj jJxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=2txm7mI0; 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 d20-20020a656214000000b00577ed0133d2si4989885pgv.453.2023.09.16.12.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 12:20:37 -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=2txm7mI0; 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 C77DE806AA1E; Sat, 16 Sep 2023 07:09:56 -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 S239237AbjIPN5z (ORCPT + 29 others); Sat, 16 Sep 2023 09:57:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233817AbjIPN5j (ORCPT ); Sat, 16 Sep 2023 09:57:39 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF6A5CD3; Sat, 16 Sep 2023 06:57:33 -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 436D2422F4; Sat, 16 Sep 2023 18:57:27 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1694872648; bh=Hwbk08EbuJzZAKTZeydqUanedquYaWJTWIWgdQZEFtw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=2txm7mI02y/RJhGgzM6xS/LaKSPLKRhd/PEGilK6x4esvIZ23YZbch7n2z575Ezfi 1dVnidT8j0EuyJ2iOyb7vofBrhamDIYo6WGfNCNl9HyWscmzcaU8HjxwS04KSakLqA eqYd6LQr5vIpTiQTr0d4kKtZXIgJX1rJVQeRX6BmMVhcmDGKr2g/i8J0nGqWAdoqOO T+8hdxrXuXw/4JjsMGskZy6+kxDFdi/JiXThjrBlzTBlUi0xLxbE9toL6UcRS5Toc+ MEy1GY3i3a+iConRtUPCgHw4fI+WvbQL7j+T+bsbIHsSxdUz4wv1XOtqbVQwL5IV3B YdI2NS9ofNmXQ== From: Nikita Travkin Date: Sat, 16 Sep 2023 18:57:04 +0500 Subject: [PATCH 1/3] dt-bindings: mfd: qcom,spmi-pmic: Add pm8916 vm-bms and lbc MIME-Version: 1.0 Message-Id: <20230916-pm8916-dtsi-bms-lbc-v1-1-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=1372; i=nikita@trvn.ru; h=from:subject:message-id; bh=Hwbk08EbuJzZAKTZeydqUanedquYaWJTWIWgdQZEFtw=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlBbQ7e8+Hvzq4Nkvs6uN3P4pql/snrZQ5JQEpu CI3wF15O7OJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZQW0OwAKCRBDHOzuKBm/ dT7XD/wL1JbQ/j6/FNvwOVYFREahF9rxYLtKr5P811RbmmH2bw/cYOsj5ONmGkUrEe7eC3xGLKF wH04MTlqD8J85P10QWB3PgvUcxMUP5k30XBqESMVEsFhPP6Mmv3IqY02oI8AkU1X6UgiAGOB10L encrcpP2PlK+Myg2ug68LsJ//LYEvMwmvLOL77sj1A3a/zsecwRG90ZSP2QPjBvjpvgFKeaCvdA nUy8hE77u3xuFM8O5up9A4kInQ8qe9qF5mIevgiCTCnwSsdCgnquerkyaTwqgVRnqcV2LE3/qw+ SeOp0piEwAJw/jetRBqEzxvLmL4QkaMYJP5MFdGsSq80umlouw3a+n1Q5m2j/obzenqmq+PAF9Z q3eSHNUwWsdLk3CqIbdybDbfr6SSju4fjqkuvu09HmsARuEh1JdLdSVJoj+vDGrs3OWPsdfVs9U 0FM7ZkCI84AhWQDzKwuGNgg4kDY9SNUHYrC+4E5ZQZtXuIdktJTerUA3XHrIwDsl8h53Qk5jmiN TRJ/ZlutteFbbT+8jgyuIhOeB/OtnRdzNZnUpp6+QYOHUlr06JW1QnZiZSBpNk53GNKetyNW/so T+AdqQq8m0TT8mqipyJuzmElyDmMqoLPXB9dhXjNHvt7849GCtl54YdpGsdB2lKHH/ofUl0+fbo JGYgAtWQBCYWB0Q== 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:09:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777204546753339952 X-GMAIL-MSGID: 1777223113641196637 PM8916 (and probably some other similar pmics) have hardware blocks for battery monitoring and charging. Add patterns for respecive nodes so the dt for those blocks can be validated properly. Signed-off-by: Nikita Travkin --- Schemas for those devices were added in [1]. [1] https://lore.kernel.org/r/20230915-pm8916-bms-lbc-v3-0-f30881e951a0@trvn.ru --- Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml index 9f03436b1cdc..8bcd76748faa 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml @@ -133,9 +133,15 @@ patternProperties: type: object $ref: /schemas/sound/qcom,pm8916-wcd-analog-codec.yaml# + "^battery@[0-9a-f]+$": + type: object + oneOf: + - $ref: /schemas/power/supply/qcom,pm8916-bms-vm.yaml# + "^charger@[0-9a-f]+$": type: object oneOf: + - $ref: /schemas/power/supply/qcom,pm8916-lbc.yaml# - $ref: /schemas/power/supply/qcom,pm8941-charger.yaml# - $ref: /schemas/power/supply/qcom,pm8941-coincell.yaml# - $ref: /schemas/power/supply/qcom,pmi8998-charger.yaml# 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>; From patchwork Sat Sep 16 13:57:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 141079 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1740837vqi; Sat, 16 Sep 2023 09:16:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5bIbCaTY0Ji+1SpwpiZqtePkxH2qywclBe6uEAI/r6apxw2nwglIYSeW3OWO6MPUYv7T1 X-Received: by 2002:a17:902:db0b:b0:1bd:f314:7896 with SMTP id m11-20020a170902db0b00b001bdf3147896mr4992021plx.25.1694880959700; Sat, 16 Sep 2023 09:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694880959; cv=none; d=google.com; s=arc-20160816; b=xXlC0Ej9SkPTHCvCRtMBHoXw+PS+1wksF5CWDa+VvUZm3MqyfiZ3NJuZ/o89/I2KoD Afqxsk78J3pguIDDVRTADNJ5Qbxwa8/TkR4CIVSF6J4+yu4QFpzZmu/L9VtDwbBOsx9u yOMTkei0eOIPFhk2Jncm8tPLS86EAdZZfTAi3pF01mmRYFfdTVltHMf1Am1bPkZTvI9K F/B8O1HpwNmKcNkOlAczXTkI7lTMrgxNMZ0HbMzCcCXCrc6HACdzENMzB19dbE9N8Xpw FIlKvBIx4QI0zsUyLJniFrH1n+VbcbeWK/RiwCykD2f7gakXl+WCM5ym5QcAcTtleKLw O7xg== 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=ro5J8CysDw4F94+Eim0odHWt6qHa/4PIx8Rz83vgM5E=; fh=wxvTvy8S4HsbZsby3Z97u7GcLaOoYa16rXKJ9e/v2/0=; b=StmmBEwaAiSxdqqv751Sgnq42/1y6GrybXCSsgWiLltkmlLBEaLn8Aju3uaLYPg5PV Iik41B4gB1l6hWRrM8Zwov9YLe9/y1iajeZw9T6yXeZFd7O9vI6BlRtzdKby9+R30aTf xobHYCkHydaOQNkOqyXhQ0vlkloWY7NmaMm+6xvLwNZN5+lQPPPID9XJ0UqwvEiF2XMG BT0xa6oFvfhS2lZByCP1rFcb4SEHI8WFRNDtsQc9YMNuG61KBpHFFFW3on4gCm+vGnaQ 5i17l2IhRuSsCfvmCv/DWZyMEHwr3vgfGOlO9U7xbysD06Re7ud/s5E8Ob1/jhLsd59Y XhlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=O2X0OmxK; 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 i1-20020a170902cf0100b0019c354055d0si5193740plg.304.2023.09.16.09.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 09:15:59 -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=O2X0OmxK; 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 184F882FCE9B; Sat, 16 Sep 2023 07:07:59 -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 S239362AbjIPN57 (ORCPT + 29 others); Sat, 16 Sep 2023 09:57:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236702AbjIPN5l (ORCPT ); Sat, 16 Sep 2023 09:57:41 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF1C8CEA; Sat, 16 Sep 2023 06:57:35 -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 9159D42498; 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=1694872650; bh=4hf9NDkSjXIiEDRF/oTd87ONW933mcqoFz4BE59iyKY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=O2X0OmxK3DHH70+wCsefFAaVmGbwaPuAKMV/tDqsLXzVjVyKalk0DbPKd6nlDsZbT wS2NaBhSAca2FIVtC+Rerib9hSYFK2LVV0B57KJriC+5ktRZdDk+QFFmcukRcHXp+g wIbU33hcomGbbJQWemjPX9cXt9M6AGLKnudab+KDc9dqngW6XbzAA6ctD+QLOdZDRd A1Pl/vhnGdfZxFJW4xeMFdWfKvnQe1vW7aC29l35831hflI895iR3LWq8vlL/IdV6F tLnjPlIDyj0iBzneFGUqVi02QGv9rh/1+gvoXDALCt2weqrKb/N3Nr7XtENeXvgmFi 7PaO85BCx6h5w== From: Nikita Travkin Date: Sat, 16 Sep 2023 18:57:06 +0500 Subject: [PATCH 3/3] arm64: dts: qcom: msm8916-longcheer-l8150: Add battery and charger MIME-Version: 1.0 Message-Id: <20230916-pm8916-dtsi-bms-lbc-v1-3-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=2453; i=nikita@trvn.ru; h=from:subject:message-id; bh=4hf9NDkSjXIiEDRF/oTd87ONW933mcqoFz4BE59iyKY=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlBbQ8BNlnZPYaTsGrRi3gzuGx+ikU9W0eOJm+o qE4NQTu52WJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZQW0PAAKCRBDHOzuKBm/ dZTeEACEw58WEI8ogGUTMLa2uBApWvK7ZnseHAogy6bvt7D4FGX7bpO3b3rqMbzMgF5DiFyyjau AHNe80OsUFIR9/OUba8TAMwin9DtHVbzNo/Ja/J8maUeK45Wnq9pbOIm4QYkjK6nXGhOZWA2RPt loL47GYG1LnCg30ZfwNUiu/YmWPICHPHsT0xEAvenwOEwUTlllUR8YYapL/w8iHIg9n1cn2iei4 l5qBs5yXasktNeZLvE37iM4zrAwruOAaZO9WLQtOvlSYXAaJ4mzcjqZiSnvOdeOji0+Vhcrp2Sj YPAX6QSKlRTCAPhVFdPueRC4F8sgoXuRJR6FLyrjgudS3o//6tx2eX6x4LCZQe01n1oY4LkOzzl xBWz1FOiZSB7NN7MkzStMbEo1Jc7e+Ur2ndrbeAGO1SwxDaWO5lXe0VW7UrLh83Yipz2r238HGo 61nRiXfQD+NAiHbGE5ubNj63lHR6qhv2HEMmfppX0tpi22NYMl+5aKnGx2NukE/l+ChYry9EHFO dm4/udF2U74ER0m5w33GCfaTLGN6VKre485OO3AMJLfsq+jBTYalxyuqdtv9wKw04DmBzjR+NO1 ISSLNC9Dm7CpZhNFlUwkIeDVuDzjm50Xhm2QsFYBPtJEzXkSWszi53d5pma/HsELdA9smRXYzqc CXhkqqlMohzJWyw== 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:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777211497320969037 X-GMAIL-MSGID: 1777211497320969037 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 devices rely on. Signed-off-by: Nikita Travkin --- .../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 3892ad4f639a..95dddf3b3880 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts @@ -33,6 +33,25 @@ wcnss_mem: wcnss@8b600000 { }; }; + 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"; @@ -220,6 +239,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_resin { status = "okay"; linux,code = ; @@ -232,10 +267,6 @@ pm8916_l17: l17 { }; }; -&pm8916_usbin { - status = "okay"; -}; - &pm8916_vib { status = "okay"; }; @@ -252,11 +283,11 @@ &sdhc_2 { &usb { status = "okay"; dr_mode = "peripheral"; - extcon = <&pm8916_usbin>; + extcon = <&pm8916_charger>; }; &usb_hs_phy { - extcon = <&pm8916_usbin>; + extcon = <&pm8916_charger>; }; &wcnss {