mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
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:
parent
6ee747a1e6
commit
32717ae353
1 changed files with 21 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue