summaryrefslogtreecommitdiff
path: root/board/puff/board.c
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2020-01-20 13:18:14 +1100
committerCommit Bot <commit-bot@chromium.org>2020-01-21 00:59:51 +0000
commit1afa04df3f399d5885ada9a9fbaec0f208f47bad (patch)
treecb42df5e280bc7a4a781bd9675c2d983fec02578 /board/puff/board.c
parentadd663e8d4bd0d756e8bbdb40b819abdfb27ea8a (diff)
downloadchrome-ec-1afa04df3f399d5885ada9a9fbaec0f208f47bad.tar.gz
puff: always claim AC power is online
powerd logs lots of warnings if it can't see any online power supplies, which could be the case when the EC comes up without the barrel jack then boots with it- the host flag never gets updated. Since we don't have a battery on puff and we don't allow switching power sources while the system is on (we gate the inactive one), just always say there is external power (because there is). BUG=b:147977614 TEST=/sys/class/power_supply/AC/online is now always 1, even when running on USB-C. BRANCH=None Change-Id: I87345b8a3f07a88f2dccda4b7226bf0b8ee07e2f Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2009529 Reviewed-by: Sam McNally <sammc@chromium.org>
Diffstat (limited to 'board/puff/board.c')
-rw-r--r--board/puff/board.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/board/puff/board.c b/board/puff/board.c
index 80ebedf7c2..4a6bb667b3 100644
--- a/board/puff/board.c
+++ b/board/puff/board.c
@@ -394,7 +394,13 @@ const unsigned int ina3221_count = ARRAY_SIZE(ina3221);
static void board_init(void)
{
+ uint8_t *memmap_batt_flags;
+
update_port_limits();
+
+ /* Always claim AC is online, because we don't have a battery. */
+ memmap_batt_flags = host_get_memmap(EC_MEMMAP_BATT_FLAG);
+ *memmap_batt_flags |= EC_BATT_FLAG_AC_PRESENT;
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
@@ -510,3 +516,8 @@ void board_overcurrent_event(int port, int is_overcurrented)
return;
usbc_overcurrent = is_overcurrented;
}
+
+int extpower_is_present(void)
+{
+ return adp_connected;
+}