Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283449
b: refs/heads/master
c: c6cd4f2
h: refs/heads/master
i:
  283447: a63202c
v: v3
  • Loading branch information
Pali Rohár authored and Anton Vorontsov committed Nov 25, 2011
1 parent 2b96be3 commit ec0cb62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 270968c0984aeed096da3cfffb0e131f4c416166
refs/heads/master: c6cd4f267d442f2ce279024adb03a69e8608e0f6
21 changes: 14 additions & 7 deletions trunk/drivers/power/bq27x00_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static int bq27x00_battery_read_rsoc(struct bq27x00_device_info *di)
rsoc = bq27x00_read(di, BQ27000_REG_RSOC, true);

if (rsoc < 0)
dev_err(di->dev, "error reading relative State-of-Charge\n");
dev_dbg(di->dev, "error reading relative State-of-Charge\n");

return rsoc;
}
Expand All @@ -170,7 +170,8 @@ static int bq27x00_battery_read_charge(struct bq27x00_device_info *di, u8 reg)

charge = bq27x00_read(di, reg, false);
if (charge < 0) {
dev_err(di->dev, "error reading nominal available capacity\n");
dev_dbg(di->dev, "error reading charge register %02x: %d\n",
reg, charge);
return charge;
}

Expand Down Expand Up @@ -214,7 +215,7 @@ static int bq27x00_battery_read_ilmd(struct bq27x00_device_info *di)
ilmd = bq27x00_read(di, BQ27000_REG_ILMD, true);

if (ilmd < 0) {
dev_err(di->dev, "error reading initial last measured discharge\n");
dev_dbg(di->dev, "error reading initial last measured discharge\n");
return ilmd;
}

Expand All @@ -236,7 +237,7 @@ static int bq27x00_battery_read_energy(struct bq27x00_device_info *di)

ae = bq27x00_read(di, BQ27x00_REG_AE, false);
if (ae < 0) {
dev_err(di->dev, "error reading available energy\n");
dev_dbg(di->dev, "error reading available energy\n");
return ae;
}

Expand Down Expand Up @@ -295,7 +296,8 @@ static int bq27x00_battery_read_time(struct bq27x00_device_info *di, u8 reg)

tval = bq27x00_read(di, reg, false);
if (tval < 0) {
dev_err(di->dev, "error reading register %02x: %d\n", reg, tval);
dev_dbg(di->dev, "error reading time register %02x: %d\n",
reg, tval);
return tval;
}

Expand All @@ -313,6 +315,7 @@ static void bq27x00_update(struct bq27x00_device_info *di)
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");
cache.capacity = -ENODATA;
cache.energy = -ENODATA;
cache.time_to_empty = -ENODATA;
Expand Down Expand Up @@ -369,8 +372,10 @@ static int bq27x00_battery_current(struct bq27x00_device_info *di,
int flags;

curr = bq27x00_read(di, BQ27x00_REG_AI, false);
if (curr < 0)
if (curr < 0) {
dev_err(di->dev, "error reading current\n");
return curr;
}

if (di->chip == BQ27500) {
/* bq27500 returns signed value */
Expand Down Expand Up @@ -460,8 +465,10 @@ static int bq27x00_battery_voltage(struct bq27x00_device_info *di,
int volt;

volt = bq27x00_read(di, BQ27x00_REG_VOLT, false);
if (volt < 0)
if (volt < 0) {
dev_err(di->dev, "error reading voltage\n");
return volt;
}

val->intval = volt * 1000;

Expand Down

0 comments on commit ec0cb62

Please sign in to comment.