Skip to contentSkip to conversation

dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm

PATCH Superseded Andreas Kemnade 3 participants 7 messages Oct 29, 2024 – Nov 12, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm

Apparently there was some confusion regarding milliohm vs. megaohm. (m/M). Use microohms to be able to properly specify the charger resistor like other drivers do. This is not used yet by mainline code yet. Specify a current sense resistor in milliohms range rathes then megaohms range in the examples.

---
 .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml  | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +7 -6
index fa17686a64f7..09e7d68e92bf 100644
@@ -55,14 +55,15 @@ properties:
     minimum: 0
     maximum: 1
 
-  rohm,charger-sense-resistor-ohms:
-    minimum: 10000000
-    maximum: 50000000
+  rohm,charger-sense-resistor-micro-ohms:
+    minimum: 10000
+    maximum: 50000
+    default: 30000
     description: |
       BD71827 and BD71828 have SAR ADC for measuring charging currents.
       External sense resistor (RSENSE in data sheet) should be used. If some
-      other but 30MOhm resistor is used the resistance value should be given
-      here in Ohms.
+      other but 30mOhm resistor is used the resistance value should be given
+      here in microohms.
 
   regulators:
     $ref: /schemas/regulator/rohm,bd71828-regulator.yaml
@@ -114,7 +115,7 @@ examples:
             #gpio-cells = <2>;
             gpio-reserved-ranges = <0 1>, <2 1>;
 
