If the returned value is outside of the range of the array, we could get
potential errors (#PF, #GF, etc), which are nasty to track down. Instead,
report a bug, and report the value as unknown in those cases.
Thanks to Saleem Abdulrasool
iMX23: power supply protection mechanism must be implemented
in order to properly protect the SoC from damage or getting
into a locked up state. Several chip errata exists which (some are
documented and some are not yet documented at the time of this writing).
Signed-off-by: Robert Lee <robert.lee@freescale.com>
No all regiser use _SCT. stmp3xxx_setl may write to wrong address.
please use __raw_write (value, REG_XXX_SET) to write date to SCT
register. Only REG_XXX_SCT is defined when it exist at hardware.
Signed-off-by: Frank.Li <Frank.Li@freescale.com>
LRADC7 for measurements other than battery voltage will cause the wrong
value to be copied over to the power supply.
Connecting 5V and then disconnecting to run from battery will
be unstable.
This fix change LRADC7 to LRADC1 to measure die temparature
Signed-off-by: Frank.Li <Frank.Li@freescale.com>
Fixes problems with incorrect DCDC settings. Adds support for 4p2 power
supply necessary for meeting supply requirement during 5V connections.
Clean up stmp3xxxx_setl and stmp3xxx_clearl because some register have
not _SCT register
Signed-off-by: Robert Lee <robert.lee@freescale.com>
Signed-off-by: Frank.Li <Frank.Li@freescale.com>
The battery charger driver contains 37xx specific battery charger
driver code that is incompatible with 378x/iMX23 and needs removal
Signed-off-by: Robert Lee <robert.lee@freescale.com>
* git://git.infradead.org/users/cbou/battery-2.6.31:
Add ds2782 battery gas gauge driver
olpc_battery: Ensure that the TRICKLE bit is checked
olpc_battery: Fix up eeprom read function
direct access of driver_data is going away.
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
There are times when the battery is present but trickle charging,
and the EC sets only the TRICKLE bit. So we must check for the bit
when we're checking the charging/present status.
Signed-off-by: Andres Salomon <dilinger@collabora.co.uk>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
The eeprom read function was placing values into the wrong place in
'buf'; we were starting from buf[off], rather than buf[0].
Also, the for loop that we were using was much uglier than it needed to
be. This cleans it up a bit.
Signed-off-by: Andres Salomon <dilinger@collabora.co.uk>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
There are cases when charging monitor and the event handler try to
change the charger state simultaneously. For instance, a charger is
connected to the system, there's the detection event and the event
handler tries to enable charging. It is possible that the periodic
charging monitor runs at the same time and it still thinks there's
no external charger. So it tries to disable the charging. As the
result, even if the conditions necessary to charge the battery hold,
there will be no actual charging.
The patch changes the event handler so that instead of enabling/
disabling the charger immediately it would rather make the monitor
run. The monitor code then decides what should be the charger state.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
The MAX17040 is a I2C interfaced Fuel Gauge systems for lithium-ion
batteries This patch adds support the MAX17040 Fuel Gauge
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
This adds support for ds2760's sleep mode feature. With this feature
enabled, the chip enters a deep sleep mode and disconnects from the
battery when the w1 line is held down for more than 2 seconds.
This new behaviour can be switched on and off using a new module
parameter.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Szabolcs Gyurko <szabolcs.gyurko@tlt.hu>
Acked-by: Matt Reimer <mreimer@vpop.net>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>