Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Olaf Titz
> + res = bq27xxx_battery_voltage(di, ); > + if (res) > + return res; > + > + mV = val.intval / 1000; Reading that code I stumbled over the comment in bq27xxx_battery_voltage saying that it returns millivolts. The code here, the code in bq27xxx_battery_voltage and

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Olaf Titz
> + res = bq27xxx_battery_voltage(di, ); > + if (res) > + return res; > + > + mV = val.intval / 1000; Reading that code I stumbled over the comment in bq27xxx_battery_voltage saying that it returns millivolts. The code here, the code in bq27xxx_battery_voltage and

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pali Rohár
On Tuesday 25 October 2016 13:27:57 Pavel Machek wrote: > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > * Pavel Machek [161024 14:24]: > > > Hi! > > > > > > What about something like this? N900 will drain the battery down to > > > system crash, which is quite uncool. > > >

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pali Rohár
On Tuesday 25 October 2016 13:27:57 Pavel Machek wrote: > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > * Pavel Machek [161024 14:24]: > > > Hi! > > > > > > What about something like this? N900 will drain the battery down to > > > system crash, which is quite uncool. > > > > Can't we

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pavel Machek
On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > * Pavel Machek [161024 14:24]: > > Hi! > > > > What about something like this? N900 will drain the battery down to > > system crash, which is quite uncool. > > Can't we make that generic and configurable for the voltage somehow? >

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pavel Machek
On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > * Pavel Machek [161024 14:24]: > > Hi! > > > > What about something like this? N900 will drain the battery down to > > system crash, which is quite uncool. > > Can't we make that generic and configurable for the voltage somehow? > > Also, the

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pali Rohár
On Tuesday 25 October 2016 12:56:04 Pavel Machek wrote: > Take a look at code. Health is not read from hardware unless battery > is calibrated. Then it is bug. EDVF should be accepted also when battery is not calibrated. -- Pali Rohár pali.ro...@gmail.com

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pali Rohár
On Tuesday 25 October 2016 12:56:04 Pavel Machek wrote: > Take a look at code. Health is not read from hardware unless battery > is calibrated. Then it is bug. EDVF should be accepted also when battery is not calibrated. -- Pali Rohár pali.ro...@gmail.com

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pavel Machek
On Tue 2016-10-25 12:53:20, Pali Rohár wrote: > On Tuesday 25 October 2016 12:24:35 Pavel Machek wrote: > > On Mon 2016-10-24 23:48:47, Pali Rohár wrote: > > > On Monday 24 October 2016 23:41:52 Pavel Machek wrote: > > > > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > > > > Also, the

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pavel Machek
On Tue 2016-10-25 12:53:20, Pali Rohár wrote: > On Tuesday 25 October 2016 12:24:35 Pavel Machek wrote: > > On Mon 2016-10-24 23:48:47, Pali Rohár wrote: > > > On Monday 24 October 2016 23:41:52 Pavel Machek wrote: > > > > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > > > > Also, the

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pali Rohár
On Tuesday 25 October 2016 12:24:35 Pavel Machek wrote: > On Mon 2016-10-24 23:48:47, Pali Rohár wrote: > > On Monday 24 October 2016 23:41:52 Pavel Machek wrote: > > > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > > > Also, the shutdown voltage can depend on external devices > > > >

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pali Rohár
On Tuesday 25 October 2016 12:24:35 Pavel Machek wrote: > On Mon 2016-10-24 23:48:47, Pali Rohár wrote: > > On Monday 24 October 2016 23:41:52 Pavel Machek wrote: > > > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > > > Also, the shutdown voltage can depend on external devices > > > >

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pavel Machek
On Mon 2016-10-24 23:48:47, Pali Rohár wrote: > On Monday 24 October 2016 23:41:52 Pavel Machek wrote: > > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > > Also, the shutdown voltage can depend on external devices > > > connected. It could be for example 3.3V depending on eMMC on some > > >

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-25 Thread Pavel Machek
On Mon 2016-10-24 23:48:47, Pali Rohár wrote: > On Monday 24 October 2016 23:41:52 Pavel Machek wrote: > > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > > Also, the shutdown voltage can depend on external devices > > > connected. It could be for example 3.3V depending on eMMC on some > > >

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-24 Thread Pali Rohár
On Monday 24 October 2016 23:41:52 Pavel Machek wrote: > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > Also, the shutdown voltage can depend on external devices > > connected. It could be for example 3.3V depending on eMMC on some > > devices while devices with no eMMC could have it at

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-24 Thread Pali Rohár
On Monday 24 October 2016 23:41:52 Pavel Machek wrote: > On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > > Also, the shutdown voltage can depend on external devices > > connected. It could be for example 3.3V depending on eMMC on some > > devices while devices with no eMMC could have it at

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-24 Thread Pavel Machek
On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > * Pavel Machek [161024 14:24]: > > Hi! > > > > What about something like this? N900 will drain the battery down to > > system crash, which is quite uncool. > > Can't we make that generic and configurable for the voltage somehow?

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-24 Thread Pavel Machek
On Mon 2016-10-24 14:29:33, Tony Lindgren wrote: > * Pavel Machek [161024 14:24]: > > Hi! > > > > What about something like this? N900 will drain the battery down to > > system crash, which is quite uncool. > > Can't we make that generic and configurable for the voltage somehow? I was afraid

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-24 Thread Tony Lindgren
* Pavel Machek [161024 14:24]: > Hi! > > What about something like this? N900 will drain the battery down to > system crash, which is quite uncool. Can't we make that generic and configurable for the voltage somehow? Also, the shutdown voltage can depend on external devices

Re: [RFC] shutdown machine when li-ion battery goes below 3V

2016-10-24 Thread Tony Lindgren
* Pavel Machek [161024 14:24]: > Hi! > > What about something like this? N900 will drain the battery down to > system crash, which is quite uncool. Can't we make that generic and configurable for the voltage somehow? Also, the shutdown voltage can depend on external devices connected. It could

[RFC] shutdown machine when li-ion battery goes below 3V

2016-10-24 Thread Pavel Machek
Hi! What about something like this? N900 will drain the battery down to system crash, which is quite uncool. Pavel diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index

[RFC] shutdown machine when li-ion battery goes below 3V

2016-10-24 Thread Pavel Machek
Hi! What about something like this? N900 will drain the battery down to system crash, which is quite uncool. Pavel diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index