summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/scarlet/board.c2
-rw-r--r--driver/charger/rt946x.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/board/scarlet/board.c b/board/scarlet/board.c
index 4b9a71c746..277c91ca74 100644
--- a/board/scarlet/board.c
+++ b/board/scarlet/board.c
@@ -187,7 +187,7 @@ int extpower_is_present(void)
if (board_vbus_source_enabled(0))
return 0;
else
- return rt946x_is_vbus_ready();
+ return tcpm_get_vbus_level(0);
}
int pd_snk_is_vbus_provided(int port)
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c
index d7dbcc26ef..5cf558b033 100644
--- a/driver/charger/rt946x.c
+++ b/driver/charger/rt946x.c
@@ -760,6 +760,10 @@ int rt946x_enable_charger_boost(int en)
(RT946X_REG_CHGCTRL2, RT946X_MASK_CHG_EN);
}
+/*
+ * rt946x reports VBUS ready after VBUS is up for ~500ms.
+ * Check if this works for the use case before calling this function.
+ */
int rt946x_is_vbus_ready(void)
{
int val = 0;