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:
Gregory Nutt
2017-12-20 10:52:05 -06:00
parent 5392955ec4
commit c867d42018
53 changed files with 231 additions and 247 deletions
+9 -4
View File
@@ -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"
+4 -4
View File
@@ -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;