summaryrefslogtreecommitdiff
path: root/common/pmu_tps65090_charger.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/pmu_tps65090_charger.c')
-rw-r--r--common/pmu_tps65090_charger.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c
index 4e474451fc..14475a1c71 100644
--- a/common/pmu_tps65090_charger.c
+++ b/common/pmu_tps65090_charger.c
@@ -16,6 +16,7 @@
#include "system.h"
#include "task.h"
#include "timer.h"
+#include "tsu6721.h"
#include "util.h"
#define CPUTS(outstr) cputs(CC_CHARGER, outstr)
@@ -388,10 +389,26 @@ void pmu_charger_task(void)
enable_charging(0);
disable_sleep(SLEEP_MASK_CHARGING);
+#ifdef CONFIG_TSU6721
+ /*
+ * Somehow TSU6721 comes up slowly. Let's wait for a moment before
+ * accessing it.
+ * TODO(victoryang): Investigate slow init issue.
+ */
+ msleep(500);
+
+ tsu6721_init(); /* Init here until we can do with HOOK_INIT */
+ gpio_enable_interrupt(GPIO_USB_CHG_INT);
+#endif
+
while (1) {
last_waken = get_time();
pmu_clear_irq();
+#ifdef CONFIG_TSU6721
+ board_usb_charge_update();
+#endif
+
/*
* When battery is extremely low, the internal voltage can not
* power on its gas guage IC. Charging loop will enable the