From 2f70b36ad0623c2c2719fe39c71e80acbeb23aae Mon Sep 17 00:00:00 2001 From: Charlie Mooney Date: Mon, 20 Aug 2012 13:46:29 -0700 Subject: Snow: i2c arbitration cleanup (suspend) The ec used to have to check the state of the AP since it would leave the arbitration lines when it suspended. That meant you couldn't trust the arbitration lines without checking the power state. Now the AP pulls the arbitration lines high when it suspends, so it no longer needs to test this when trying to acquire master. BUG=chrome-os-partner:12460 TEST=First, on the EC console run "battery" and "pmu" to make sure they work. Then repeat those steps after putting the AP in suspend by running powerd_suspend, they should still work. Then shutdown the machine entirely and try them again. Note: pmu needs the AP to be on to work, so if it fails here that's okay, just make sure it's not an arbitration error. BRANCH=snow Change-Id: I335156bbce4888949111f74e8a83fe9d184a7a63 Signed-off-by: Charlie Mooney Reviewed-on: https://gerrit.chromium.org/gerrit/30906 Reviewed-by: Jon Kliegman Reviewed-by: Simon Glass --- board/snow/board.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/board/snow/board.c b/board/snow/board.c index 258b534184..4575a17a40 100644 --- a/board/snow/board.c +++ b/board/snow/board.c @@ -208,9 +208,8 @@ int board_i2c_claim(int port) if (port != I2C_PORT_HOST) return EC_SUCCESS; - /* If AP is off or suspended, we have the bus */ - if (chipset_in_state(CHIPSET_STATE_ANY_OFF | - CHIPSET_STATE_SUSPEND)) { + /* If AP is off, we have the bus */ + if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) { gpio_set_level(GPIO_EC_CLAIM, 0); return EC_SUCCESS; } @@ -253,12 +252,9 @@ int board_i2c_claim(int port) void board_i2c_release(int port) { if (port == I2C_PORT_HOST) { - /* Release our claim when AP is on */ - if (!chipset_in_state(CHIPSET_STATE_ANY_OFF | - CHIPSET_STATE_SUSPEND)) { - gpio_set_level(GPIO_EC_CLAIM, 1); - usleep(BUS_SLEW_DELAY_US); - } + /* Release our claim */ + gpio_set_level(GPIO_EC_CLAIM, 1); + usleep(BUS_SLEW_DELAY_US); } } #endif /* CONFIG_ARBITRATE_I2C */ -- cgit v1.2.1