public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sicelo <absicsz@gmail.com>
To: "Pali Rohár" <pali@kernel.org>
Cc: sre@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/1] power: supply: bq27xxx: expose battery data when CI=1
Date: Wed, 20 Apr 2022 00:32:13 +0200	[thread overview]
Message-ID: <Yl84bed9pZaF7H4x@tp440p.steeds.sam> (raw)
In-Reply-To: <20220419220959.jnyhycaarxtucymo@pali>

On Wed, Apr 20, 2022 at 12:09:59AM +0200, Pali Rohár wrote:
> NAC (Nominal Available Capacity) is exported via CHARGE_NOW property.
> 
> So what about implementing CHARGE_NOW property also writable and write
> operation would do this WRTNAC seeding? So userspace would be able to do
> 'echo new_value > charge_now' and for Nokia N900 case just directly
> 'cat .../rx51_battery/charge_full_design > .../bq27200/charge_now'
Thank you for this suggestion. I'm afraid implementing it would be a bit
too involved for my current level of experience.  If someone beats me to
implementing WRTNAC ability, all the better.  Otherwise I will
definitely want to look into it in the future.

The challenge with seeding via rx51_battery is that it provides
CHARGE_FULL_DESIGN, so one must still calculate a NAC value from the
voltage. In my userspace script [1], I am currently using a linear
calculation, but obviously this is not really correct.

I might mention, in passing, that I also wish to later add the 
VOLTAGE_MIN_DESIGN property (which will be taken from EDVF). It may help
userspace (e.g. upower) know when to shutdown the device if CI is set,
as capacity cannot be trusted.

Regards
Sicelo

[1] https://gist.github.com/sicelo/0a0e895d81a6b73b26555d215dee296d#file-rx51_seed_bq27xxx-sh-L34-L42

      reply	other threads:[~2022-04-19 22:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 21:36 [PATCH 0/1] power: supply: bq27xxx: expose battery data when CI=1 Sicelo A. Mhlongo
2022-04-19 21:36 ` [PATCH 1/1] " Sicelo A. Mhlongo
2022-04-19 21:59   ` Pali Rohár
2022-04-19 22:09 ` [PATCH 0/1] " Pali Rohár
2022-04-19 22:32   ` Sicelo [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=Yl84bed9pZaF7H4x@tp440p.steeds.sam \
    --to=absicsz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pali@kernel.org \
    --cc=sre@kernel.org \
    /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