diff --git a/drivers/mmcsd/sdio.c b/drivers/mmcsd/sdio.c index e1c284d004..0bd1e0cbea 100644 --- a/drivers/mmcsd/sdio.c +++ b/drivers/mmcsd/sdio.c @@ -380,6 +380,7 @@ int sdio_set_wide_bus(FAR struct sdio_dev_s *dev) int sdio_probe(FAR struct sdio_dev_s *dev) { int ret; + int bit; uint32_t data = 0; nxmutex_init(&dev->mutex); @@ -412,6 +413,26 @@ int sdio_probe(FAR struct sdio_dev_s *dev) goto err; } + /* Get the maximun and minimum values for VDD */ + + bit = ffs(data); + if (bit) + { + bit -= 1; + data &= 3 << bit; + } + else + { + ret = -EINVAL; + goto err; + } + + ret = sdio_sendcmdpoll(dev, SDIO_CMD5, data); + if (ret != OK) + { + goto err; + } + /* Device is in Card Identification Mode, request device RCA */ ret = sdio_sendcmdpoll(dev, SD_CMD3, 0);