Skip to content
Snippets Groups Projects
Commit 06743c50 authored by patacongo's avatar patacongo
Browse files

Need a cancel method to stop DMA

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2280 42af7a65-404d-4744-a932-0658087f49c3
parent 04f6edba
No related branches found
No related tags found
No related merge requests found
......@@ -459,6 +459,7 @@ static int mmcsd_getSCR(FAR struct mmcsd_state_s *priv, uint32 scr[2])
if (ret != OK)
{
fdbg("ERROR: RECVR1 for ACMD51 failed: %d\n", ret);
SDIO_CANCEL(priv->dev);
return ret;
}
......@@ -1254,6 +1255,7 @@ static ssize_t mmcsd_readsingle(FAR struct mmcsd_state_s *priv,
if (ret != OK)
{
fdbg("ERROR: mmcsd_recvR1 for CMD17 failed: %d\n", ret);
SDIO_CANCEL(priv->dev);
return ret;
}
......@@ -1359,6 +1361,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
if (ret != OK)
{
fdbg("ERROR: mmcsd_recvR1 for CMD18 failed: %d\n", ret);
SDIO_CANCEL(priv->dev);
return ret;
}
......
......@@ -444,6 +444,25 @@
#define SDIO_SENDSETUP(dev,buffer,nbytes) ((dev)->sendsetup(dev,buffer,nbytes))
/****************************************************************************
* Name: SDIO_CANCEL
*
* Description:
* Cancel the data transfer setup of SDIO_RECVSETUP, SDIO_SENDSETUP,
* SDIO_DMARECVSETUP or SDIO_DMASENDSETUP. This must be called to cancel
* the data transfer setup if, for some reason, you cannot perform the
* transfer.
*
* Input Parameters:
* dev - An instance of the SDIO device interface
*
* Returned Value:
* OK is success; a negated errno on failure
*
****************************************************************************/
#define SDIO_CANCEL(dev) ((dev)->cancel(dev))
/****************************************************************************
* Name: SDIO_WAITRESPONSE
*
......@@ -708,6 +727,7 @@ struct sdio_dev_s
size_t nbytes);
int (*sendsetup)(FAR struct sdio_dev_s *dev, FAR const ubyte *buffer,
size_t nbytes);
int (*cancel)(FAR struct sdio_dev_s *dev);
int (*waitresponse)(FAR struct sdio_dev_s *dev, uint32 cmd);
int (*recvR1)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R1);
......
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