diff options
-rw-r--r-- | drivers/mfd/cros_ec_spi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c index 588c700af39c..b396705203fc 100644 --- a/drivers/mfd/cros_ec_spi.c +++ b/drivers/mfd/cros_ec_spi.c | |||
@@ -65,6 +65,12 @@ | |||
65 | */ | 65 | */ |
66 | #define EC_SPI_RECOVERY_TIME_NS (200 * 1000) | 66 | #define EC_SPI_RECOVERY_TIME_NS (200 * 1000) |
67 | 67 | ||
68 | /* | ||
69 | * The EC is unresponsive for a time after a reboot command. Add a | ||
70 | * simple delay to make sure that the bus stays locked. | ||
71 | */ | ||
72 | #define EC_REBOOT_DELAY_MS 50 | ||
73 | |||
68 | /** | 74 | /** |
69 | * struct cros_ec_spi - information about a SPI-connected EC | 75 | * struct cros_ec_spi - information about a SPI-connected EC |
70 | * | 76 | * |
@@ -318,6 +324,9 @@ static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev, | |||
318 | 324 | ||
319 | ret = len; | 325 | ret = len; |
320 | exit: | 326 | exit: |
327 | if (ec_msg->command == EC_CMD_REBOOT_EC) | ||
328 | msleep(EC_REBOOT_DELAY_MS); | ||
329 | |||
321 | mutex_unlock(&ec_spi->lock); | 330 | mutex_unlock(&ec_spi->lock); |
322 | return ret; | 331 | return ret; |
323 | } | 332 | } |