lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <zc7kbscxpwjkqypichbroxpthnrajjn55gttapmugscloccqdz@y336iasbb3w5>
Date: Mon, 7 Jul 2025 01:40:15 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Pavel Machek <pavel@....cz>
Cc: t.antoine@...ouvain.be, Rob Herring <robh@...nel.org>, 
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, 
	Dimitri Fedrau <dima.fedrau@...il.com>, Catalin Marinas <catalin.marinas@....com>, 
	Will Deacon <will@...nel.org>, Peter Griffin <peter.griffin@...aro.org>, 
	André Draszik <andre.draszik@...aro.org>, Tudor Ambarus <tudor.ambarus@...aro.org>, 
	Alim Akhtar <alim.akhtar@...sung.com>, linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
	linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH v4 2/5] power: supply: add support for max77759 fuel gauge

Hi,

On Thu, Jul 03, 2025 at 10:12:28PM +0200, Pavel Machek wrote:
> > > Other differences include the lack of V_BATT register to read the battery
> > > level. The voltage must instead be read from V_CELL, the lowest voltage of
> > > all cells. The mask to identify the chip is different. The computation of
> > > the charge must also be changed to take into account TASKPERIOD, which
> > > can add a factor 2 to the result.
> > > 
> > > Add support for the MAX77759 by taking into account all of those
> > > differences based on chip type.
> > > 
> > > Do not advertise temp probes using the non-volatile memory as those are
> > > not available.
> > > 
> > > The regmap was proposed by André Draszik in
> > > 
> > > Link: https://lore.kernel.org/all/d1bade77b5281c1de6b2ddcb4dbbd033e455a116.camel@linaro.org/
> > > 
> > > Signed-off-by: Thomas Antoine <t.antoine@...ouvain.be>
> > > ---
> > >  drivers/power/supply/max1720x_battery.c | 265 ++++++++++++++++++++++++++++----
> > >  1 file changed, 238 insertions(+), 27 deletions(-)
> > > 
> > > diff --git a/drivers/power/supply/max1720x_battery.c b/drivers/power/supply/max1720x_battery.c
> > > index 68b5314ecf3a234f906ec8fe400e586855b69cd9..c9ad452ada9d0a2a51f37d04fd8c3260be522405 100644
> > > --- a/drivers/power/supply/max1720x_battery.c
> > > +++ b/drivers/power/supply/max1720x_battery.c
> > > @@ -37,6 +37,7 @@
> > >  #define MAX172XX_REPCAP			0x05	/* Average capacity */
> > >  #define MAX172XX_REPSOC			0x06	/* Percentage of charge */
> > >  #define MAX172XX_TEMP			0x08	/* Temperature */
> > > +#define MAX172XX_VCELL			0x09	/* Lowest cell voltage */
> > [...]
> > >  	case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> > [...]
> > > +			ret = regmap_read(info->regmap, MAX172XX_VCELL, &reg_val);
> > > +			val->intval = max172xx_cell_voltage_to_ps(reg_val);
> > 
> > I haven't reviewed this fully due to all the feedback you already
> > got from Peter Griffin and the DT binding being broken, but something
> > that catched my eye:
> > 
> > POWER_SUPPLY_PROP_VOLTAGE_NOW provides the voltage of the whole
> > battery and not of a single cell. E.g. a typical Li-Ion battery
> > with two serial cells has a nominal voltage of roughly 7.4V while
> > each cell has just 3.7V.
> 
> Phones normally only have one cell...

... and chips often support more and are used in all kind of devices.

(Btw. some new high-end phones start to have 1S2P configuration)

Greetings,

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