Previously, charging was being reporting whenever a charger was present.
While true most of the time, there are cases where that won't be the
case. This patch updates the driver to only report charging if charging
is actually occurring.
Change-Id: Ibc5881fed5d11f89d87d0c7adcd7ac1c2b273688
Signed-off-by: Greg Meiste <w30289@motorola.com>
#include "../w1/w1.h"
#include "../w1/slaves/w1_ds2781.h"
+extern int is_ac_charging(void);
extern int is_ac_charge_complete(void);
struct battery_status {
switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
- if (di->status.charge_source) {
+ if (is_ac_charging()) {
if ((di->status.battery_full) ||
(di->status.percentage >= 100))
val->intval = POWER_SUPPLY_STATUS_FULL;