[PATCH 1/3] net: pse-pd: tps23881: Fix current measurement scaling

Thomas Wismer posted 3 patches 2 months, 2 weeks ago
There is a newer version of this series
[PATCH 1/3] net: pse-pd: tps23881: Fix current measurement scaling
Posted by Thomas Wismer 2 months, 2 weeks ago
From: Thomas Wismer <thomas.wismer@scs.ch>

The TPS23881 improves on the TPS23880 with current sense resistors reduced
from 255 mOhm to 200 mOhm. This has a direct impact on the scaling of the
current measurement. However, the latest TPS23881 data sheet from May 2023
still shows the scaling of the TPS23880 model.

Signed-off-by: Thomas Wismer <thomas.wismer@scs.ch>
---
 drivers/net/pse-pd/tps23881.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index 63f8f43062bc..b724b222ab44 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -62,7 +62,7 @@
 #define TPS23881_REG_SRAM_DATA	0x61
 
 #define TPS23881_UV_STEP	3662
-#define TPS23881_NA_STEP	70190
+#define TPS23881_NA_STEP	89500
 #define TPS23881_MW_STEP	500
 #define TPS23881_MIN_PI_PW_LIMIT_MW	2000
 
-- 
2.43.0
Re: [PATCH 1/3] net: pse-pd: tps23881: Fix current measurement scaling
Posted by Kory Maincent 2 months, 1 week ago
On Sat,  4 Oct 2025 20:03:49 +0200
Thomas Wismer <thomas@wismer.xyz> wrote:

> From: Thomas Wismer <thomas.wismer@scs.ch>
> 
> The TPS23881 improves on the TPS23880 with current sense resistors reduced
> from 255 mOhm to 200 mOhm. This has a direct impact on the scaling of the
> current measurement. However, the latest TPS23881 data sheet from May 2023
> still shows the scaling of the TPS23880 model.

Didn't know that. Where did you get that new current step value if it's not
from the datasheet?

Also as the value reported was wrong maybe we need a fix tag here and send it
to net instead of net-next.
 
> Signed-off-by: Thomas Wismer <thomas.wismer@scs.ch>
> ---
>  drivers/net/pse-pd/tps23881.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
> index 63f8f43062bc..b724b222ab44 100644
> --- a/drivers/net/pse-pd/tps23881.c
> +++ b/drivers/net/pse-pd/tps23881.c
> @@ -62,7 +62,7 @@
>  #define TPS23881_REG_SRAM_DATA	0x61
>  
>  #define TPS23881_UV_STEP	3662
> -#define TPS23881_NA_STEP	70190
> +#define TPS23881_NA_STEP	89500
>  #define TPS23881_MW_STEP	500
>  #define TPS23881_MIN_PI_PW_LIMIT_MW	2000
>  



-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Re: [PATCH 1/3] net: pse-pd: tps23881: Fix current measurement scaling
Posted by Thomas Wismer 2 months, 1 week ago
Am Mon, 6 Oct 2025 14:50:29 +0200
schrieb Kory Maincent <kory.maincent@bootlin.com>:

> On Sat,  4 Oct 2025 20:03:49 +0200
> Thomas Wismer <thomas@wismer.xyz> wrote:
> 
> > From: Thomas Wismer <thomas.wismer@scs.ch>
> > 
> > The TPS23881 improves on the TPS23880 with current sense resistors
> > reduced from 255 mOhm to 200 mOhm. This has a direct impact on the
> > scaling of the current measurement. However, the latest TPS23881
> > data sheet from May 2023 still shows the scaling of the TPS23880
> > model.  
> 
> Didn't know that. Where did you get that new current step value if
> it's not from the datasheet?

The correct current measurement scaling can either be found in the
TPS23881B datasheet revised in May 2025 or computed from the legacy sense
resistor value (255 mOhm / 200 mOhm * 70.19 uA = 89.50 uA). I was able to
verify the corrected scaling using power measurement instruments.

> Also as the value reported was wrong maybe we need a fix tag here and
> send it to net instead of net-next.

Right. I'll resubmit this patch to net.

> > Signed-off-by: Thomas Wismer <thomas.wismer@scs.ch>
> > ---
> >  drivers/net/pse-pd/tps23881.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/pse-pd/tps23881.c
> > b/drivers/net/pse-pd/tps23881.c index 63f8f43062bc..b724b222ab44
> > 100644 --- a/drivers/net/pse-pd/tps23881.c
> > +++ b/drivers/net/pse-pd/tps23881.c
> > @@ -62,7 +62,7 @@
> >  #define TPS23881_REG_SRAM_DATA	0x61
> >  
> >  #define TPS23881_UV_STEP	3662
> > -#define TPS23881_NA_STEP	70190
> > +#define TPS23881_NA_STEP	89500
> >  #define TPS23881_MW_STEP	500
> >  #define TPS23881_MIN_PI_PW_LIMIT_MW	2000
> >    
> 
> 
>