From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754999AbdJSRG4 (ORCPT ); Thu, 19 Oct 2017 13:06:56 -0400 Received: from muru.com ([72.249.23.125]:44912 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753234AbdJSRGy (ORCPT ); Thu, 19 Oct 2017 13:06:54 -0400 Date: Thu, 19 Oct 2017 10:06:49 -0700 From: Tony Lindgren To: "H. Nikolaus Schaller" Cc: Ivaylo Dimitrov , sakari.ailus@linux.intel.com, Marek Belisko , khilman@kernel.org, Marek Belisko , linux-pm@vger.kernel.org, Aaro Koskinen , kernel list , Sebastian Reichel , martijn@brixit.nl, robh+dt@kernel.org, abcloriens@gmail.com, Pavel Machek , Pali =?utf-8?B?Um9ow6Fy?= , Sebastian Reichel , clayton@craftyguy.net, linux-omap , patrikbachan@gmail.com, linux-arm-kernel , serge@hallyn.com Subject: Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling Message-ID: <20171019170649.GG4394@atomide.com> References: <1501620926-22669-1-git-send-email-marek.belisko@open-nandra.com> <1501620926-22669-6-git-send-email-marek.belisko@open-nandra.com> <20170829101147.debhadzyfrxhkrvt@earth> <20170908113231.GJ18365@amd> <20171018122804.GA14376@amd> <61BFA8AF-657A-4AD7-A7AC-3E5DC3B7E83D@goldelico.com> <20171018132204.GD4394@atomide.com> <0C0901E1-23E8-4D04-B3A9-8314809A7A6B@goldelico.com> <20171019162416.GE4394@atomide.com> <152FA5B1-75F9-4F0B-9E05-6277CD83C975@goldelico.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152FA5B1-75F9-4F0B-9E05-6277CD83C975@goldelico.com> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * H. Nikolaus Schaller [171019 09:57]: > Hi Tony, > > > Am 19.10.2017 um 18:24 schrieb Tony Lindgren : > > > > * H. Nikolaus Schaller [171018 08:49]: > >> > >>> Am 18.10.2017 um 15:22 schrieb Tony Lindgren : > >>> > >>> * H. Nikolaus Schaller [171018 05:49]: > >>>>> Am 18.10.2017 um 14:28 schrieb Pavel Machek : > >>>>> > >>>>> So I started something, it is at. > >>>>> > >>>>> https://github.com/pavelmachek/libbattery > >>>>> > >>>>> My battery on n900 is currently uncalibrated (and charging), still it > >>>>> gets some kind of estimation: > >>>>> > >>>>> Battery -1 % > >>>>> Seconds -1 > >>>>> State 1 > >>>>> Voltage 3.88 V > >>>>> Battery 63 % > >>>>> > >>>>> Of course, there's a lot more work to be done. > >>>> > >>>> Nice start but not a solution to our problem. > >>>> > >>>> Our problem is that people simply expect that for example https://packages.debian.org/wheezy/xfce/xfce4-battery-plugin > >>>> displays the battery percentage. > >>> > >>> I think we could make things compatible with various battery apps by > >>> having libbattery write back the capacity percentage and time remaining > >>> to the kernel driver via sysfs or a dev entry. Then the kernel interface > >>> can just display the data to whatever apps. > >> > >> Hm. That would be quite difficult to understand and maintain code. > > > > How so? The libbattery can do it all, then the kernel drivers needing > > that will just display the most recent values to maintain compability > > with battery apps. > > Well, it looks as if you are thinking about a much more complex solution > than I am... > > The proposal we are discussing as > > [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling > > just reads the current voltage, charging current and uses a (nonlinear) > mapping to 0% .. 100%. Right, I was discussing Pavel's libbattery link posted above. No comments on the current patch series. Let's move the libbattery stuff to a new thread to avoid confusion. Regards, Tony From mboxrd@z Thu Jan 1 00:00:00 1970 From: tony@atomide.com (Tony Lindgren) Date: Thu, 19 Oct 2017 10:06:49 -0700 Subject: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling In-Reply-To: <152FA5B1-75F9-4F0B-9E05-6277CD83C975@goldelico.com> References: <1501620926-22669-1-git-send-email-marek.belisko@open-nandra.com> <1501620926-22669-6-git-send-email-marek.belisko@open-nandra.com> <20170829101147.debhadzyfrxhkrvt@earth> <20170908113231.GJ18365@amd> <20171018122804.GA14376@amd> <61BFA8AF-657A-4AD7-A7AC-3E5DC3B7E83D@goldelico.com> <20171018132204.GD4394@atomide.com> <0C0901E1-23E8-4D04-B3A9-8314809A7A6B@goldelico.com> <20171019162416.GE4394@atomide.com> <152FA5B1-75F9-4F0B-9E05-6277CD83C975@goldelico.com> Message-ID: <20171019170649.GG4394@atomide.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org * H. Nikolaus Schaller [171019 09:57]: > Hi Tony, > > > Am 19.10.2017 um 18:24 schrieb Tony Lindgren : > > > > * H. Nikolaus Schaller [171018 08:49]: > >> > >>> Am 18.10.2017 um 15:22 schrieb Tony Lindgren : > >>> > >>> * H. Nikolaus Schaller [171018 05:49]: > >>>>> Am 18.10.2017 um 14:28 schrieb Pavel Machek : > >>>>> > >>>>> So I started something, it is at. > >>>>> > >>>>> https://github.com/pavelmachek/libbattery > >>>>> > >>>>> My battery on n900 is currently uncalibrated (and charging), still it > >>>>> gets some kind of estimation: > >>>>> > >>>>> Battery -1 % > >>>>> Seconds -1 > >>>>> State 1 > >>>>> Voltage 3.88 V > >>>>> Battery 63 % > >>>>> > >>>>> Of course, there's a lot more work to be done. > >>>> > >>>> Nice start but not a solution to our problem. > >>>> > >>>> Our problem is that people simply expect that for example https://packages.debian.org/wheezy/xfce/xfce4-battery-plugin > >>>> displays the battery percentage. > >>> > >>> I think we could make things compatible with various battery apps by > >>> having libbattery write back the capacity percentage and time remaining > >>> to the kernel driver via sysfs or a dev entry. Then the kernel interface > >>> can just display the data to whatever apps. > >> > >> Hm. That would be quite difficult to understand and maintain code. > > > > How so? The libbattery can do it all, then the kernel drivers needing > > that will just display the most recent values to maintain compability > > with battery apps. > > Well, it looks as if you are thinking about a much more complex solution > than I am... > > The proposal we are discussing as > > [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling > > just reads the current voltage, charging current and uses a (nonlinear) > mapping to 0% .. 100%. Right, I was discussing Pavel's libbattery link posted above. No comments on the current patch series. Let's move the libbattery stuff to a new thread to avoid confusion. Regards, Tony