sdio_probe: set voltage use CMD5

reference doc: https://www.infineon.com/dgdl/Infineon-SDIO_platform_support_guide-UserManual-v01_00-EN.pdf?fileId=8ac78c8c8c3de074018c8ba3a9973619

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
This commit is contained in:
zhanghu5 2023-12-15 18:13:56 +08:00 committed by GUIDINGLI
parent 6ee747a1e6
commit 32717ae353

View file

@ -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);