Re: [PATCH v2 3/3] power: supply: s2mu005-battery: add S2MU106 support
From: Kaustabh Chakraborty
Date: Thu Dec 03 2026 - 09:56:49 EST
On 2026-11-28 01:32 +03:00, Adil Hüsrev Tepe wrote:
> The S2MU106 fuel gauge uses the same STATUS/RVBAT/RCURCC/RSOC registers
> and scaling as the S2MU005, but has no MONOUT averaging path; reading the
> averaged voltage and current through it returns bogus values. Add a
> per-variant descriptor so the S2MU106 exposes only the instantaneous
> voltage, current, capacity and status, and derive the status from the
> instantaneous current when no average is available.
>
> Signed-off-by: Adil Hüsrev Tepe <tadilhusrev@xxxxxxxxx>
> ---
> drivers/power/supply/s2mu005-battery.c | 61 +++++++++++++++++++++++++++++-----
> 1 file changed, 52 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/power/supply/s2mu005-battery.c b/drivers/power/supply/s2mu005-battery.c
> index 9798a62ffec..a1bd9ffdd61 100644
> --- a/drivers/power/supply/s2mu005-battery.c
> +++ b/drivers/power/supply/s2mu005-battery.c
> @@ -38,6 +38,7 @@ struct s2mu005_fg {
> struct regmap *regmap;
> struct power_supply *psy;
> struct mutex monout_mutex;
> + bool has_monout;
> };
[...]
> +struct s2mu005_fg_variant {
> + const struct power_supply_desc *desc;
> + bool has_monout;
> +};
A small nit, move this struct declaration above, it's a more predictable
location to keep these in. Hence,
Reviewed-by: Kaustabh Chakraborty <kauschluss@xxxxxxxxxxx>