mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
arch/arm/src/lpc54xx: Add support for card detect and write protect to SDMMC driver. configs/lpcxpresso-lpc54628: Add logic to bring up SDMMC.
This commit is contained in:
@@ -31,12 +31,17 @@ config MMCSD_MMCSUPPORT
|
||||
---help---
|
||||
Enable support for MMC cards
|
||||
|
||||
config MMCSD_HAVECARDDETECT
|
||||
bool "MMC/SD card detection"
|
||||
config MMCSD_HAVE_CARDDETECT
|
||||
bool "MMC/SD card detect pin"
|
||||
default y
|
||||
---help---
|
||||
SDIO driver card detection is
|
||||
100% accurate
|
||||
SDIO driver card present detection is supported.
|
||||
|
||||
config MMCSD_HAVE_WRITEPROTECT
|
||||
bool "MMC/SD write protect pin"
|
||||
default y
|
||||
---help---
|
||||
SDIO driver write protection detection is supported.
|
||||
|
||||
config MMCSD_SPI
|
||||
bool "MMC/SD SPI transfer support"
|
||||
|
||||
@@ -3011,7 +3011,7 @@ static int mmcsd_probe(FAR struct mmcsd_state_s *priv)
|
||||
* else
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_MMCSD_HAVECARDDETECT
|
||||
#ifdef CONFIG_MMCSD_HAVE_CARDDETECT
|
||||
if (priv->probed && SDIO_PRESENT(priv->dev))
|
||||
{
|
||||
return OK;
|
||||
@@ -3038,7 +3038,7 @@ static int mmcsd_probe(FAR struct mmcsd_state_s *priv)
|
||||
if (ret != OK)
|
||||
{
|
||||
ferr("ERROR: Failed to initialize card: %d\n", ret);
|
||||
#ifdef CONFIG_MMCSD_HAVECARDDETECT
|
||||
#ifdef CONFIG_MMCSD_HAVE_CARDDETECT
|
||||
SDIO_CALLBACKENABLE(priv->dev, SDIOMEDIA_INSERTED);
|
||||
#endif
|
||||
}
|
||||
@@ -3075,7 +3075,7 @@ static int mmcsd_probe(FAR struct mmcsd_state_s *priv)
|
||||
finfo("Capacity: %lu Kbytes\n", (unsigned long)(priv->capacity / 1024));
|
||||
priv->mediachanged = true;
|
||||
|
||||
#ifdef CONFIG_MMCSD_HAVECARDDETECT
|
||||
#ifdef CONFIG_MMCSD_HAVE_CARDDETECT
|
||||
/* Set up to receive asynchronous, media removal events */
|
||||
|
||||
SDIO_CALLBACKENABLE(priv->dev, SDIOMEDIA_EJECTED);
|
||||
@@ -3096,7 +3096,7 @@ static int mmcsd_probe(FAR struct mmcsd_state_s *priv)
|
||||
/* There is no card in the slot */
|
||||
|
||||
finfo("No card\n");
|
||||
#ifdef CONFIG_MMCSD_HAVECARDDETECT
|
||||
#ifdef CONFIG_MMCSD_HAVE_CARDDETECT
|
||||
SDIO_CALLBACKENABLE(priv->dev, SDIOMEDIA_INSERTED);
|
||||
#endif
|
||||
ret = -ENODEV;
|
||||
|
||||
Reference in New Issue
Block a user