mmcsd: Add gotextcsd callback to sdio_dev_s

so the driver implementation could get critical EXTCSD info

Signed-off-by: anjianjun <anjianjun@xiaomi.com>
This commit is contained in:
anjianjun 2021-10-31 18:55:28 +08:00 committed by Petro Karashchenko
parent 5b214888aa
commit f95d13b3a1
2 changed files with 21 additions and 0 deletions

View File

@ -2758,6 +2758,8 @@ static int mmcsd_read_csd(FAR struct mmcsd_state_s *priv)
finfo("MMC ext CSD read succsesfully, number of block %" PRId32 "\n", finfo("MMC ext CSD read succsesfully, number of block %" PRId32 "\n",
priv->nblocks); priv->nblocks);
SDIO_GOTEXTCSD(priv->dev, buffer);
/* Return value: One sector read */ /* Return value: One sector read */
return OK; return OK;

View File

@ -539,6 +539,24 @@
#define SDIO_CLOCK(dev,rate) ((dev)->clock(dev,rate)) #define SDIO_CLOCK(dev,rate) ((dev)->clock(dev,rate))
/****************************************************************************
* Name: SDIO_GOTEXTCSD
*
* Description:
* Notify driver EXT CSD data
*
* Input Parameters:
* dev - An instance of the SDIO device interface
* buffer - Ext Csd data
*
* Returned Value:
* None.
*
****************************************************************************/
#define SDIO_GOTEXTCSD(dev,buffer) \
((dev)->gotextcsd?(dev)->gotextcsd(dev,buffer):OK)
/**************************************************************************** /****************************************************************************
* Name: SDIO_ATTACH * Name: SDIO_ATTACH
* *
@ -1008,6 +1026,7 @@ struct sdio_dev_s
int (*dmasendsetup)(FAR struct sdio_dev_s *dev, int (*dmasendsetup)(FAR struct sdio_dev_s *dev,
FAR const uint8_t *buffer, size_t buflen); FAR const uint8_t *buffer, size_t buflen);
#endif /* CONFIG_SDIO_DMA */ #endif /* CONFIG_SDIO_DMA */
void (*gotextcsd)(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer);
}; };
/**************************************************************************** /****************************************************************************