Thread (12 messages) 12 messages, 4 authors, 2017-04-11

Re: generic-adc-battery volatge-to-percent formula

From: Belisko Marek <hidden>
Date: 2016-02-15 08:52:49

Hi Pavel,

On Fri, Feb 12, 2016 at 9:51 AM, Pavel Machek [off-list ref] wrote:
Hi!
quoted
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...
Can we put this small helper to some common power header file which
can be then included
to driver which can use this formula. I think it's better way then
adding it to /lib as it won't be used
in whole kernel tree just in power. What do you think? Thanks.
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.
+1
Best regards,
                                                                        Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
BR,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help