projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mfd: cros_ec: Delay for 50ms when we see EC_CMD_REBOOT_EC
[cascardo/linux.git]
/
drivers
/
mfd
/
cros_ec_spi.c
diff --git
a/drivers/mfd/cros_ec_spi.c
b/drivers/mfd/cros_ec_spi.c
index
588c700
..
b396705
100644
(file)
--- a/
drivers/mfd/cros_ec_spi.c
+++ b/
drivers/mfd/cros_ec_spi.c
@@
-65,6
+65,12
@@
*/
#define EC_SPI_RECOVERY_TIME_NS (200 * 1000)
*/
#define EC_SPI_RECOVERY_TIME_NS (200 * 1000)
+/*
+ * The EC is unresponsive for a time after a reboot command. Add a
+ * simple delay to make sure that the bus stays locked.
+ */
+#define EC_REBOOT_DELAY_MS 50
+
/**
* struct cros_ec_spi - information about a SPI-connected EC
*
/**
* struct cros_ec_spi - information about a SPI-connected EC
*
@@
-318,6
+324,9
@@
static int cros_ec_cmd_xfer_spi(struct cros_ec_device *ec_dev,
ret = len;
exit:
ret = len;
exit:
+ if (ec_msg->command == EC_CMD_REBOOT_EC)
+ msleep(EC_REBOOT_DELAY_MS);
+
mutex_unlock(&ec_spi->lock);
return ret;
}
mutex_unlock(&ec_spi->lock);
return ret;
}