drivers/mmcsd: fix style issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
parent
1e86682feb
commit
8254b374dd
@ -146,51 +146,54 @@ static void mmcsd_unlock(FAR struct mmcsd_state_s *priv);
|
|||||||
/* Command/response helpers *************************************************/
|
/* Command/response helpers *************************************************/
|
||||||
|
|
||||||
static int mmcsd_sendcmdpoll(FAR struct mmcsd_state_s *priv,
|
static int mmcsd_sendcmdpoll(FAR struct mmcsd_state_s *priv,
|
||||||
uint32_t cmd, uint32_t arg);
|
uint32_t cmd, uint32_t arg);
|
||||||
static int mmcsd_recv_r1(FAR struct mmcsd_state_s *priv, uint32_t cmd);
|
static int mmcsd_recv_r1(FAR struct mmcsd_state_s *priv, uint32_t cmd);
|
||||||
static int mmcsd_recv_r6(FAR struct mmcsd_state_s *priv, uint32_t cmd);
|
static int mmcsd_recv_r6(FAR struct mmcsd_state_s *priv, uint32_t cmd);
|
||||||
static int mmcsd_get_scr(FAR struct mmcsd_state_s *priv,
|
static int mmcsd_get_scr(FAR struct mmcsd_state_s *priv,
|
||||||
uint32_t scr[2]);
|
uint32_t scr[2]);
|
||||||
|
|
||||||
static void mmcsd_decode_csd(FAR struct mmcsd_state_s *priv,
|
static void mmcsd_decode_csd(FAR struct mmcsd_state_s *priv,
|
||||||
uint32_t csd[4]);
|
uint32_t csd[4]);
|
||||||
#ifdef CONFIG_DEBUG_FS_INFO
|
#ifdef CONFIG_DEBUG_FS_INFO
|
||||||
static void mmcsd_decode_cid(FAR struct mmcsd_state_s *priv,
|
static void mmcsd_decode_cid(FAR struct mmcsd_state_s *priv,
|
||||||
uint32_t cid[4]);
|
uint32_t cid[4]);
|
||||||
#else
|
#else
|
||||||
# define mmcsd_decode_cid(priv,cid)
|
# define mmcsd_decode_cid(priv,cid)
|
||||||
#endif
|
#endif
|
||||||
static void mmcsd_decode_scr(FAR struct mmcsd_state_s *priv,
|
static void mmcsd_decode_scr(FAR struct mmcsd_state_s *priv,
|
||||||
uint32_t scr[2]);
|
uint32_t scr[2]);
|
||||||
|
|
||||||
static int mmcsd_get_r1(FAR struct mmcsd_state_s *priv,
|
static int mmcsd_get_r1(FAR struct mmcsd_state_s *priv,
|
||||||
FAR uint32_t *r1);
|
FAR uint32_t *r1);
|
||||||
static int mmcsd_verifystate(FAR struct mmcsd_state_s *priv,
|
static int mmcsd_verifystate(FAR struct mmcsd_state_s *priv,
|
||||||
uint32_t status);
|
uint32_t status);
|
||||||
|
|
||||||
/* Transfer helpers *********************************************************/
|
/* Transfer helpers *********************************************************/
|
||||||
|
|
||||||
static bool mmcsd_wrprotected(FAR struct mmcsd_state_s *priv);
|
static bool mmcsd_wrprotected(FAR struct mmcsd_state_s *priv);
|
||||||
static int mmcsd_eventwait(FAR struct mmcsd_state_s *priv,
|
static int mmcsd_eventwait(FAR struct mmcsd_state_s *priv,
|
||||||
sdio_eventset_t failevents);
|
sdio_eventset_t failevents);
|
||||||
static int mmcsd_transferready(FAR struct mmcsd_state_s *priv);
|
static int mmcsd_transferready(FAR struct mmcsd_state_s *priv);
|
||||||
#if MMCSD_MULTIBLOCK_LIMIT != 1
|
#if MMCSD_MULTIBLOCK_LIMIT != 1
|
||||||
static int mmcsd_stoptransmission(FAR struct mmcsd_state_s *priv);
|
static int mmcsd_stoptransmission(FAR struct mmcsd_state_s *priv);
|
||||||
#endif
|
#endif
|
||||||
static int mmcsd_setblocklen(FAR struct mmcsd_state_s *priv,
|
static int mmcsd_setblocklen(FAR struct mmcsd_state_s *priv,
|
||||||
uint32_t blocklen);
|
uint32_t blocklen);
|
||||||
static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv,
|
static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv,
|
||||||
FAR uint8_t *buffer, off_t startblock);
|
FAR uint8_t *buffer, off_t startblock);
|
||||||
#if MMCSD_MULTIBLOCK_LIMIT != 1
|
#if MMCSD_MULTIBLOCK_LIMIT != 1
|
||||||
static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
|
static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
|
||||||
FAR uint8_t *buffer, off_t startblock, size_t nblocks);
|
FAR uint8_t *buffer, off_t startblock,
|
||||||
|
size_t nblocks);
|
||||||
#endif
|
#endif
|
||||||
static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv,
|
static ssize_t mmcsd_writesingle(FAR struct mmcsd_state_s *priv,
|
||||||
FAR const uint8_t *buffer, off_t startblock);
|
FAR const uint8_t *buffer,
|
||||||
|
off_t startblock);
|
||||||
#if MMCSD_MULTIBLOCK_LIMIT != 1
|
#if MMCSD_MULTIBLOCK_LIMIT != 1
|
||||||
static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
|
static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
|
||||||
FAR const uint8_t *buffer, off_t startblock,
|
FAR const uint8_t *buffer,
|
||||||
size_t nblocks);
|
off_t startblock,
|
||||||
|
size_t nblocks);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Block driver methods *****************************************************/
|
/* Block driver methods *****************************************************/
|
||||||
@ -198,14 +201,15 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
static int mmcsd_open(FAR struct inode *inode);
|
static int mmcsd_open(FAR struct inode *inode);
|
||||||
static int mmcsd_close(FAR struct inode *inode);
|
static int mmcsd_close(FAR struct inode *inode);
|
||||||
static ssize_t mmcsd_read(FAR struct inode *inode, FAR unsigned char *buffer,
|
static ssize_t mmcsd_read(FAR struct inode *inode, FAR unsigned char *buffer,
|
||||||
blkcnt_t startsector, unsigned int nsectors);
|
blkcnt_t startsector, unsigned int nsectors);
|
||||||
static ssize_t mmcsd_write(FAR struct inode *inode,
|
static ssize_t mmcsd_write(FAR struct inode *inode,
|
||||||
FAR const unsigned char *buffer, blkcnt_t startsector,
|
FAR const unsigned char *buffer,
|
||||||
unsigned int nsectors);
|
blkcnt_t startsector,
|
||||||
|
unsigned int nsectors);
|
||||||
static int mmcsd_geometry(FAR struct inode *inode,
|
static int mmcsd_geometry(FAR struct inode *inode,
|
||||||
FAR struct geometry *geometry);
|
FAR struct geometry *geometry);
|
||||||
static int mmcsd_ioctl(FAR struct inode *inode, int cmd,
|
static int mmcsd_ioctl(FAR struct inode *inode, int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
|
|
||||||
/* Initialization/uninitialization/reset ************************************/
|
/* Initialization/uninitialization/reset ************************************/
|
||||||
|
|
||||||
@ -1574,8 +1578,8 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
|
|
||||||
SDIO_BLOCKSETUP(priv->dev, priv->blocksize, nblocks);
|
SDIO_BLOCKSETUP(priv->dev, priv->blocksize, nblocks);
|
||||||
SDIO_WAITENABLE(priv->dev,
|
SDIO_WAITENABLE(priv->dev,
|
||||||
SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT | SDIOWAIT_ERROR,
|
SDIOWAIT_TRANSFERDONE | SDIOWAIT_TIMEOUT | SDIOWAIT_ERROR,
|
||||||
nblocks * MMCSD_BLOCK_RDATADELAY);
|
nblocks * MMCSD_BLOCK_RDATADELAY);
|
||||||
|
|
||||||
#ifdef CONFIG_SDIO_DMA
|
#ifdef CONFIG_SDIO_DMA
|
||||||
if ((priv->caps & SDIO_CAPS_DMASUPPORTED) != 0)
|
if ((priv->caps & SDIO_CAPS_DMASUPPORTED) != 0)
|
||||||
@ -2545,11 +2549,9 @@ static int mmcsd_widebus(FAR struct mmcsd_state_s *priv)
|
|||||||
* Configuring MMC - Use MMC_SWITCH access modes.
|
* Configuring MMC - Use MMC_SWITCH access modes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint32_t arg = MMCSD_CMD6_MODE_WRITE_BYTE | MMCSD_CMD6_BUSWIDTH_RW;
|
mmcsd_sendcmdpoll(priv, MMCSD_CMD6,
|
||||||
|
MMCSD_CMD6_MODE_WRITE_BYTE | MMCSD_CMD6_BUSWIDTH_RW |
|
||||||
arg |= MMCSD_CMD6_BUS_WIDTH_4;
|
MMCSD_CMD6_BUS_WIDTH_4);
|
||||||
|
|
||||||
mmcsd_sendcmdpoll(priv, MMCSD_CMD6, arg);
|
|
||||||
ret = mmcsd_recv_r1(priv, MMCSD_CMD6);
|
ret = mmcsd_recv_r1(priv, MMCSD_CMD6);
|
||||||
|
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
@ -2690,7 +2692,7 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv)
|
|||||||
* extended CSD register.
|
* extended CSD register.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mmcsd_sendcmdpoll(priv, MMCSD_CMD9, (uint32_t) priv->rca << 16);
|
mmcsd_sendcmdpoll(priv, MMCSD_CMD9, (uint32_t)priv->rca << 16);
|
||||||
ret = SDIO_RECVR2(priv->dev, MMCSD_CMD9, csd);
|
ret = SDIO_RECVR2(priv->dev, MMCSD_CMD9, csd);
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
{
|
{
|
||||||
@ -3497,8 +3499,8 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
|
|||||||
|
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
{
|
{
|
||||||
fwarn("WARNING: CMD1 RECVR3: %d. \
|
fwarn("WARNING: CMD1 RECVR3: %d. "
|
||||||
NOTE: This is expected for SD cards.\n", ret);
|
"NOTE: This is expected for SD cards.\n", ret);
|
||||||
|
|
||||||
/* CMD1 did not succeed, card is not MMC. Return to idle
|
/* CMD1 did not succeed, card is not MMC. Return to idle
|
||||||
* to allow the communication to recover before another send.
|
* to allow the communication to recover before another send.
|
||||||
|
Loading…
Reference in New Issue
Block a user