Commit Graph

133 Commits

Author SHA1 Message Date
Saleem Abdulrasool
4fcc3a542f add efikasb_batt_write 2010-11-29 18:51:51 -06:00
Saleem Abdulrasool
7379fcc430 report energy and charge full design 2010-11-29 18:50:33 -06:00
Saleem Abdulrasool
3124207d02 report energy and charge full 2010-11-29 18:50:30 -06:00
Saleem Abdulrasool
67090153be report energy and charge now 2010-11-29 18:50:27 -06:00
Saleem Abdulrasool
6b0cc6cd94 remove unnecessary goto usage in efikasb_batt_read 2010-11-29 18:50:25 -06:00
Saleem Abdulrasool
ce2529c70a fix whitespace 2010-11-29 18:50:21 -06:00
Matt Sealey
cfc625c026 Revert "fix whitespace"
This reverts commit a8661dae7ff094ab09afba2549c6b68e15289e2c.
2010-11-29 18:20:02 -06:00
Matt Sealey
144a63e3ab Revert "remove unnecessary goto usage in efikasb_batt_read"
This reverts commit 2cdda058111fcca048027732145bbe8418edc3b8.
2010-11-29 18:19:58 -06:00
Matt Sealey
a463526930 Revert "add efikasb_batt_write"
This reverts commit 047de77e2ae0e3b382b078c264582e1e913613e0.
2010-11-29 18:19:54 -06:00
Matt Sealey
a2da6cd929 Revert "report energy and charge now"
This reverts commit fb2fa90c1143b300cf4f9ccb7a21682f413e5e91.
2010-11-29 18:19:50 -06:00
Matt Sealey
06891b63fd Revert "report energy and charge full"
This reverts commit dfb514dfb05372dc7e0a6db598e3676e6ec8fb1e.
2010-11-29 18:19:24 -06:00
Matt Sealey
f29909405d Revert "report energy and charge full design"
This reverts commit 59a6e469095668420c83cbe137dd40e0b8aa8f70.
2010-11-29 18:18:11 -06:00
Matt Sealey
9f7220ed9a prevent kernel oops on unknown devices
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
2010-11-13 10:15:09 -06:00
Saleem Abdulrasool
bd5e72ac57 report energy and charge full design 2010-11-13 09:57:46 -06:00
Saleem Abdulrasool
46b11b0748 report energy and charge full 2010-11-13 09:57:44 -06:00
Saleem Abdulrasool
078accb95f report energy and charge now 2010-11-13 09:57:41 -06:00
Saleem Abdulrasool
56cef15721 add efikasb_batt_write 2010-11-13 09:57:38 -06:00
Saleem Abdulrasool
3445c14876 remove unnecessary goto usage in efikasb_batt_read 2010-11-13 09:57:35 -06:00
Saleem Abdulrasool
9c47932e07 fix whitespace 2010-11-13 09:57:32 -06:00
Matt Sealey
df7d6278ca Efika MX Smartbook: Fix battery naming 2010-09-07 10:53:56 -05:00
Matt Sealey
b26a7674e0 EfikaMX Smartbook Kernel support, initial 2010-09-03 14:36:46 -05:00
Frank Li
6f7ca2ca84 ENGR00122965 Improve USB100 feature due to bootloader change.
Smalle change due to the bootloader change and fix Mx23 fail
caused by clock module change.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:50:25 -05:00
Zhou Jingyu
4a56bf5a1b ENGR00122023 MX23 Fix build error for power supply driver
Fix build error debug options selected for power driver

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:49:54 -05:00
Zhou Jingyu
16810cbb16 ENGR00122783 Enable pmu brownout features for imx23 &imx28
Enable pmu brownout features for imx23 &imx28

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:49:30 -05:00
Frank Li
0c88a7e681 ENGR00122435 iMX23 Support USB current draw and fix power switch issue
Support USB current draw on mx23 and fix power switch issue.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:49:07 -05:00
Zhou Jingyu
7ca2494030 ENGR00122126 mxs battery driver: change detection method
change detection method &set some print info to debug level

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:48:55 -05:00
Frank Li
1f1c8202e8 ENGR00121497-2 MX28 USB 100mA current draw
Add USB 100mA limitation feature for mx28 to mach usb 2.0 current requirment

