|
|
@@ -725,3 +725,40 @@ int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags)
|
|
|
return 0;
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(sdio_set_host_pm_flags);
|
|
|
+
|
|
|
+/**
|
|
|
+ * sdio_retune_crc_disable - temporarily disable retuning on CRC errors
|
|
|
+ * @func: SDIO function attached to host
|
|
|
+ *
|
|
|
+ * If the SDIO card is known to be in a state where it might produce
|
|
|
+ * CRC errors on the bus in response to commands (like if we know it is
|
|
|
+ * transitioning between power states), an SDIO function driver can
|
|
|
+ * call this function to temporarily disable the SD/MMC core behavior of
|
|
|
+ * triggering an automatic retuning.
|
|
|
+ *
|
|
|
+ * This function should be called while the host is claimed and the host
|
|
|
+ * should remain claimed until sdio_retune_crc_enable() is called.
|
|
|
+ * Specifically, the expected sequence of calls is:
|
|
|
+ * - sdio_claim_host()
|
|
|
+ * - sdio_retune_crc_disable()
|
|
|
+ * - some number of calls like sdio_writeb() and sdio_readb()
|
|
|
+ * - sdio_retune_crc_enable()
|
|
|
+ * - sdio_release_host()
|
|
|
+ */
|
|
|
+void sdio_retune_crc_disable(struct sdio_func *func)
|
|
|
+{
|
|
|
+ func->card->host->retune_crc_disable = true;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(sdio_retune_crc_disable);
|
|
|
+
|
|
|
+/**
|
|
|
+ * sdio_retune_crc_enable - re-enable retuning on CRC errors
|
|
|
+ * @func: SDIO function attached to host
|
|
|
+ *
|
|
|
+ * This is the compement to sdio_retune_crc_disable().
|
|
|
+ */
|
|
|
+void sdio_retune_crc_enable(struct sdio_func *func)
|
|
|
+{
|
|
|
+ func->card->host->retune_crc_disable = false;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(sdio_retune_crc_enable);
|