-            rohm,charger-sense-resistor-ohms = <10000000>;
+            rohm,charger-sense-resistor-micro-ohms = <10000>;
 
             regulators {
                 buck1: BUCK1 {
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Andreas Kemnade

Apparently there was some confusion regarding milliohm vs. megaohm. (m/M). Use microohms to be able to properly specify the charger resistor like other drivers do. This is not used yet by mainline code yet. Specify a current sense resistor in milliohms range rathes then megaohms range in the examples.

Thanks a ton Andreas :) Maybe a

Fixes 1af5332fcf7c ("dt-bindings: mfd: Document ROHM BD71828 bindings")

as well?

[I just pushed something like this (but untested) in my repo - but I missed updating the example!]

Quoted 38 lines
---
  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml  | 13 +++++++------
  1 file changed, 7 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +7 -6
index fa17686a64f7..09e7d68e92bf 100644
@@ -55,14 +55,15 @@ properties:
      minimum: 0
      maximum: 1
 
-  rohm,charger-sense-resistor-ohms:
-    minimum: 10000000
-    maximum: 50000000
+  rohm,charger-sense-resistor-micro-ohms:
+    minimum: 10000
+    maximum: 50000
+    default: 30000
      description: |
        BD71827 and BD71828 have SAR ADC for measuring charging currents.
        External sense resistor (RSENSE in data sheet) should be used. If some
-      other but 30MOhm resistor is used the resistance value should be given
-      here in Ohms.
+      other but 30mOhm resistor is used the resistance value should be given
+      here in microohms.
 
    regulators:
      $ref: /schemas/regulator/rohm,bd71828-regulator.yaml
@@ -114,7 +115,7 @@ examples:
              #gpio-cells = <2>;
              gpio-reserved-ranges = <0 1>, <2 1>;
 
-            rohm,charger-sense-resistor-ohms = <10000000>;
+            rohm,charger-sense-resistor-micro-ohms = <10000>;
 
              regulators {
                  buck1: BUCK1 {
maintainer
#2 lore raw
In reply to Andreas Kemnade
Quoted 5 lines · Andreas Kemnade

Apparently there was some confusion regarding milliohm vs. megaohm. (m/M). Use microohms to be able to properly specify the charger resistor like other drivers do. This is not used yet by mainline code yet. Specify a current sense resistor in milliohms range rathes then megaohms range in the examples.

milliohms?

rathes?

Quoted 8 lines
---
 .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml  | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Looks like rohm,bd71815-pmic.yaml has the same problem.

Quoted 38 lines
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +7 -6
index fa17686a64f7..09e7d68e92bf 100644
@@ -55,14 +55,15 @@ properties:
     minimum: 0
     maximum: 1
 
-  rohm,charger-sense-resistor-ohms:
-    minimum: 10000000
-    maximum: 50000000
+  rohm,charger-sense-resistor-micro-ohms:
+    minimum: 10000
+    maximum: 50000
+    default: 30000
     description: |
       BD71827 and BD71828 have SAR ADC for measuring charging currents.
       External sense resistor (RSENSE in data sheet) should be used. If some
-      other but 30MOhm resistor is used the resistance value should be given
-      here in Ohms.
+      other but 30mOhm resistor is used the resistance value should be given
+      here in microohms.
 
   regulators:
     $ref: /schemas/regulator/rohm,bd71828-regulator.yaml
@@ -114,7 +115,7 @@ examples:
             #gpio-cells = <2>;
             gpio-reserved-ranges = <0 1>, <2 1>;
 
-            rohm,charger-sense-resistor-ohms = <10000000>;
+            rohm,charger-sense-resistor-micro-ohms = <10000>;
 
             regulators {
                 buck1: BUCK1 {
Signature · 1 line
2.39.5
#3 lore raw
Quoted 20 lines · Rob Herring
Quoted 5 lines · Andreas Kemnade

Apparently there was some confusion regarding milliohm vs. megaohm. (m/M). Use microohms to be able to properly specify the charger resistor like other drivers do. This is not used yet by mainline code yet. Specify a current sense resistor in milliohms range rathes then megaohms range in the examples.

milliohms?

rathes?

Quoted 8 lines
---
  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml  | 13 +++++++------
  1 file changed, 7 insertions(+), 6 deletions(-)
Quoted 1 line

Looks like rohm,bd71815-pmic.yaml has the same problem.

Yes! Thanks for pointing it out. I'll wait for a while if Andreas wants to fix them both at the same go. I'll send a fix for BD71815 if I've not seen one in a week or so :)

Yours,

    --Matti
#4 lore raw

Am Mon, 4 Nov 2024 08:06:53 +0200
schrieb Matti Vaittinen <[email protected]>:

Quoted 21 lines · Rob Herring
Quoted 20 lines · Andreas Kemnade
Quoted 5 lines

Apparently there was some confusion regarding milliohm vs. megaohm. (m/M). Use microohms to be able to properly specify the charger resistor like other drivers do. This is not used yet by mainline code yet. Specify a current sense resistor in milliohms range rathes then megaohms range in the examples.

milliohms?

rathes?

Quoted 8 lines
---
  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml  | 13 +++++++------
  1 file changed, 7 insertions(+), 6 deletions(-)  
Quoted 6 lines
Quoted 1 line

Looks like rohm,bd71815-pmic.yaml has the same problem.

Yes! Thanks for pointing it out. I'll wait for a while if Andreas wants to fix them both at the same go. I'll send a fix for BD71815 if I've not seen one in a week or so :)

There is more debris left from an apparently copy-paste-modify process from bd71828. That should be checked. At least there are several occurances of the BD71828 string in there. So a brush is needed.

Regards,
Andreas

#5 lore raw
Quoted 26 lines · Andreas Kemnade

Am Mon, 4 Nov 2024 08:06:53 +0200
schrieb Matti Vaittinen <[email protected]>:

Quoted 23 lines · Rob Herring
Quoted 21 lines · Andreas Kemnade
Quoted 5 lines

Apparently there was some confusion regarding milliohm vs. megaohm. (m/M). Use microohms to be able to properly specify the charger resistor like other drivers do. This is not used yet by mainline code yet. Specify a current sense resistor in milliohms range rathes then megaohms range in the examples.

milliohms?

rathes?

Quoted 8 lines
---
   .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml  | 13 +++++++------
   1 file changed, 7 insertions(+), 6 deletions(-)

Looks like rohm,bd71815-pmic.yaml has the same problem.

Quoted 7 lines
Quoted 4 lines

Yes! Thanks for pointing it out. I'll wait for a while if Andreas wants to fix them both at the same go. I'll send a fix for BD71815 if I've not seen one in a week or so :)

There is more debris left from an apparently copy-paste-modify process from bd71828. That should be checked. At least there are several occurances of the BD71828 string in there. So a brush is needed.

Thanks for a heads-up Andreas. I'll take a look at it :)

Yours,
-- Matti

#6 lore raw
In reply to Rob Herring

Am Fri, 1 Nov 2024 14:27:05 -0500
schrieb Rob Herring <[email protected]>:

Quoted 9 lines · Andreas Kemnade
Quoted 5 lines

Apparently there was some confusion regarding milliohm vs. megaohm. (m/M). Use microohms to be able to properly specify the charger resistor like other drivers do. This is not used yet by mainline code yet. Specify a current sense resistor in milliohms range rathes then megaohms range in the examples.

milliohms?

hmm, do not understand what you are after: Milliohms range:
I mean a value well expressed in milliohm (like 10-50mohm) in the examples, but we use microohms to specify it like we often to, having room for some unexpected precision requirements as we do in other places also (microvolts for values more in mV/V range)

Quoted 1 line

rathes?

ok, simple typo: rather

Regards,
Andreas