Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread Ladislav Michl
On Thu, Oct 19, 2017 at 09:24:16AM -0700, Tony Lindgren wrote: > * 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

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread Ladislav Michl
On Thu, Oct 19, 2017 at 09:24:16AM -0700, Tony Lindgren wrote: > * 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

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread H. Nikolaus Schaller
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 t

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread H. Nikolaus Schaller
/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 >>>>

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread Tony Lindgren
-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 dri

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread Tony Lindgren
ible 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. > >> > >&

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread H. Nikolaus Schaller
ercentage 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 a

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread H. Nikolaus Schaller
;>> 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

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread 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

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-19 Thread 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 >

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread H. Nikolaus Schaller
> Am 18.10.2017 um 18:13 schrieb Pavel Machek : > > On Wed 2017-10-18 17:52:22, H. Nikolaus Schaller wrote: >> >>> Am 18.10.2017 um 15:56 schrieb Pavel Machek : >>> >>> On Wed 2017-10-18 06:22:04, Tony Lindgren wrote: * H. Nikolaus Schaller

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread H. Nikolaus Schaller
> Am 18.10.2017 um 18:13 schrieb Pavel Machek : > > On Wed 2017-10-18 17:52:22, H. Nikolaus Schaller wrote: >> >>> Am 18.10.2017 um 15:56 schrieb Pavel Machek : >>> >>> On Wed 2017-10-18 06:22:04, Tony Lindgren wrote: * H. Nikolaus Schaller [171018 05:49]: >> Am 18.10.2017 um 14:28

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread Pavel Machek
On Wed 2017-10-18 17:52:22, H. Nikolaus Schaller wrote: > > > Am 18.10.2017 um 15:56 schrieb Pavel Machek : > > > > On Wed 2017-10-18 06:22:04, Tony Lindgren wrote: > >> * H. Nikolaus Schaller [171018 05:49]: > Am 18.10.2017 um 14:28 schrieb Pavel Machek

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread Pavel Machek
On Wed 2017-10-18 17:52:22, H. Nikolaus Schaller wrote: > > > Am 18.10.2017 um 15:56 schrieb Pavel Machek : > > > > On Wed 2017-10-18 06:22:04, Tony Lindgren wrote: > >> * H. Nikolaus Schaller [171018 05:49]: > Am 18.10.2017 um 14:28 schrieb Pavel Machek : > > So I started

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread H. Nikolaus Schaller
> Am 18.10.2017 um 15:56 schrieb Pavel Machek : > > On Wed 2017-10-18 06:22:04, Tony Lindgren wrote: >> * H. Nikolaus Schaller [171018 05:49]: Am 18.10.2017 um 14:28 schrieb Pavel Machek : So I started something, it is at.

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread H. Nikolaus Schaller
> Am 18.10.2017 um 15:56 schrieb Pavel Machek : > > On Wed 2017-10-18 06:22:04, Tony Lindgren wrote: >> * 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

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread H. Nikolaus Schaller
> 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 >>>

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread H. Nikolaus Schaller
> 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

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread Pavel Machek
On Wed 2017-10-18 06:22:04, Tony Lindgren wrote: > * 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

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread Pavel Machek
On Wed 2017-10-18 06:22:04, Tony Lindgren wrote: > * 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

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread 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 >

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread 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: >

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread Pavel Machek
> So I have three questions: > a) why do you use float/double instead of fixed point for such > simple and imprecise calculations? Cleaner code, and probably faster, too. Pavel -- (english)

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread Pavel Machek
> So I have three questions: > a) why do you use float/double instead of fixed point for such > simple and imprecise calculations? Cleaner code, and probably faster, too. Pavel -- (english)

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread H. Nikolaus Schaller
> Am 18.10.2017 um 14:28 schrieb Pavel Machek : > > Hi! > >>> Without patch description: See Last Question in >>> >>> Documentation/power/power_supply_class.txt >> >> ...should be done in libbattery, yet to be written. :-). >> >> Do you have specific guidance what you'd like to

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread H. Nikolaus Schaller
> Am 18.10.2017 um 14:28 schrieb Pavel Machek : > > Hi! > >>> Without patch description: See Last Question in >>> >>> Documentation/power/power_supply_class.txt >> >> ...should be done in libbattery, yet to be written. :-). >> >> Do you have specific guidance what you'd like to see in

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread Pavel Machek
Hi! > > Without patch description: See Last Question in > > > > Documentation/power/power_supply_class.txt > > ...should be done in libbattery, yet to be written. :-). > > Do you have specific guidance what you'd like to see in libbattery? So I started something, it is at.

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-10-18 Thread Pavel Machek
Hi! > > Without patch description: See Last Question in > > > > Documentation/power/power_supply_class.txt > > ...should be done in libbattery, yet to be written. :-). > > Do you have specific guidance what you'd like to see in libbattery? So I started something, it is at.

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-09-08 Thread H. Nikolaus Schaller
Hi, > Am 08.09.2017 um 13:32 schrieb Pavel Machek : > > Hi! > >>> + case POWER_SUPPLY_PROP_CAPACITY: >>> + { >>> + int ret, curr, voltage; >>> + >>> + ret = read_channel(adc_bat, POWER_SUPPLY_PROP_CURRENT_NOW, >>> ); >>> + ret |=

Re: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-09-08 Thread H. Nikolaus Schaller
Hi, > Am 08.09.2017 um 13:32 schrieb Pavel Machek : > > Hi! > >>> + case POWER_SUPPLY_PROP_CAPACITY: >>> + { >>> + int ret, curr, voltage; >>> + >>> + ret = read_channel(adc_bat, POWER_SUPPLY_PROP_CURRENT_NOW, >>> ); >>> + ret |= read_channel(adc_bat,

libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-09-08 Thread Pavel Machek
Hi! > > + case POWER_SUPPLY_PROP_CAPACITY: > > + { > > + int ret, curr, voltage; > > + > > + ret = read_channel(adc_bat, POWER_SUPPLY_PROP_CURRENT_NOW, > > ); > > + ret |= read_channel(adc_bat, POWER_SUPPLY_PROP_VOLTAGE_NOW, > > ); > > + if

libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-09-08 Thread Pavel Machek
Hi! > > + case POWER_SUPPLY_PROP_CAPACITY: > > + { > > + int ret, curr, voltage; > > + > > + ret = read_channel(adc_bat, POWER_SUPPLY_PROP_CURRENT_NOW, > > ); > > + ret |= read_channel(adc_bat, POWER_SUPPLY_PROP_VOLTAGE_NOW, > > ); > > + if

Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-08-29 Thread Sebastian Reichel
Hi, On Tue, Aug 01, 2017 at 10:55:26PM +0200, Marek Belisko wrote: > From: Marek Belisko > > Signed-off-by: Marek Belisko > --- > drivers/power/supply/generic-adc-battery.c | 14 ++ > 1 file changed, 14 insertions(+) > > diff

Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-08-29 Thread Sebastian Reichel
Hi, On Tue, Aug 01, 2017 at 10:55:26PM +0200, Marek Belisko wrote: > From: Marek Belisko > > Signed-off-by: Marek Belisko > --- > drivers/power/supply/generic-adc-battery.c | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/power/supply/generic-adc-battery.c >

[RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-08-01 Thread Marek Belisko
From: Marek Belisko Signed-off-by: Marek Belisko --- drivers/power/supply/generic-adc-battery.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/power/supply/generic-adc-battery.c

[RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling

2017-08-01 Thread Marek Belisko
From: Marek Belisko Signed-off-by: Marek Belisko --- drivers/power/supply/generic-adc-battery.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c index 0d27b59..9ce51d2 100644 ---