Skip to content
Snippets Groups Projects
Commit b26c70b1 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

arch/arm/src/lkpc54xx: In SDMMC driver, fix an error which was clobbering the...

arch/arm/src/lkpc54xx:  In SDMMC driver, fix an error which was clobbering the interrupt mask register (xfrmask).  Also, add a kludge for the missing DTO interrupt.
parent eef12f1f
No related branches found
No related tags found
No related merge requests found
......@@ -677,7 +677,6 @@ static void lpc54_configwaitints(struct lpc54_dev_s *priv, uint32_t waitmask,
priv->waitevents = waitevents;
priv->wkupevent = wkupevent;
priv->waitmask = waitmask;
priv->xfrmask = waitmask;
regval = priv->xfrmask | priv->waitmask | SDCARD_INT_CDET;
lpc54_putreg(regval, LPC54_SDMMC_INTMASK);
......@@ -959,6 +958,8 @@ static int lpc54_interrupt(int irq, void *context, FAR void *arg)
uint32_t intmask = lpc54_getreg(LPC54_SDMMC_INTMASK);
intmask &= ~SDMMC_INT_TXDR;
lpc54_putreg(intmask, LPC54_SDMMC_INTMASK);
priv->xfrmask &= ~SDMMC_INT_TXDR;
}
}
else if ((pending & SDMMC_INT_RXDR) != 0)
......@@ -987,9 +988,17 @@ static int lpc54_interrupt(int irq, void *context, FAR void *arg)
if (priv->remaining <= 0)
{
#if 0 /* Kludge for missing DTO interrupt */
uint32_t intmask = lpc54_getreg(LPC54_SDMMC_INTMASK);
intmask &= ~SDMMC_INT_RXDR;
lpc54_putreg(intmask, LPC54_SDMMC_INTMASK);
priv->xfrmask &= ~SDMMC_INT_TXDR;
#else
/* Force the DTO event */
pending |= SDMMC_INT_DTO;
#endif
}
}
......@@ -2235,7 +2244,7 @@ static int lpc54_registercallback(FAR struct sdio_dev_s *dev,
mcinfo("callback=%p arg=%p\n", callback, arg);
/* Disable callbacks and register this callback and is argument */
/* Disable callbacks and register this callback and its argument */
mcinfo("Register %p(%p)\n", callback, arg);
DEBUGASSERT(priv != NULL);
......@@ -2483,7 +2492,7 @@ static void lpc54_callback(void *arg)
{
/* No... return without performing the callback */
mcinfo("Media is not Inserted!\n");
mcinfo("Media inserted but callback not enabled\n");
return;
}
}
......@@ -2495,7 +2504,7 @@ static void lpc54_callback(void *arg)
{
/* No... return without performing the callback */
mcinfo("Media is not present\n");
mcinfo("Media removed but callback not enabled\n");
return;
}
}
......
......@@ -84,7 +84,7 @@
/* Media events are used for enable/disable registered event callbacks */
#define SDIOMEDIA_EJECTED (1 << 0) /* Bit 0: Mmedia removed */
#define SDIOMEDIA_EJECTED (1 << 0) /* Bit 0: Media removed */
#define SDIOMEDIA_INSERTED (1 << 1) /* Bit 1: Media inserted */
/* Commands are bit-encoded to provide as much information to the SDIO driver as
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment