power: bcmpmu-fg: Show correct battery status at bootup with charger

When booting up with attached charger and, of different reasons,
the charger is disabled the battery status did not update to the
correct status.

The status was still in unknown state which resulted in that battery
capacity was showing 100% until charger was disconnected.

Change-Id: I71092d388d939420563a2fbc7ea8b37370d000fb
diff --git a/drivers/power/bcmpmu-fg.c b/drivers/power/bcmpmu-fg.c
index 9bca85d..42ed4c9 100644
--- a/drivers/power/bcmpmu-fg.c
+++ b/drivers/power/bcmpmu-fg.c
@@ -3034,18 +3034,19 @@
 					chrgr_type < PMU_CHRGR_TYPE_MAX) {
 				fg->chrgr_type = chrgr_type;
 				fg->flags.chrgr_connected = true;
-				if (bcmpmu_is_usb_host_enabled(fg->bcmpmu)) {
-					fg->flags.prev_batt_status =
-						fg->flags.batt_status;
-					fg->flags.batt_status =
-						POWER_SUPPLY_STATUS_CHARGING;
-				}
-			} else {
-				fg->flags.prev_batt_status =
-							fg->flags.batt_status;
-				fg->flags.batt_status =
-						POWER_SUPPLY_STATUS_DISCHARGING;
+				if (bcmpmu_is_usb_host_enabled(fg->bcmpmu))
+					fg->flags.charging_enabled = true;
 			}
+
+			fg->flags.prev_batt_status = fg->flags.batt_status;
+
+			if (fg->flags.chrgr_connected &&
+				fg->flags.charging_enabled)
+				fg->flags.batt_status =
+					POWER_SUPPLY_STATUS_CHARGING;
+			else
+				fg->flags.batt_status =
+					POWER_SUPPLY_STATUS_DISCHARGING;
 		}
 		if (!fg->init_notifier) {
 			ret = bcmpmu_fg_register_notifiers(fg);