projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1cb82fd
)
bq27000: report missing device better.
author
Marek Belisko
<marek@goldelico.com>
Mon, 30 Jun 2014 19:49:56 +0000
(21:49 +0200)
committer
Sebastian Reichel
<sre@kernel.org>
Fri, 18 Jul 2014 21:40:22 +0000
(23:40 +0200)
One an hdq buss, a missing device reads as 0xff, not -1.
So do a translation to allow detecting of a missing bus.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/bq27x00_battery.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/power/bq27x00_battery.c
b/drivers/power/bq27x00_battery.c
index a0f205b0471dd739105cd691c6099420306ec566..e10763e3a1d56f848f44b27b0b73134a11ec59fc 100644
(file)
--- a/
drivers/power/bq27x00_battery.c
+++ b/
drivers/power/bq27x00_battery.c
@@
-416,6
+416,9
@@
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)) {