SAM4E-EK: Fixes for HSMCI compilation

This commit is contained in:
Gregory Nutt
2014-03-23 15:46:55 -06:00
parent 8094dfb4fd
commit 1b0e1aee04
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -74,9 +74,9 @@
# undef HAVE_HSMCI # undef HAVE_HSMCI
#endif #endif
/* We need PIO interrupts on PIOA to support card detect interrupts */ /* We need PIO interrupts on GPIOA to support card detect interrupts */
#if defined(HAVE_HSMCI) && !defined(CONFIG_SAM34_PIOA_IRQ) #if defined(HAVE_HSMCI) && !defined(CONFIG_SAM34_GPIOA_IRQ)
# warning PIOA interrupts not enabled. No MMC/SD support. # warning PIOA interrupts not enabled. No MMC/SD support.
# undef HAVE_HSMCI # undef HAVE_HSMCI
#endif #endif
@@ -418,9 +418,9 @@ void weak_function sam_spiinitialize(void);
************************************************************************************/ ************************************************************************************/
#ifdef HAVE_HSMCI #ifdef HAVE_HSMCI
int weak_function sam_hsmci_initialize(void); int sam_hsmci_initialize(int minor);
#else #else
# define sam_hsmci_initialize() # define sam_hsmci_initialize(minor) (-ENOSYS)
#endif #endif
/************************************************************************************ /************************************************************************************
+4 -4
View File
@@ -136,7 +136,7 @@ int sam_hsmci_initialize(int minor)
{ {
/* Initialize card-detect GPIO. There is no write-protection GPIO. */ /* Initialize card-detect GPIO. There is no write-protection GPIO. */
sam_configpio(GPIO_MCI_CD); sam_configgpio(GPIO_MCI_CD);
/* Mount the SDIO-based MMC/SD block driver */ /* Mount the SDIO-based MMC/SD block driver */
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
@@ -159,7 +159,7 @@ int sam_hsmci_initialize(int minor)
/* Configure card detect interrupts */ /* Configure card detect interrupts */
sam_pioirq(GPIO_MCI_CD); sam_gpioirq(GPIO_MCI_CD);
(void)irq_attach(MCI_CD_IRQ, sam_hsmci_cardetect); (void)irq_attach(MCI_CD_IRQ, sam_hsmci_cardetect);
/* Then inform the HSMCI driver if there is or is not a card in the slot. */ /* Then inform the HSMCI driver if there is or is not a card in the slot. */
@@ -173,7 +173,7 @@ int sam_hsmci_initialize(int minor)
/* Enable card detect interrupts */ /* Enable card detect interrupts */
sam_pioirqenable(MCI_CD_IRQ); sam_gpioirqenable(MCI_CD_IRQ);
} }
return OK; return OK;
@@ -193,7 +193,7 @@ bool sam_cardinserted(int slotno)
/* Get the state of the GPIO pin */ /* Get the state of the GPIO pin */
removed = sam_pioread(GPIO_MCI_CD); removed = sam_gpioread(GPIO_MCI_CD);
fllvdbg("Slot %d inserted: %s\n", slotno, removed ? "NO" : "YES"); fllvdbg("Slot %d inserted: %s\n", slotno, removed ? "NO" : "YES");
return !removed; return !removed;