linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Belisko Marek <marek.belisko@gmail.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	"Dr. H. Nikolaus Schaller" <hns@goldelico.com>,
	Linux PM mailing list <linux-pm@vger.kernel.org>
Subject: Re: generic-adc-battery volatge-to-percent formula
Date: Fri, 12 Feb 2016 09:51:58 +0100	[thread overview]
Message-ID: <20160212085157.GA16326@amd> (raw)
In-Reply-To: <CAAfyv37rjchL=FtvgGhjrfXnCvhfbYCext48QmSuOgJ5RjTwAQ@mail.gmail.com>

Hi!
> 
> some time ago I did post series which added some conversion table from
> voltage to percent for charging and discharging states [1] in
> twl4030_madc driver. This approach was not accepted and we still want
> to have something like that in kernel. We re-think re-thinking
> original idea and also get reference where Pavel point us to formula
> which could be used for computing voltage-to-percent conversion [2]
> 
> What about adding this formula as a default for the
> voltage-to-percent-conversion to
> the generic-adc-battery driver (and converting it to DT)? Would that
> be a better solution than a table driven and twl4030 only driver?

I'd say battery, yes. And maybe even better would be putting it into
lib/ or seaparet driver, as it does not really depend on IIO? You just
supply voltage, current and internal resistance, and it produces number...

I'm using the same conversion tables on n900 (it has battery gauge,
but it is often not calibrated, so fallback method is nice), and it
seems to work quite ok.

Best regards,
									Pavel    
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2016-02-12  8:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 20:38 generic-adc-battery volatge-to-percent formula Belisko Marek
2016-02-12  8:51 ` Pavel Machek [this message]
2016-02-15  8:52   ` Belisko Marek
2016-02-15 11:53     ` Pavel Machek
2016-02-21 20:06       ` Sebastian Reichel
2016-02-21 20:36         ` H. Nikolaus Schaller
2016-02-21 21:12           ` Pavel Machek
2016-02-22  5:58             ` H. Nikolaus Schaller
2016-02-22 17:20               ` Sebastian Reichel
2016-10-24 12:34                 ` Pavel Machek
2016-10-24 13:09                   ` H. Nikolaus Schaller
2017-04-11 17:31                     ` Pavel Machek

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=20160212085157.GA16326@amd \
    --to=pavel@ucw.cz \
    --cc=hns@goldelico.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=marek.belisko@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).