hook_notify() from power state machines is normally called in transitional states, but chipset_in_state() doesn't consider transitional states to be the new state. Eg.
void test_resume(void)
{
ccprintf("Chipset on? %d\n", chipset_in_state(CHIPSET_STATE_ON));
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, test_resume, HOOK_PRIO_DEFAULT);
This will print "Chipset on? 0" on most platforms because we're in POWER_S3S0, not POWER_S0.
It would be nice to have chipset_in_state() reflect the transition-to state so this can work elegantly.
Comment 1 by sha...@chromium.org
, May 10 2016