Commit 3b582f39 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'battery-fixes-for-v3.3-rc2' of git://git.infradead.org/users/cbou/battery-urgent

Just a few small fixes for a bunch of drivers. Nothing noteworthy.

* tag 'battery-fixes-for-v3.3-rc2' of git://git.infradead.org/users/cbou/battery-urgent:
  lp8727_charger: Add terminating entry for i2c_device_id table
  power_supply: Fix modalias for charger-manager
  lp8727_chager: Fix permissions on a header file
  bq27x00_battery: Fix flag register read
  Revert "bq27x00_battery: Fix reporting status value for bq27500 battery"
parents 19be13cf 455a0e2c
......@@ -62,11 +62,10 @@
#define BQ27500_REG_SOC 0x2C
#define BQ27500_REG_DCAP 0x3C /* Design capacity */
#define BQ27500_FLAG_DSG BIT(0) /* Discharging */
#define BQ27500_FLAG_DSC BIT(0)
#define BQ27500_FLAG_SOCF BIT(1) /* State-of-Charge threshold final */
#define BQ27500_FLAG_SOC1 BIT(2) /* State-of-Charge threshold 1 */
#define BQ27500_FLAG_CHG BIT(8) /* Charging */
#define BQ27500_FLAG_FC BIT(9) /* Fully charged */
#define BQ27500_FLAG_FC BIT(9)
#define BQ27000_RS 20 /* Resistor sense */
......@@ -312,7 +311,7 @@ static void bq27x00_update(struct bq27x00_device_info *di)
struct bq27x00_reg_cache cache = {0, };
bool is_bq27500 = di->chip == BQ27500;
cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, is_bq27500);
cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, !is_bq27500);
if (cache.flags >= 0) {
if (!is_bq27500 && (cache.flags & BQ27000_FLAG_CI)) {
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,
if (di->chip == BQ27500) {
if (di->cache.flags & BQ27500_FLAG_FC)
status = POWER_SUPPLY_STATUS_FULL;
else if (di->cache.flags & BQ27500_FLAG_DSG)
else if (di->cache.flags & BQ27500_FLAG_DSC)
status = POWER_SUPPLY_STATUS_DISCHARGING;
else if (di->cache.flags & BQ27500_FLAG_CHG)
status = POWER_SUPPLY_STATUS_CHARGING;
else if (power_supply_am_i_supplied(&di->bat))
status = POWER_SUPPLY_STATUS_NOT_CHARGING;
else
status = POWER_SUPPLY_STATUS_UNKNOWN;
status = POWER_SUPPLY_STATUS_CHARGING;
} else {
if (di->cache.flags & BQ27000_FLAG_FC)
status = POWER_SUPPLY_STATUS_FULL;
......
......@@ -974,10 +974,11 @@ static int __devexit charger_manager_remove(struct platform_device *pdev)
return 0;
}
const struct platform_device_id charger_manager_id[] = {
static const struct platform_device_id charger_manager_id[] = {
{ "charger-manager", 0 },
{ },
};
MODULE_DEVICE_TABLE(platform, charger_manager_id);
static int cm_suspend_prepare(struct device *dev)
{
......@@ -1069,4 +1070,3 @@ module_exit(charger_manager_cleanup);
MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
MODULE_DESCRIPTION("Charger Manager");
MODULE_LICENSE("GPL");
MODULE_ALIAS("charger-manager");
......@@ -464,6 +464,7 @@ static int __devexit lp8727_remove(struct i2c_client *cl)
static const struct i2c_device_id lp8727_ids[] = {
{"lp8727", 0},
{ }
};
static struct i2c_driver lp8727_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment