summaryrefslogtreecommitdiff
path: root/drivers/power/bq20z75.c
AgeCommit message (Collapse)Author
2012-02-03arm: tegra: ventana: probing for bq20z75 chipRamalingam C
In the probe function of the bq20z75 driver, check for the presence of the bq20z75. If there is no response from device, terminate the driver initialization. Bug 932030 Change-Id: I6608eaea6b6b37b18d3f77f40d58c1f8e9b05b3c Signed-off-by: Ramalingam C <ramalingamc@nvidia.com> Reviewed-on: http://git-master/r/78750 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Rhyland Klein <rklein@nvidia.com>
2011-12-09power: bq20z75: copy pdata to the driver contextVarun Wadekar
Generally boards define platform data structs as __initdata. Due to this, it is not available in the driver as a pointer. The driver needs to copy the platform data to its context in order to use it after _probe exits. Change-Id: If6a4944f0f3cbb835e56d915cf5eee34d0de374d Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2011-11-30bq20z75: check for battery status update on resumePritesh Raithatha
Bug 877456 Change-Id: Ie276daa13feb6702791fab36f7fa88c3811ed3bb Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-on: http://git-master/r/64030 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Rebase-Id: R2a2430d7ae7c1a4262682bd4e537b519d055f98a
2011-07-08bq20z75: Enable detection after registeringRhyland Klein
Need to enable detection, which is also blocking the unit conversion logic after registering the power_supply. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-07-08bq20z75: Add support for external notificationRhyland Klein
Adding support for external power change notification. One problem found is that there is a lag time before the sensor will return a new status. To ensure that we only fire off the power_supply_changed event when the status returned from the sensor is actually different, we delay sending the the notification, and instead poll on it looking for a change. The amount of time to poll is configurable via platform data. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-03-16bq20z75: Fix time and temp unitsBenson Leung
Corrected temperature and time to empty/full conversions. Temperature is in 0.1°C, time is in seconds. Corrected units in comment. "Convert to µWh." Signed-off-by: Benson Leung <bleung@chromium.org> Acked-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-03-16bq20z75: Fix issues with present and suspendRhyland Klein
There are a few issues found around the battery not being present. If the battery isn't present, then a few undesirable things happen. The first was excessive reporting of failed properties. This was fixed by instead returning ENODATA for all properties other than PRESENT if the battery isn't present. That way the callers can identify the difference between a failure and the battery not being there. The next issue was in the suspend logic. It was found that if the battery wasn't present, then it would return a failure, preventing the system from going into suspend. If there is no battery present, the io is expected to fail, so in that case, we shouldn't return the failure and just acknowledge that it was expected. I also found that when a gpio was used, i didn't maintain the internal is_present state properly. I added a set of that to fix that. Lastly, the code to see io's fail and figure out that the battery isn't present when not using a gpio had a problem. In that code, it looked for the read to fail and if it did, then handled it. The problem is that in function to get the property, it first writes a value and that write can fail, causing the code to never reach the logic after the read. Fix is to move the logic till after the write. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-03-01bq20z75: Add MODULE_DEVICE_TABLEAxel Lin
The device table is required to load modules based on modaliases. After adding the MODULE_DEVICE_TABLE, below entry will be added to modules.alias: alias i2c:bq20z75 bq20z75 Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-03-01bq20z75: Add i2c retry mechanismRhyland Klein
With the support of platform data, now adding support for option i2c retries on read/write failures. Ths is specified through the optional platform data. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-03-01bq20z75: Add optional battery detect gpioRhyland Klein
Adding support for an optional gpio for battery detection. This is passed in through the i2c platform data. It also accepts another field, battery_detect_present to signify the gpio state which means the battery is present, either 0 (low) or 1 (high). Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2011-01-31bq20z75: Add support for charge propertiesRhyland Klein
Adding support for charge properties for gas gauge. Also ensuring that battery mode is correct now for energy as well as charge properties by setting it on the fly. I also added 2 functions to power_supply.h to help identify the units for specific properties more easily by power supplies. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2010-09-28bq20z75: Add support for more power supply propertiesRhyland Klein
This patch adds properties to support devicekit power. Also, create IO wrapper functions and fix some issues found while testing, including unit conversions to match the power_supply types. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2010-09-06power_supply: Add driver for TI BQ20Z75 gas gauge ICRhyland Klein
This driver depends on I2C and uses SMBUS for communication with the host. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>