bq27x00_battery: Fix flag register read
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 14 Jan 2012 20:50:49 +0000 (22:50 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Tue, 3 Apr 2012 21:00:38 +0000 (00:00 +0300)
commit436a34a1e5d055ee42cb59a33ad54ab3591dd380
treef70c8955224be69a5556d7f3f911262fbb928f9c
parentb93e9d3414f73e1ed9cc71465c2a1dde35cfe9c5
bq27x00_battery: Fix flag register read

When reading flags, bq27x00_read() argument is inverted and causes
reads 2 of bytes for bq27200 and 1 byte for bq27500, while their register
sizes are 1 and 2 bytes respectively. This causes bq27500 upper flag
bits always to be returned as 0, causing full charge state to never be
reported correctly, so fix it.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
drivers/power/bq27x00_battery.c