From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753769AbbCQN7U (ORCPT ); Tue, 17 Mar 2015 09:59:20 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:35729 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbbCQN7R (ORCPT ); Tue, 17 Mar 2015 09:59:17 -0400 Date: Tue, 17 Mar 2015 14:59:13 +0100 From: Pavel Machek To: "Dr. H. Nikolaus Schaller" Cc: Belisko Marek , mark.rutland@arm.com, Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Tony Lindgren , "devicetree@vger.kernel.org" , LKML , "linux-omap@vger.kernel.org" , linux-arm-kernel , Linux PM mailing list , GTA04 owners Subject: Re: [PATCH v3 3/6] Documentation: DT: Document twl4030-madc-battery bindings Message-ID: <20150317135913.GA4034@amd> References: <1423088075-10025-1-git-send-email-marek@goldelico.com> <1423088075-10025-4-git-send-email-marek@goldelico.com> <20150316210532.GA11441@amd> <20150317084730.GA9761@amd> <940EE988-03A4-4B1B-A168-959E367953A6@goldelico.com> <20150317103746.GB3759@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > >>>>> to introduce coefficients for temperature and discharge rate? > >>>> What do you mean? Nothing like that is used in current driver why do > >>>> we need to add it? > >>> > >>> Well, conversion between Li-ion's voltage and state of charge at 0 > >>> current is well known: > >> > >> We can’t measure at 0 current since the OMAP is driven from battery > >> and charger and may also draw some mA… > > > > Yes, but you know how many mA you are taking just now. So if you knew > > the internal resistance, you could compute the voltage at 0 > > current. (And it should also work during charging, as long as you know > > how much current is going in.) > > As far as I understand the twl4030 charger and MADC it is not possible to > separate these values. It is only reporting the inflow from charger to > battery + system. So you don’t know how many mA are supplying the system > and how many mA are left over for charging. > > You can only assume how much the system is drawing while running (something > between 50 and 600 mA but this depends on system activities, power state > of peripherald and e.g. backlight being switched on). > > I think your basic assumption that we know any time how many mA the system > is taking is not given. So.. you won't be able to get exact value while charging, but you get one while discharging, which is what really matters...? > > Yes, and that coefficient should be internal battery resistance ;-). > > But where do you know this value from to write it into a DT file? > Usually you can’t measure it easily and for some batteries you don’t have > a data sheet. > > Contrary, the calibration curves can easily be measured on the device > (assuming that the charge level decreases/increases linearly over time > between Full and Empty). If you can copy it from the data sheet, that's the easiest option. If not, you should be able to easily compute it from the charge/discharge curves or from measured voltage at different loads. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: pavel@ucw.cz (Pavel Machek) Date: Tue, 17 Mar 2015 14:59:13 +0100 Subject: [PATCH v3 3/6] Documentation: DT: Document twl4030-madc-battery bindings In-Reply-To: References: <1423088075-10025-1-git-send-email-marek@goldelico.com> <1423088075-10025-4-git-send-email-marek@goldelico.com> <20150316210532.GA11441@amd> <20150317084730.GA9761@amd> <940EE988-03A4-4B1B-A168-959E367953A6@goldelico.com> <20150317103746.GB3759@amd> Message-ID: <20150317135913.GA4034@amd> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi! > >>>>> to introduce coefficients for temperature and discharge rate? > >>>> What do you mean? Nothing like that is used in current driver why do > >>>> we need to add it? > >>> > >>> Well, conversion between Li-ion's voltage and state of charge at 0 > >>> current is well known: > >> > >> We can?t measure at 0 current since the OMAP is driven from battery > >> and charger and may also draw some mA? > > > > Yes, but you know how many mA you are taking just now. So if you knew > > the internal resistance, you could compute the voltage at 0 > > current. (And it should also work during charging, as long as you know > > how much current is going in.) > > As far as I understand the twl4030 charger and MADC it is not possible to > separate these values. It is only reporting the inflow from charger to > battery + system. So you don?t know how many mA are supplying the system > and how many mA are left over for charging. > > You can only assume how much the system is drawing while running (something > between 50 and 600 mA but this depends on system activities, power state > of peripherald and e.g. backlight being switched on). > > I think your basic assumption that we know any time how many mA the system > is taking is not given. So.. you won't be able to get exact value while charging, but you get one while discharging, which is what really matters...? > > Yes, and that coefficient should be internal battery resistance ;-). > > But where do you know this value from to write it into a DT file? > Usually you can?t measure it easily and for some batteries you don?t have > a data sheet. > > Contrary, the calibration curves can easily be measured on the device > (assuming that the charge level decreases/increases linearly over time > between Full and Empty). If you can copy it from the data sheet, that's the easiest option. If not, you should be able to easily compute it from the charge/discharge curves or from measured voltage at different loads. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html