Devicetree
 help / color / mirror / Atom feed
From: "Kaustabh Chakraborty" <kauschluss@disroot.org>
To: "Adil Hüsrev Tepe" <tadilhusrev@gmail.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Kaustabh Chakraborty" <kauschluss@disroot.org>
Cc: <linux-pm@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Yassine Oudjana" <y.oudjana@protonmail.com>
Subject: Re: [PATCH v2 3/3] power: supply: s2mu005-battery: add S2MU106 support
Date: Thu, 03 Dec 2026 20:26:28 +0530	[thread overview]
Message-ID: <DNB6OCUIXE22.QFQTFJM0E8GU@disroot.org> (raw)
In-Reply-To: <20261128-s2mu106-fg-v2-3-2c3142e05aaf@gmail.com>

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@gmail.com>
> ---
>  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@disroot.org>

      reply	other threads:[~2026-12-03 14:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 22:32 [PATCH v2 0/3] power: supply: s2mu005-battery: add S2MU106 Adil Hüsrev Tepe
2026-11-27 22:32 ` [PATCH v2 1/3] dt-bindings: power: supply: samsung,s2mu005-fuel-gauge: " Adil Hüsrev Tepe
2026-12-03 14:24   ` Krzysztof Kozlowski
2026-11-27 22:32 ` [PATCH v2 2/3] power: supply: s2mu005-battery: make the alert interrupt optional Adil Hüsrev Tepe
2026-12-03 14:48   ` Kaustabh Chakraborty
2026-11-27 22:32 ` [PATCH v2 3/3] power: supply: s2mu005-battery: add S2MU106 support Adil Hüsrev Tepe
2026-12-03 14:56   ` Kaustabh Chakraborty [this message]

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=DNB6OCUIXE22.QFQTFJM0E8GU@disroot.org \
    --to=kauschluss@disroot.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --cc=tadilhusrev@gmail.com \
    --cc=y.oudjana@protonmail.com \
    /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