samus: Fix ACOK buffer on chipset state transitions

The ACOK buffer from EC to PCH was not being triggered when
the chipset powers up or down, instead it was only triggering
when AC state was changed.

Since we want it to be driven in S5 I added HOOK_CHIPSET_PRE_INIT
to the power sequence in the G3S5 state transition.

BUG=chrome-os-partner:23752
BRANCH=none
TEST=power on samus proto1b with AC inserted and see PCH_ACOK
go high, power off and see it go low again.  Ensure that it is
also changed with AC state transitions.

Change-Id: I4cbe123322e234dc07f10fd1cdff5a8b771a4e02
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176630
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Duncan Laurie
2013-11-13 10:58:26 +08:00
committed by chrome-internal-fetch
parent 9a568cc154
commit bec6b5c93c
2 changed files with 11 additions and 0 deletions

View File

@@ -45,6 +45,14 @@ static void extpower_buffer_to_pch(void)
gpio_set_level(GPIO_PCH_ACOK, extpower_is_present());
}
}
DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, extpower_buffer_to_pch, HOOK_PRIO_DEFAULT);
static void extpower_shutdown(void)
{
/* Drive ACOK buffer to PCH low when shutting down */
gpio_set_level(GPIO_PCH_ACOK, 0);
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, extpower_shutdown, HOOK_PRIO_DEFAULT);
void extpower_interrupt(enum gpio_signal signal)
{

View File

@@ -233,6 +233,9 @@ enum x86_state x86_handle_state(enum x86_state state)
/* Wait 5ms for SUSCLK to stabilize */
msleep(5);
/* Call hook to indicate out of G3 state */
hook_notify(HOOK_CHIPSET_PRE_INIT);
return X86_S5;
case X86_S5S3: