diff options
-rw-r--r-- | common/peripheral_charger.c | 8 | ||||
-rw-r--r-- | driver/nfc/ctn730.c | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/common/peripheral_charger.c b/common/peripheral_charger.c index e907257452..326b0bb495 100644 --- a/common/peripheral_charger.c +++ b/common/peripheral_charger.c @@ -296,7 +296,7 @@ static int pchg_run(struct pchg *ctx) } if (previous_state != ctx->state) - CPRINTS("->%s", _text_state(ctx->state)); + CPRINTS("->STATE_%s", _text_state(ctx->state)); ctx->event = PCHG_EVENT_NONE; @@ -358,12 +358,6 @@ void pchg_task(void *u) int p; int rv; - /* - * Without delay, after servo flash, ctn730 in RW always fails to write - * ENABLE_CMD (b:176824601). - */ - msleep(50); - /* In case we arrive here after power-on (for late sysjump) */ if (chipset_in_state(CHIPSET_STATE_ON)) pchg_startup(); diff --git a/driver/nfc/ctn730.c b/driver/nfc/ctn730.c index 5528b8c5ec..c8be10d297 100644 --- a/driver/nfc/ctn730.c +++ b/driver/nfc/ctn730.c @@ -361,12 +361,18 @@ static int _process_payload_event(struct pchg *ctx, struct ctn730_msg *res) switch (res->instruction) { case WLC_HOST_CTRL_RESET: - if (buf[0] == WLC_HOST_CTRL_RESET_EVT_NORMAL_MODE) + if (buf[0] == WLC_HOST_CTRL_RESET_EVT_NORMAL_MODE) { ctx->event = PCHG_EVENT_INITIALIZED; - else if (buf[0] == WLC_HOST_CTRL_RESET_EVT_DOWNLOAD_MODE) + /* + * ctn730 isn't immediately ready for i2c write after + * normal mode initialization (b:178096436). + */ + msleep(5); + } else if (buf[0] == WLC_HOST_CTRL_RESET_EVT_DOWNLOAD_MODE) { ctx->event = PCHG_EVENT_NONE; - else + } else { return EC_ERROR_INVAL; + } break; case WLC_HOST_CTRL_GENERIC_ERROR: break; |