[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <45rho3eswmyqf2ufnbzfbogftqhm7xxe5ylfvs3a4yvu3hrdhi@ljwxpgzzvkge>
Date: Fri, 13 Dec 2024 20:00:04 +0100
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Bhavin Sharma <bhavin.sharma@...iconsignals.io>
Cc: christophe.jaillet@...adoo.fr,
Hardevsinh Palaniya <hardevsinh.palaniya@...iconsignals.io>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, linux-pm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 2/2] power: supply: Add STC3117 fuel gauge unit driver
Hi,
Thanks for including the test output. Looks like everything is
returned with the correct units now :)
On Fri, Dec 13, 2024 at 12:08:10PM +0530, Bhavin Sharma wrote:
> Adds initial support for the STC3117 fuel gauge.
>
> The driver provides functionality to monitor key parameters including:
> - Voltage
> - Current
> - State of Charge (SOC)
> - Temperature
> - Status
>
> Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@...iconsignals.io>
> Signed-off-by: Bhavin Sharma <bhavin.sharma@...iconsignals.io>
> ---
You probably want to document Co-authorship? In that case you should
also add
Co-developed-by: Hardevsinh Palaniya <hardevsinh.palaniya@...iconsignals.io>
in addition to the Signed-off-by. See Documentation/process/submitting-patches.rst
for details.
> [...]
> +#define INVALID_TEMPERATURE 250
> [...]
> + /* INIT state, wait for batt_current & temperature value available: */
> + if (ram_data.reg.state == STC3117_INIT && count_m > 4) {
> + data->avg_voltage = data->voltage;
> + data->avg_current = data->batt_current;
> + ram_data.reg.state = STC3117_RUNNING;
> + }
> +
> + if (ram_data.reg.state != STC3117_RUNNING) {
> + data->batt_current = 0;
> + data->temp = INVALID_TEMPERATURE;
Please don't return arbitrary values when there is no data
available. We have error codes for this. I suppose in your case
-ENODATA makes most sense.
> + } else {
> + if (data->voltage < APP_CUTOFF_VOLTAGE)
> + data->soc = 0;
> +
> + if (mode & STC3117_VMODE) {
> + data->avg_current = 0;
> + data->batt_current = 0;
> + }
> + }
> [...]
Otherwise looks good to me.
Thanks,
-- Sebastian
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists