diff options
-rw-r--r-- | drivers/mmc/fsl_esdhc.c | 9 | ||||
-rw-r--r-- | include/fsl_esdhc.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 475e6dd..d887d97 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -221,9 +221,12 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) #endif if (wml_value > WML_WR_WML_MAX) wml_value = WML_WR_WML_MAX_VAL; - if ((esdhc_read32(®s->prsstat) & PRSSTAT_WPSPL) == 0) { - printf("\nThe SD card is locked. Can not write to a locked card.\n\n"); - return TIMEOUT; + + if (cfg->wp_enable) { + if ((esdhc_read32(®s->prsstat) & PRSSTAT_WPSPL) == 0) { + printf("\nThe SD card is locked. Can not write to a locked card.\n\n"); + return TIMEOUT; + } } esdhc_clrsetbits32(®s->wml, WML_WR_WML_MASK, diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h index 2ba8565..539064c 100644 --- a/include/fsl_esdhc.h +++ b/include/fsl_esdhc.h @@ -181,6 +181,7 @@ struct fsl_esdhc_cfg { #endif u32 sdhc_clk; u8 max_bus_width; + u8 wp_enable; struct mmc_config cfg; }; |