mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
Cosmetic changes to comments and coding style fixes
This commit is contained in:
@@ -2361,7 +2361,7 @@ static sdio_eventset_t sam_eventwait(FAR struct sdio_dev_s *dev,
|
|||||||
return SDIOWAIT_TIMEOUT;
|
return SDIOWAIT_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start the watchdog timer. I am not sure why this is, but I am\
|
/* Start the watchdog timer. I am not sure why this is, but I am
|
||||||
* currently seeing some additional delays when DMA is used.
|
* currently seeing some additional delays when DMA is used.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -342,6 +342,7 @@ static int mmcsd_sendcmdpoll(FAR struct mmcsd_state_s *priv, uint32_t cmd,
|
|||||||
fdbg("ERROR: Wait for response to cmd: %08x failed: %d\n", cmd, ret);
|
fdbg("ERROR: Wait for response to cmd: %08x failed: %d\n", cmd, ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,6 +382,7 @@ static inline int mmcsd_sendcmd4(FAR struct mmcsd_state_s *priv)
|
|||||||
up_udelay(MMCSD_DSR_DELAY);
|
up_udelay(MMCSD_DSR_DELAY);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,6 +417,7 @@ static int mmcsd_recvR1(FAR struct mmcsd_state_s *priv, uint32_t cmd)
|
|||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,6 +528,7 @@ static int mmcsd_getSCR(FAR struct mmcsd_state_s *priv, uint32_t scr[2])
|
|||||||
{
|
{
|
||||||
fdbg("ERROR: mmcsd_eventwait for READ DATA failed: %d\n", ret);
|
fdbg("ERROR: mmcsd_eventwait for READ DATA failed: %d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -997,6 +1001,7 @@ static int mmcsd_getR1(FAR struct mmcsd_state_s *priv, FAR uint32_t *r1)
|
|||||||
*r1 = localR1;
|
*r1 = localR1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1031,6 +1036,7 @@ static int mmcsd_verifystate(FAR struct mmcsd_state_s *priv, uint32_t state)
|
|||||||
priv->wrbusy = false;
|
priv->wrbusy = false;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1188,6 +1194,7 @@ static int mmcsd_transferready(FAR struct mmcsd_state_s *priv)
|
|||||||
elapsed = clock_systimer() - starttime;
|
elapsed = clock_systimer() - starttime;
|
||||||
}
|
}
|
||||||
while (elapsed < TICK_PER_SEC);
|
while (elapsed < TICK_PER_SEC);
|
||||||
|
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1212,6 +1219,7 @@ static int mmcsd_stoptransmission(FAR struct mmcsd_state_s *priv)
|
|||||||
{
|
{
|
||||||
fdbg("ERROR: mmcsd_recvR1 for CMD12 failed: %d\n", ret);
|
fdbg("ERROR: mmcsd_recvR1 for CMD12 failed: %d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1303,6 +1311,7 @@ static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv,
|
|||||||
{
|
{
|
||||||
offset = startblock << priv->blockshift;
|
offset = startblock << priv->blockshift;
|
||||||
}
|
}
|
||||||
|
|
||||||
fvdbg("offset=%d\n", offset);
|
fvdbg("offset=%d\n", offset);
|
||||||
|
|
||||||
/* Select the block size for the card */
|
/* Select the block size for the card */
|
||||||
@@ -1593,6 +1602,7 @@ static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv,
|
|||||||
{
|
{
|
||||||
offset = startblock << priv->blockshift;
|
offset = startblock << priv->blockshift;
|
||||||
}
|
}
|
||||||
|
|
||||||
fvdbg("offset=%d\n", offset);
|
fvdbg("offset=%d\n", offset);
|
||||||
|
|
||||||
/* Select the block size for the card */
|
/* Select the block size for the card */
|
||||||
@@ -1707,6 +1717,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
{
|
{
|
||||||
offset = startblock << priv->blockshift;
|
offset = startblock << priv->blockshift;
|
||||||
}
|
}
|
||||||
|
|
||||||
fvdbg("nbytes=%d byte offset=%d\n", nbytes, offset);
|
fvdbg("nbytes=%d byte offset=%d\n", nbytes, offset);
|
||||||
|
|
||||||
/* Select the block size for the card */
|
/* Select the block size for the card */
|
||||||
@@ -2113,6 +2124,7 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry)
|
|||||||
priv->mediachanged = false;
|
priv->mediachanged = false;
|
||||||
ret = OK;
|
ret = OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmcsd_givesem(priv);
|
mmcsd_givesem(priv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2365,6 +2377,7 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv)
|
|||||||
fdbg("ERROR: SDIO_RECVR2 for MMC CID failed: %d\n", ret);
|
fdbg("ERROR: SDIO_RECVR2 for MMC CID failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmcsd_decodeCID(priv, cid);
|
mmcsd_decodeCID(priv, cid);
|
||||||
|
|
||||||
/* Send CMD3, SET_RELATIVE_ADDR. This command is used to assign a logical
|
/* Send CMD3, SET_RELATIVE_ADDR. This command is used to assign a logical
|
||||||
@@ -2407,6 +2420,7 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv)
|
|||||||
fdbg("ERROR: Could not get SD CSD register: %d\n", ret);
|
fdbg("ERROR: Could not get SD CSD register: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmcsd_decodeCSD(priv, csd);
|
mmcsd_decodeCSD(priv, csd);
|
||||||
|
|
||||||
/* Set the Driver Stage Register (DSR) if (1) a CONFIG_MMCSD_DSR has been
|
/* Set the Driver Stage Register (DSR) if (1) a CONFIG_MMCSD_DSR has been
|
||||||
@@ -2464,6 +2478,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv)
|
|||||||
fdbg("ERROR: SDIO_RECVR2 for SD CID failed: %d\n", ret);
|
fdbg("ERROR: SDIO_RECVR2 for SD CID failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmcsd_decodeCID(priv, cid);
|
mmcsd_decodeCID(priv, cid);
|
||||||
|
|
||||||
/* Send CMD3, SET_RELATIVE_ADDR. In both protocols, this command is used
|
/* Send CMD3, SET_RELATIVE_ADDR. In both protocols, this command is used
|
||||||
@@ -2481,6 +2496,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv)
|
|||||||
fdbg("ERROR: mmcsd_recvR2 for SD RCA failed: %d\n", ret);
|
fdbg("ERROR: mmcsd_recvR2 for SD RCA failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
fvdbg("RCA: %04x\n", priv->rca);
|
fvdbg("RCA: %04x\n", priv->rca);
|
||||||
|
|
||||||
/* This should have caused a transition to standby state. However, this will
|
/* This should have caused a transition to standby state. However, this will
|
||||||
@@ -2510,6 +2526,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv)
|
|||||||
fdbg("ERROR: Could not get SD CSD register(%d)\n", ret);
|
fdbg("ERROR: Could not get SD CSD register(%d)\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmcsd_decodeCSD(priv, csd);
|
mmcsd_decodeCSD(priv, csd);
|
||||||
|
|
||||||
/* Send CMD7 with the argument == RCA in order to select the card.
|
/* Send CMD7 with the argument == RCA in order to select the card.
|
||||||
@@ -2548,6 +2565,7 @@ static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv)
|
|||||||
fdbg("ERROR: Could not get SD SCR register(%d)\n", ret);
|
fdbg("ERROR: Could not get SD SCR register(%d)\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmcsd_decodeSCR(priv, scr);
|
mmcsd_decodeSCR(priv, scr);
|
||||||
|
|
||||||
/* Select width (4-bit) bus operation (if the card supports it) */
|
/* Select width (4-bit) bus operation (if the card supports it) */
|
||||||
@@ -2750,6 +2768,7 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
|
|||||||
* MMC card. We can send the CMD1 to find out for sure. CMD1 is supported
|
* MMC card. We can send the CMD1 to find out for sure. CMD1 is supported
|
||||||
* by MMC cards, but not by SD cards.
|
* by MMC cards, but not by SD cards.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_MMCSD_MMCSUPPORT
|
#ifdef CONFIG_MMCSD_MMCSUPPORT
|
||||||
if (priv->type == MMCSD_CARDTYPE_UNKNOWN || priv->type == MMCSD_CARDTYPE_MMC)
|
if (priv->type == MMCSD_CARDTYPE_UNKNOWN || priv->type == MMCSD_CARDTYPE_MMC)
|
||||||
{
|
{
|
||||||
@@ -2898,7 +2917,7 @@ static int mmcsd_probe(FAR struct mmcsd_state_s *priv)
|
|||||||
fdbg("ERROR: Internal confusion: %d\n", priv->type);
|
fdbg("ERROR: Internal confusion: %d\n", priv->type);
|
||||||
ret = -EPERM;
|
ret = -EPERM;
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
|
|
||||||
/* Was the card configured successfully? */
|
/* Was the card configured successfully? */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user