aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/bq27x00_battery.c15
-rw-r--r--drivers/power/charger-manager.c4
-rw-r--r--drivers/power/lp8727_charger.c1
3 files changed, 8 insertions, 12 deletions
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
index 98bf5676318d..1ed6ea0bad6e 100644
--- a/drivers/power/bq27x00_battery.c
+++ b/drivers/power/bq27x00_battery.c
@@ -62,11 +62,10 @@
62 62
63#define BQ27500_REG_SOC 0x2C 63#define BQ27500_REG_SOC 0x2C
64#define BQ27500_REG_DCAP 0x3C /* Design capacity */ 64#define BQ27500_REG_DCAP 0x3C /* Design capacity */
65#define BQ27500_FLAG_DSG BIT(0) /* Discharging */ 65#define BQ27500_FLAG_DSC BIT(0)
66#define BQ27500_FLAG_SOCF BIT(1) /* State-of-Charge threshold final */ 66#define BQ27500_FLAG_SOCF BIT(1) /* State-of-Charge threshold final */
67#define BQ27500_FLAG_SOC1 BIT(2) /* State-of-Charge threshold 1 */ 67#define BQ27500_FLAG_SOC1 BIT(2) /* State-of-Charge threshold 1 */
68#define BQ27500_FLAG_CHG BIT(8) /* Charging */ 68#define BQ27500_FLAG_FC BIT(9)
69#define BQ27500_FLAG_FC BIT(9) /* Fully charged */
70 69
71#define BQ27000_RS 20 /* Resistor sense */ 70#define BQ27000_RS 20 /* Resistor sense */
72 71
@@ -312,7 +311,7 @@ static void bq27x00_update(struct bq27x00_device_info *di)
312 struct bq27x00_reg_cache cache = {0, }; 311 struct bq27x00_reg_cache cache = {0, };
313 bool is_bq27500 = di->chip == BQ27500; 312 bool is_bq27500 = di->chip == BQ27500;
314 313
315 cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, is_bq27500); 314 cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, !is_bq27500);
316 if (cache.flags >= 0) { 315 if (cache.flags >= 0) {
317 if (!is_bq27500 && (cache.flags & BQ27000_FLAG_CI)) { 316 if (!is_bq27500 && (cache.flags & BQ27000_FLAG_CI)) {
318 dev_info(di->dev, "battery is not calibrated! ignoring capacity values\n"); 317 dev_info(di->dev, "battery is not calibrated! ignoring capacity values\n");
@@ -401,14 +400,10 @@ static int bq27x00_battery_status(struct bq27x00_device_info *di,
401 if (di->chip == BQ27500) { 400 if (di->chip == BQ27500) {
402 if (di->cache.flags & BQ27500_FLAG_FC) 401 if (di->cache.flags & BQ27500_FLAG_FC)
403 status = POWER_SUPPLY_STATUS_FULL; 402 status = POWER_SUPPLY_STATUS_FULL;
404 else if (di->cache.flags & BQ27500_FLAG_DSG) 403 else if (di->cache.flags & BQ27500_FLAG_DSC)
405 status = POWER_SUPPLY_STATUS_DISCHARGING; 404 status = POWER_SUPPLY_STATUS_DISCHARGING;
406 else if (di->cache.flags & BQ27500_FLAG_CHG)
407 status = POWER_SUPPLY_STATUS_CHARGING;
408 else if (power_supply_am_i_supplied(&di->bat))
409 status = POWER_SUPPLY_STATUS_NOT_CHARGING;
410 else 405 else
411 status = POWER_SUPPLY_STATUS_UNKNOWN; 406 status = POWER_SUPPLY_STATUS_CHARGING;
412 } else { 407 } else {
413 if (di->cache.flags & BQ27000_FLAG_FC) 408 if (di->cache.flags & BQ27000_FLAG_FC)
414 status = POWER_SUPPLY_STATUS_FULL; 409 status = POWER_SUPPLY_STATUS_FULL;
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
index 0378d019efae..88fd9710bda2 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -974,10 +974,11 @@ static int __devexit charger_manager_remove(struct platform_device *pdev)
974 return 0; 974 return 0;
975} 975}
976 976
977const struct platform_device_id charger_manager_id[] = { 977static const struct platform_device_id charger_manager_id[] = {
978 { "charger-manager", 0 }, 978 { "charger-manager", 0 },
979 { }, 979 { },
980}; 980};
981MODULE_DEVICE_TABLE(platform, charger_manager_id);
981 982
982static int cm_suspend_prepare(struct device *dev) 983static int cm_suspend_prepare(struct device *dev)
983{ 984{
@@ -1069,4 +1070,3 @@ module_exit(charger_manager_cleanup);
1069MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>"); 1070MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
1070MODULE_DESCRIPTION("Charger Manager"); 1071MODULE_DESCRIPTION("Charger Manager");
1071MODULE_LICENSE("GPL"); 1072MODULE_LICENSE("GPL");
1072MODULE_ALIAS("charger-manager");
diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c
index b15b575c070c..c53dd1292f81 100644
--- a/drivers/power/lp8727_charger.c
+++ b/drivers/power/lp8727_charger.c
@@ -464,6 +464,7 @@ static int __devexit lp8727_remove(struct i2c_client *cl)
464 464
465static const struct i2c_device_id lp8727_ids[] = { 465static const struct i2c_device_id lp8727_ids[] = {
466 {"lp8727", 0}, 466 {"lp8727", 0},
467 { }
467}; 468};
468 469
469static struct i2c_driver lp8727_driver = { 470static struct i2c_driver lp8727_driver = {