Messages in this thread Patch in this message | | | From | "Dr. H. Nikolaus Schaller" <> | Subject | [PATCH] bq270x0: minor improvements for daily operation | Date | Thu, 10 Apr 2014 11:30:07 +0200 |
| |
Improve operation on OpenPhoenux GTA04 board: * treat receiving 0xff from the 1-wire layer as a missing battery * print calibration warning only in debug mode to keep dmesg clean
Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> --- drivers/power/bq27x00_battery.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c index b309713..fa15dc9 100644 --- a/drivers/power/bq27x00_battery.c +++ b/drivers/power/bq27x00_battery.c @@ -415,10 +415,13 @@ static void bq27x00_update(struct bq27x00_device_info *di) bool is_bq27425 = di->chip == BQ27425; cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, !is_bq27500); + if ((cache.flags & 0xff) == 0xff) + /* read error */ + cache.flags = -1; if (cache.flags >= 0) { if (!is_bq27500 && !is_bq27425 && (cache.flags & BQ27000_FLAG_CI)) { - dev_info(di->dev, "battery is not calibrated! ignoring capacity values\n"); + dev_dbg(di->dev, "battery is not calibrated! ignoring capacity values\n"); cache.capacity = -ENODATA; cache.energy = -ENODATA; cache.time_to_empty = -ENODATA; -- 1.9.1
| |