Message ID | 20230916-pm8916-dtsi-bms-lbc-v1-1-7db0b42f9fb1@trvn.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;toshivichauhan@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <nikita@trvn.ru> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin <nikita@trvn.ru> 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: <linux-kernel.vger.kernel.org> 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 |
Series |
pm8916: Add BMS and charger
|
|
Commit Message
Nikita Travkin
Sept. 16, 2023, 1:57 p.m. UTC
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 <nikita@trvn.ru>
---
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(+)
Comments
On 16/09/2023 15:57, Nikita Travkin wrote: > PM8916 (and probably some other similar pmics) have hardware blocks for > battery monitoring and charging. Add patterns for respecive nodes so the typo: respective > dt for those blocks can be validated properly. > > Signed-off-by: Nikita Travkin <nikita@trvn.ru> > --- > Schemas for those devices were added in [1]. "Dependency" > > [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# That's just ref, so no need for oneOf... unless you already think this will grow with different schemas like the charger below? > + > "^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# > Best regards, Krzysztof
Krzysztof Kozlowski писал(а) 17.09.2023 12:58: > On 16/09/2023 15:57, Nikita Travkin wrote: >> PM8916 (and probably some other similar pmics) have hardware blocks for >> battery monitoring and charging. Add patterns for respecive nodes so the > > typo: respective > Oops, will fix if we get to v2. >> dt for those blocks can be validated properly. >> >> Signed-off-by: Nikita Travkin <nikita@trvn.ru> >> --- >> Schemas for those devices were added in [1]. > > "Dependency" > You are right, will try to word it better next time. >> >> [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# > > That's just ref, so no need for oneOf... unless you already think this > will grow with different schemas like the charger below? > Yes, I think some other PMICs have different battery/fuel-gauge blocks too so I'd like to have some room for expansion here. Thanks for the review! Nikita >> + >> "^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# >> > > Best regards, > Krzysztof
On 17/09/2023 10:26, Nikita Travkin wrote: > Krzysztof Kozlowski писал(а) 17.09.2023 12:58: >> On 16/09/2023 15:57, Nikita Travkin wrote: >>> PM8916 (and probably some other similar pmics) have hardware blocks for >>> battery monitoring and charging. Add patterns for respecive nodes so the >> >> typo: respective >> > > Oops, will fix if we get to v2. > >>> dt for those blocks can be validated properly. >>> >>> Signed-off-by: Nikita Travkin <nikita@trvn.ru> >>> --- >>> Schemas for those devices were added in [1]. >> >> "Dependency" >> > > You are right, will try to word it better next time. > >>> >>> [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# >> >> That's just ref, so no need for oneOf... unless you already think this >> will grow with different schemas like the charger below? >> > > Yes, I think some other PMICs have different battery/fuel-gauge > blocks too so I'd like to have some room for expansion here. There is always room. Which other device will have different battery charger? Best regards, Krzysztof
Krzysztof Kozlowski писал(а) 17.09.2023 13:32: > On 17/09/2023 10:26, Nikita Travkin wrote: >> Krzysztof Kozlowski писал(а) 17.09.2023 12:58: >>> On 16/09/2023 15:57, Nikita Travkin wrote: >>>> PM8916 (and probably some other similar pmics) have hardware blocks for >>>> battery monitoring and charging. Add patterns for respecive nodes so the >>> >>> typo: respective >>> >> >> Oops, will fix if we get to v2. >> >>>> dt for those blocks can be validated properly. >>>> >>>> Signed-off-by: Nikita Travkin <nikita@trvn.ru> >>>> --- >>>> Schemas for those devices were added in [1]. >>> >>> "Dependency" >>> >> >> You are right, will try to word it better next time. >> >>>> >>>> [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# >>> >>> That's just ref, so no need for oneOf... unless you already think this >>> will grow with different schemas like the charger below? >>> >> >> Yes, I think some other PMICs have different battery/fuel-gauge >> blocks too so I'd like to have some room for expansion here. > > There is always room. Which other device will have different battery > charger? > I know of non-"VM" BMS block in PM8226. It's used on some Nokia devices that people were working on so I expect it to appear in the future. There is also some BMS block in more modern PM6150 that I've seen being looked at by people interested in bringing sm7125 phones upstream. Both of those, to my knowledge, are completely different from this VM-BMS block, which I believe was present in the generation of pm8916, pm8909 and was abandoned again shortly after... Nikita > Best regards, > Krzysztof
On 17/09/2023 10:54, Nikita Travkin wrote: >>>>> + "^battery@[0-9a-f]+$": >>>>> + type: object >>>>> + oneOf: >>>>> + - $ref: /schemas/power/supply/qcom,pm8916-bms-vm.yaml# >>>> >>>> That's just ref, so no need for oneOf... unless you already think this >>>> will grow with different schemas like the charger below? >>>> >>> >>> Yes, I think some other PMICs have different battery/fuel-gauge >>> blocks too so I'd like to have some room for expansion here. >> >> There is always room. Which other device will have different battery >> charger? >> > > I know of non-"VM" BMS block in PM8226. It's used on some Nokia > devices that people were working on so I expect it to appear in > the future. > > There is also some BMS block in more modern PM6150 that I've > seen being looked at by people interested in bringing sm7125 > phones upstream. > > Both of those, to my knowledge, are completely different from > this VM-BMS block, which I believe was present in the generation > of pm8916, pm8909 and was abandoned again shortly after... OK, sounds good. Best regards, Krzysztof
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#