devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm
@ 2024-10-29 11:11 Andreas Kemnade
  2024-10-29 13:00 ` Matti Vaittinen
  2024-11-01 19:27 ` Rob Herring
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Kemnade @ 2024-10-29 11:11 UTC (permalink / raw)
  To: lee, robh, krzk+dt, conor+dt, mazziesaccount, devicetree,
	linux-kernel
  Cc: Andreas Kemnade, sre

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.

CC: sre@kernel.org
Reported-by: Matti Vaittinen <mazziesaccount@gmail.com>
Closes: https://lore.kernel.org/imx/6dcd724a-a55c-4cba-a45b-21e76b1973b0@gmail.com/T/#mf590875a9f4d3955cd1041d7196ff0c65c0a7e9d
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml  | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
index fa17686a64f7..09e7d68e92bf 100644
--- a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
@@ -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 {
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm
  2024-10-29 11:11 [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm Andreas Kemnade
@ 2024-10-29 13:00 ` Matti Vaittinen
  2024-11-01 19:27 ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Matti Vaittinen @ 2024-10-29 13:00 UTC (permalink / raw)
  To: Andreas Kemnade, lee, robh, krzk+dt, conor+dt, devicetree,
	linux-kernel; +Cc: sre

On 29/10/2024 13:11, Andreas Kemnade wrote:
> 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.
> 
> CC: sre@kernel.org
> Reported-by: Matti Vaittinen <mazziesaccount@gmail.com>
> Closes: https://lore.kernel.org/imx/6dcd724a-a55c-4cba-a45b-21e76b1973b0@gmail.com/T/#mf590875a9f4d3955cd1041d7196ff0c65c0a7e9d
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>

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!]

Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

> ---
>   .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml  | 13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> index fa17686a64f7..09e7d68e92bf 100644
> --- a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> @@ -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 {


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm
  2024-10-29 11:11 [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm Andreas Kemnade
  2024-10-29 13:00 ` Matti Vaittinen
@ 2024-11-01 19:27 ` Rob Herring
  2024-11-04  6:06   ` Matti Vaittinen
  2024-11-04  9:00   ` Andreas Kemnade
  1 sibling, 2 replies; 7+ messages in thread
From: Rob Herring @ 2024-11-01 19:27 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: lee, krzk+dt, conor+dt, mazziesaccount, devicetree, linux-kernel,
	sre

On Tue, Oct 29, 2024 at 12:11:12PM +0100, Andreas Kemnade wrote:
> 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?

> 
> CC: sre@kernel.org
> Reported-by: Matti Vaittinen <mazziesaccount@gmail.com>
> Closes: https://lore.kernel.org/imx/6dcd724a-a55c-4cba-a45b-21e76b1973b0@gmail.com/T/#mf590875a9f4d3955cd1041d7196ff0c65c0a7e9d
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
>  .../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.

> 
> diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> index fa17686a64f7..09e7d68e92bf 100644
> --- a/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
> @@ -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 {
> -- 
> 2.39.5
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm
  2024-11-01 19:27 ` Rob Herring
@ 2024-11-04  6:06   ` Matti Vaittinen
  2024-11-11 10:31     ` Andreas Kemnade
  2024-11-04  9:00   ` Andreas Kemnade
  1 sibling, 1 reply; 7+ messages in thread
From: Matti Vaittinen @ 2024-11-04  6:06 UTC (permalink / raw)
  To: Rob Herring, Andreas Kemnade
  Cc: lee, krzk+dt, conor+dt, devicetree, linux-kernel, sre

On 01/11/2024 21:27, Rob Herring wrote:
> On Tue, Oct 29, 2024 at 12:11:12PM +0100, Andreas Kemnade wrote:
>> 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?
> 
>>
>> CC: sre@kernel.org
>> Reported-by: Matti Vaittinen <mazziesaccount@gmail.com>
>> Closes: https://lore.kernel.org/imx/6dcd724a-a55c-4cba-a45b-21e76b1973b0@gmail.com/T/#mf590875a9f4d3955cd1041d7196ff0c65c0a7e9d
>> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
>> ---
>>   .../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.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm
  2024-11-01 19:27 ` Rob Herring
  2024-11-04  6:06   ` Matti Vaittinen
@ 2024-11-04  9:00   ` Andreas Kemnade
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Kemnade @ 2024-11-04  9:00 UTC (permalink / raw)
  To: Rob Herring
  Cc: lee, krzk+dt, conor+dt, mazziesaccount, devicetree, linux-kernel,
	sre

Am Fri, 1 Nov 2024 14:27:05 -0500
schrieb Rob Herring <robh@kernel.org>:

> On Tue, Oct 29, 2024 at 12:11:12PM +0100, Andreas Kemnade wrote:
> > 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)

> rathes?

ok, simple typo: rather

Regards,
Andreas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm
  2024-11-04  6:06   ` Matti Vaittinen
@ 2024-11-11 10:31     ` Andreas Kemnade
  2024-11-12  5:42       ` Matti Vaittinen
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Kemnade @ 2024-11-11 10:31 UTC (permalink / raw)
  To: Matti Vaittinen
  Cc: Rob Herring, lee, krzk+dt, conor+dt, devicetree, linux-kernel,
	sre

Am Mon, 4 Nov 2024 08:06:53 +0200
schrieb Matti Vaittinen <mazziesaccount@gmail.com>:

> On 01/11/2024 21:27, Rob Herring wrote:
> > On Tue, Oct 29, 2024 at 12:11:12PM +0100, Andreas Kemnade wrote:  
> >> 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?
> >   
> >>
> >> CC: sre@kernel.org
> >> Reported-by: Matti Vaittinen <mazziesaccount@gmail.com>
> >> Closes: https://lore.kernel.org/imx/6dcd724a-a55c-4cba-a45b-21e76b1973b0@gmail.com/T/#mf590875a9f4d3955cd1041d7196ff0c65c0a7e9d
> >> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> >> ---
> >>   .../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.  
> 
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm
  2024-11-11 10:31     ` Andreas Kemnade
@ 2024-11-12  5:42       ` Matti Vaittinen
  0 siblings, 0 replies; 7+ messages in thread
From: Matti Vaittinen @ 2024-11-12  5:42 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Rob Herring, lee, krzk+dt, conor+dt, devicetree, linux-kernel,
	sre

On 11/11/2024 12:31, Andreas Kemnade wrote:
> Am Mon, 4 Nov 2024 08:06:53 +0200
> schrieb Matti Vaittinen <mazziesaccount@gmail.com>:
> 
>> On 01/11/2024 21:27, Rob Herring wrote:
>>> On Tue, Oct 29, 2024 at 12:11:12PM +0100, Andreas Kemnade wrote:
>>>> 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?
>>>    
>>>>
>>>> CC: sre@kernel.org
>>>> Reported-by: Matti Vaittinen <mazziesaccount@gmail.com>
>>>> Closes: https://lore.kernel.org/imx/6dcd724a-a55c-4cba-a45b-21e76b1973b0@gmail.com/T/#mf590875a9f4d3955cd1041d7196ff0c65c0a7e9d
>>>> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
>>>> ---
>>>>    .../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.
>>
>> 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-11-12  5:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 11:11 [PATCH] dt-bindings: mfd: bd71828: Use charger resistor in mOhm instead of MOhm Andreas Kemnade
2024-10-29 13:00 ` Matti Vaittinen
2024-11-01 19:27 ` Rob Herring
2024-11-04  6:06   ` Matti Vaittinen
2024-11-11 10:31     ` Andreas Kemnade
2024-11-12  5:42       ` Matti Vaittinen
2024-11-04  9:00   ` Andreas Kemnade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).