mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
Add support for multiplexed SDIO pins from Uros
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3898 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -148,7 +148,10 @@ struct mmcsd_state_s
|
||||
/* Misc Helpers *************************************************************/
|
||||
|
||||
static void mmcsd_takesem(FAR struct mmcsd_state_s *priv);
|
||||
#define mmcsd_givesem(p) sem_post(&priv->sem);
|
||||
|
||||
#ifndef CONFIG_SDIO_MUXBUS
|
||||
# define mmcsd_givesem(p) sem_post(&priv->sem);
|
||||
#endif
|
||||
|
||||
/* Command/response helpers *************************************************/
|
||||
|
||||
@@ -261,18 +264,41 @@ static const struct block_operations g_bops =
|
||||
|
||||
static void mmcsd_takesem(FAR struct mmcsd_state_s *priv)
|
||||
{
|
||||
/* Take the semaphore (perhaps waiting) */
|
||||
/* Take the semaphore, giving exclusive access to the driver (perhaps
|
||||
* waiting)
|
||||
*/
|
||||
|
||||
while (sem_wait(&priv->sem) != 0)
|
||||
{
|
||||
/* The only case that an error should occr here is if the wait was
|
||||
/* The only case that an error should occur here is if the wait was
|
||||
* awakened by a signal.
|
||||
*/
|
||||
|
||||
ASSERT(errno == EINTR);
|
||||
}
|
||||
|
||||
/* Lock the bus if mutually exclusive access to the SDIO bus is required
|
||||
* on this platform.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SDIO_MUXBUS
|
||||
SDIO_LOCK(priv->dev, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_MUXBUS
|
||||
static void mmcsd_givesem(FAR struct mmcsd_state_s *priv)
|
||||
{
|
||||
/* Release the SDIO bus lock, then the MMC/SD driver semaphore in the
|
||||
* opposite order that they were taken to assure that no deadlock
|
||||
* conditions will arise.
|
||||
*/
|
||||
|
||||
SDIO_LOCK(priv->dev, FALSE);
|
||||
sem_post(&priv->sem);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Command/Response Helpers
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user