diff mbox series

[1/3] dt-bindings: mfd: qcom,spmi-pmic: Add pm8916 vm-bms and lbc

Message ID 20230916-pm8916-dtsi-bms-lbc-v1-1-7db0b42f9fb1@trvn.ru
State Accepted
Commit 7ac5241eaec4c25dd5a78734ae3c33cb25c8bf97
Headers show
Series pm8916: Add BMS and charger | expand

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

Rob Herring (Arm) Sept. 16, 2023, 2:18 p.m. UTC | #1
On Sat, 16 Sep 2023 18:57:04 +0500, 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
> 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(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml:
Error in referenced schema matching $id: http://devicetree.org/schemas/power/supply/qcom,pm8916-bms-vm.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230916-pm8916-dtsi-bms-lbc-v1-1-7db0b42f9fb1@trvn.ru

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Krzysztof Kozlowski Sept. 17, 2023, 7:58 a.m. UTC | #2
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
Nikita Travkin Sept. 17, 2023, 8:26 a.m. UTC | #3
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
Krzysztof Kozlowski Sept. 17, 2023, 8:32 a.m. UTC | #4
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
Nikita Travkin Sept. 17, 2023, 8:54 a.m. UTC | #5
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
Krzysztof Kozlowski Sept. 17, 2023, 9:13 a.m. UTC | #6
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 mbox series

Patch

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#