Re: [PATCH v11 2/2] power: supply: Add STC3117 fuel gauge unit driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Dec 16, 2024 at 12:34:55PM +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
> 
> Co-developed-by: Hardevsinh Palaniya <hardevsinh.palaniya@xxxxxxxxxxxxxxxxx>

This is not what I wrote. Please check the process documentation, which
I already referenced in my comment in your v9 submission. Apart from
that my comment also applies to the other patch in this series.

> Signed-off-by: Bhavin Sharma <bhavin.sharma@xxxxxxxxxxxxxxxxx>
> ---
>  MAINTAINERS                               |   8 +
>  drivers/power/supply/Kconfig              |   7 +
>  drivers/power/supply/Makefile             |   1 +
>  drivers/power/supply/stc3117_fuel_gauge.c | 607 ++++++++++++++++++++++
>  4 files changed, 623 insertions(+)
>  create mode 100644 drivers/power/supply/stc3117_fuel_gauge.c

[...]

> +	if (ram_data.reg.state != STC3117_RUNNING) {
> +		data->batt_current = -ENODATA;
> +		data->temp = -ENODATA;
> +	} else {
> +		if (data->voltage < APP_CUTOFF_VOLTAGE)
> +			data->soc = -ENODATA;
> +
> +		if (mode & STC3117_VMODE) {
> +			data->avg_current = -ENODATA;
> +			data->batt_current = -ENODATA;
> +		}
> +	}

You multiply these with 1000 (10 for temp) before returning them to
userspace. So you return (-ENODATA * 1000), which is obviously
wrong...

Greetings,

-- Sebastian

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux