From: Pavel Machek <pavel@ucw.cz>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: t.antoine@uclouvain.be, "Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Dimitri Fedrau" <dima.fedrau@gmail.com>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>,
"Peter Griffin" <peter.griffin@linaro.org>,
"André Draszik" <andre.draszik@linaro.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH v4 2/5] power: supply: add support for max77759 fuel gauge
Date: Thu, 3 Jul 2025 22:12:28 +0200 [thread overview]
Message-ID: <aGbkLIFkMlihbJUt@duo.ucw.cz> (raw)
In-Reply-To: <4cahu6dog7ly4ww6xyjmjigjfxs4m55mrnym2bjmzskscfvk34@guazy6wxbzfh>
[-- Attachment #1: Type: text/plain, Size: 2292 bytes --]
Hi!
> > 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@uclouvain.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, ®_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...
Best regards,
Pavel
--
I don't work for Nazis and criminals, and neither should you.
Boycott Putin, Trump, and Musk!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2025-07-03 20:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 12:51 [PATCH v4 0/5] Google Pixel 6 (oriole): max77759 fuel gauge enablement and driver support Thomas Antoine via B4 Relay
2025-05-23 12:51 ` [PATCH v4 1/5] power: supply: max1720x correct capacity computation Thomas Antoine via B4 Relay
2025-05-23 12:51 ` [PATCH v4 2/5] power: supply: add support for max77759 fuel gauge Thomas Antoine via B4 Relay
2025-06-06 11:40 ` Peter Griffin
2025-06-24 15:46 ` Thomas Antoine
2025-07-07 7:16 ` Peter Griffin
2025-07-07 8:04 ` André Draszik
2025-07-07 8:52 ` Peter Griffin
2025-06-22 21:26 ` Sebastian Reichel
2025-06-25 12:12 ` Thomas Antoine
2025-07-06 23:58 ` Sebastian Reichel
2025-07-03 20:12 ` Pavel Machek [this message]
2025-07-06 23:40 ` Sebastian Reichel
2025-05-23 12:51 ` [PATCH v4 3/5] dt-bindings: power: supply: add max77759-fg flavor Thomas Antoine via B4 Relay
2025-05-23 14:23 ` Rob Herring (Arm)
2025-05-23 12:51 ` [PATCH v4 4/5] arm64: defconfig: enable Maxim max1720x driver Thomas Antoine via B4 Relay
2025-06-05 13:10 ` Peter Griffin
2025-05-23 12:51 ` [PATCH v4 5/5] arm64: dts: exynos: gs101-oriole: enable Maxim max77759 fuel gauge Thomas Antoine via B4 Relay
2025-06-05 13:00 ` Peter Griffin
2025-06-26 12:59 ` Thomas Antoine
2025-06-22 21:31 ` (subset) [PATCH v4 0/5] Google Pixel 6 (oriole): max77759 fuel gauge enablement and driver support Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aGbkLIFkMlihbJUt@duo.ucw.cz \
--to=pavel@ucw.cz \
--cc=alim.akhtar@samsung.com \
--cc=andre.draszik@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dima.fedrau@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=t.antoine@uclouvain.be \
--cc=tudor.ambarus@linaro.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox