[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7178eb322fafaf0fbcdc4b91d9f9a65d996e4e6b.camel@linaro.org>
Date: Tue, 07 Jan 2025 11:00:16 +0000
From: André Draszik <andre.draszik@...aro.org>
To: t.antoine@...ouvain.be, Sebastian Reichel <sre@...nel.org>, 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>, Alim Akhtar <alim.akhtar@...sung.com>
Cc: 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 v2 1/4] power: supply: add support for max77759 fuel
gauge
Hi Thomas,
Thanks for your patch!
On Thu, 2025-01-02 at 12:15 +0100, Thomas Antoine via B4 Relay wrote:
> From: Thomas Antoine <t.antoine@...ouvain.be>
>
> The interface of the Maxim max77759 fuel gauge has a lot of common with the
> Maxim max1720x. The major difference is the lack of non-volatile memory
> slave address. No slave is available at address 0xb of the i2c bus, which
> is coherent with the following driver from google: line 5836 disables
> non-volatile memory for m5 gauge.
>
> Link: https://android.googlesource.com/kernel/google-modules/bms/+/1a68c36bef474573cc8629cc1d121eb6a81ab68c/max1720x_battery.c
>
> Other differences include the lack of V_BATT register to read the battery
> level and a difference in the way to identify the chip (the same register
> is used but not the same mask).
It also seems the reported POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN is
quite a bit off - on my Pixel 6, it reports ca. 1131mAh, but the downstream
stack reports a more reasonable 4524mAh. Interestingly, this is an exact
multiple of four.
POWER_SUPPLY_PROP_CHARGE_FULL is off in a similar way, and I suspect that
related properties like charge_avg, time_to_empty, time_to_full are
reported incorrectly as well.
[...]
> @@ -483,14 +608,27 @@ static int max1720x_probe(struct i2c_client *client)
> psy_cfg.drv_data = info;
> psy_cfg.fwnode = dev_fwnode(dev);
> i2c_set_clientdata(client, info);
> - info->regmap = devm_regmap_init_i2c(client, &max1720x_regmap_cfg);
> +
> + data = device_get_match_data(dev);
> + if (!data)
> + return dev_err_probe(dev, ret, "Failed to get chip data\n");
^^^
This should be -EINVAL.
Cheers,
Andre'
Powered by blists - more mailing lists