samus: fix won't charge after zinger plugged in during EC reboot

Fix bug recently introduced in 1ab9aac that causes some units to not
charge after an EC reboot with zinger plugged in. The problem is that
we don't log the previous state of ACOK on initialization of the
extpower task. So, the PD MCU gets stuck in charge state NONE when
you unplug zinger because the EC thinks that ACOK transitioned from
low to low.

Fixed in two ways: first, the EC stores the initial state of ACOK when
extpower task first runs. second, changed extpower_board_hacks() to
run the same code when ACOK goes from low to low as it does when it
goes high to low.

BUG=chrome-os-partner:36596
BRANCH=samus
TEST=Found a unit that reliably shows the problem. loaded this fix in
RO and ToT in RW. sysjump RW with AC plugged in, then when you unplug
AC, the PD goes to chgstate NONE and won't ever charge on subsequent
attaches. sysjump RO with AC plugged in, then when you unplug AC, the
PD acts as normal and goes to chgstate NONE and then 5V, and will
allow charging every time AC is subsequently attached.

Change-Id: I4124535b17d43a5711586ff2894df67a3bd49ec6
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/248170
Reviewed-by: Shawn N <shawnn@chromium.org>
1 file changed