Signed-off-by: Frank Li <Frank.li@freescale.com>
2010-08-10 11:48:51 -05:00
Zhou Jingyu
0d1720e255 ENGR00122040 mxs battery driver: fix lradc conflict
use configurable lraadc channel for tempreture
increase conditioning current
fix build warnings

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:48:47 -05:00
Frank Li
c85831719f ENGR00121885 Fix power source switch issue on Mx23 and Mx28
Add protection when set ENABLE_DCDC bit.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2010-08-10 11:48:39 -05:00
Zhou Jingyu
cc638881c6 ENGR00121496: mx23 battery driver restructure
mx23 battery driver restructure

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:48:15 -05:00
Zhou Jingyu
43939ee148 ENGR00117740-2 mxs battery driver, porting
mxs battery driver, porting

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:48:01 -05:00
Zhou Jingyu
59e9102f44 ENGR00117740-1 mxs battery driver, copy &rename
mxs battery driver, copy &rename

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:48:00 -05:00
Robert Lee
45741ef92a ENGR00116049-1 [imx23] Addition of FIQ system for chip errata/bo's
[imx23] Addition of FIQ system for chip errata and bo's

Signed-off-by: Robert Lee <robert.lee@freescale.com>
2010-08-10 11:46:35 -05:00
Zhou Jingyu
b7d7676a59 ENGR00118946 imx23: enable wake up from USB 5V
enable wake up from USB 5V

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:46:07 -05:00
Robert Lee
aad98b7602 ENGR00118995 iMX23: power supply protection mechanism must be implemented.
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>
2010-08-10 11:46:02 -05:00
Frank.Li
2e21083d70 ENGR00118544 iMX23 Clear dangerous macro stmp3xxx_setl(clearl)
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>
2010-08-10 11:45:57 -05:00
Zhou Jingyu
b795219b9c ENGR00118525 imx233 fix pswitch irq issue
use shared mode for pswitch and 5v dectection

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2010-08-10 11:45:50 -05:00
Frank.Li
93b125fa24 ENGR00118444 iMX23 Change die temperature measure change to LRADC1
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>
2010-08-10 11:45:34 -05:00
Frank.Li
2beeed711a ENGR00117241 modification to iMX23 power source driver for stability
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>
2010-08-10 11:45:34 -05:00
Robert Lee
1646bc39e4 ENGR00117791 stmp37xx specific battery charger code causing problems
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>
2010-08-10 11:45:07 -05:00
Rob Herring
be0524d38f ENGR00117389 Port 5.0.0 release to 2.6.31
This is i.MX BSP 5.0.0 release ported to 2.6.31

Signed-off-by: Rob Herring <r.herring@freescale.com>
Signed-off-by: Alan Tull <r80115@freescale.com>
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2010-08-10 11:44:41 -05:00
Linus Torvalds
fbdbf83899 Merge git://git.infradead.org/users/cbou/battery-2.6.31
* 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
2009-07-30 16:45:53 -07:00
Alexander Beregalov
38c7dc3730 wm97xx_batery: replace driver_data with dev_get_drvdata()
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>
2009-07-12 13:02:10 -07:00
Ryan Mallon
bfdb46ce84 Add ds2782 battery gas gauge driver
This patch adds a driver for ds2782 battery devices.

Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2009-07-01 02:36:58 +04:00
Andres Salomon
8f7e57985f olpc_battery: Ensure that the TRICKLE bit is checked
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>
2009-07-01 02:36:58 +04:00
Andres Salomon
04a820ead0 olpc_battery: Fix up eeprom read function
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>
2009-07-01 02:36:38 +04:00
Mike Rapoport
a35d01a5d2 da9030_battery: Fix race between event handler and monitor
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>
2009-06-09 01:12:38 +04:00
Minkyu Kang
c6f4a42de6 Add MAX17040 Fuel Gauge driver
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>
2009-06-09 00:53:21 +04:00
Daniel Mack
cef437e3a9 w1: ds2760_battery: add support for sleep mode feature
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>
2009-06-08 23:25:17 +04:00
Daniel Mack
ae9fb6e814 ds2760_battery: cleanups in ds2760_battery_probe()
Removed struct ds2760_platform_data which wasn't defined anywhere.
Indentation cleanups.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Szabolcs Gyurko <szabolcs.gyurko@tlt.hu>
Acked-by: Matt Reimer <mreimer@vpop.net>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2009-06-08 23:24:53 +04:00