linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henrik Grimler <henrik@grimler.se>
To: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Cc: sre@kernel.org, linux-pm@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht, wolfgit@wiedmeyer.de,
	Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>,
	Hans de Goede <hdegoede@redhat.com>,
	Nikita Travkin <nikita@trvn.ru>
Subject: Re: [PATCH 1/1] power: supply: max17042_battery: use VFSOC for capacity when no rsns
Date: Mon, 27 Sep 2021 21:05:47 +0200	[thread overview]
Message-ID: <YVIWC5gehfh3TXX/@grimlerstat.localdomain> (raw)
In-Reply-To: <17ba5aaa-c456-2bb9-1680-ff0a302b412f@canonical.com>

On Fri, Sep 24, 2021 at 01:45:29PM +0200, Krzysztof Kozlowski wrote:
> Thanks for the patch. I found also my comments to Wolfgang's patch in
> 2016, which you resolve here but I have more. :)
> 
> I think my previous message about current sense are not correct. What is
> important is whether ModelGauge is being used/configured. For example
> none of DT platforms support it but ACPI might.
> There is incoming patch around it:
> https://lore.kernel.org/lkml/5702731.UytLkSCjyO@pliszka/
> 
> If you switch to VSSoc, I think you need to modify the SOC Alert Config
> in MiscCFG register (bits 0:1 to 0x1). Otherwise the alerts will be
> generated on different value.

So, 0x1 should correspond to AvSOC (i.e. non-filtered RepSOC), while
right now we write 0x3 (VFSOC) to MiscCFG for devices without current
sense [1]. Could you elaborate on why AvSOC should be used for alert
if we use VFSOC to get PROP_CAPACITY?

On this particular device it does not seem to make a difference what I
use for the SOC alert, the alert triggers all the time in any case
since RepSOC does not give an accurate value. Supposedly this happens
because ModelGauge configuration is incomplete, as you said. Looking
at the registers used by the ModelGauge it seems that only the
"characterization table" at 0x80 - 0xAF is missing. The rest (FullCap,
DesignCap, ICHGTerm, ..) are set to the same values as with vendor
kernel.

> Different topic:
> When touching Exynos-based boards (like Galaxy S3), please Cc me as
> well, even if I don't pop up in the maintainers.
> 
> For max17042 we need to Cc broader group of users, for example using it
> in ACPI platforms. The best is to pick the contributors.

Thanks for taking the time to explain this.

> Best regards,
> Krzysztof

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/power/supply/max17042_battery.c#n1092

Best regards,
Henrik Grimler

  reply	other threads:[~2021-09-27 19:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 20:07 [PATCH 0/1] power: supply: max17042_battery: use VFSOC for capacity when no rsns Henrik Grimler
2021-09-19 20:07 ` [PATCH 1/1] " Henrik Grimler
2021-09-24 11:45   ` Krzysztof Kozlowski
2021-09-27 19:05     ` Henrik Grimler [this message]
2021-09-28  9:18       ` Krzysztof Kozlowski
2021-09-28 18:32         ` Henrik Grimler
2021-09-28  9:22   ` Krzysztof Kozlowski
2021-09-28 19:18     ` Henrik Grimler

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=YVIWC5gehfh3TXX/@grimlerstat.localdomain \
    --to=henrik@grimler.se \
    --cc=hdegoede@redhat.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=nikita@trvn.ru \
    --cc=sebastian.krzyszkowiak@puri.sm \
    --cc=sre@kernel.org \
    --cc=wolfgit@wiedmeyer.de \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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;
as well as URLs for NNTP newsgroup(s).