Fix some cloned errors in SAM GPIO interrupt setup

This commit is contained in:
Gregory Nutt
2014-07-07 15:54:37 -06:00
parent 6cb13fde4e
commit 19d8b0ce97
21 changed files with 148 additions and 91 deletions
+1 -1
View File
@@ -257,7 +257,7 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
* Setup to receive an interrupt-level callback if an overcurrent condition is * Setup to receive an interrupt-level callback if an overcurrent condition is
* detected. * detected.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value:
+1 -1
View File
@@ -256,7 +256,7 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
* Setup to receive an interrupt-level callback if an overcurrent condition is * Setup to receive an interrupt-level callback if an overcurrent condition is
* detected. * detected.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value:
+1 -1
View File
@@ -207,7 +207,7 @@ int stm32_usbhost_initialize(void)
* Setup to receive an interrupt-level callback if an overcurrent condition is * Setup to receive an interrupt-level callback if an overcurrent condition is
* detected. * detected.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value:
+7 -4
View File
@@ -78,7 +78,8 @@ static xcpt_t g_irqbutton2;
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) #if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
static xcpt_t board_button_irqx(int irq, xcpt_t irqhandler, xcpt_t *store) static xcpt_t board_button_irqx(gpio_pinset_t pinset, int irq,
xcpt_t irqhandler, xcpt_t *store)
{ {
xcpt_t oldhandler; xcpt_t oldhandler;
irqstate_t flags; irqstate_t flags;
@@ -100,7 +101,7 @@ static xcpt_t board_button_irqx(int irq, xcpt_t irqhandler, xcpt_t *store)
{ {
/* Configure the interrupt */ /* Configure the interrupt */
sam_gpioirq(irq); sam_gpioirq(pinset);
(void)irq_attach(irq, irqhandler); (void)irq_attach(irq, irqhandler);
sam_gpioirqenable(irq); sam_gpioirqenable(irq);
} }
@@ -185,11 +186,13 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
{ {
if (id == BUTTON1) if (id == BUTTON1)
{ {
return board_button_irqx(IRQ_BUTTON1, irqhandler, &g_irqbutton1); return board_button_irqx(GPIO_BUTTON1, IRQ_BUTTON1,
irqhandler, &g_irqbutton1);
} }
else if (id == BUTTON2) else if (id == BUTTON2)
{ {
return board_button_irqx(IRQ_BUTTON2, irqhandler, &g_irqbutton2); return board_button_irqx(GPIO_BUTTON2, IRQ_BUTTON2,
irqhandler, &g_irqbutton2);
} }
else else
{ {
+21 -16
View File
@@ -80,7 +80,8 @@ static xcpt_t g_irq_tamp;
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) #if defined(CONFIG_SAM34_GPIOA_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
static xcpt_t board_button_irqx(int irq, xcpt_t irqhandler, xcpt_t *store) static xcpt_t board_button_irqx(gpio_pinset_t pinset, int irq,
xcpt_t irqhandler, xcpt_t *store)
{ {
xcpt_t oldhandler; xcpt_t oldhandler;
irqstate_t flags; irqstate_t flags;
@@ -102,7 +103,7 @@ static xcpt_t board_button_irqx(int irq, xcpt_t irqhandler, xcpt_t *store)
{ {
/* Configure the interrupt */ /* Configure the interrupt */
sam_gpioirq(irq); sam_gpioirq(pinset);
(void)irq_attach(irq, irqhandler); (void)irq_attach(irq, irqhandler);
sam_gpioirqenable(irq); sam_gpioirqenable(irq);
} }
@@ -130,10 +131,10 @@ static xcpt_t board_button_irqx(int irq, xcpt_t irqhandler, xcpt_t *store)
* Name: board_button_initialize * Name: board_button_initialize
* *
* Description: * Description:
* board_button_initialize() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, board_buttons() may be called to collect the current state of all * After that, board_buttons() may be called to collect the current state
* buttons or board_button_irq() may be called to register button interrupt * of all buttons or board_button_irq() may be called to register button
* handlers. * interrupt handlers.
* *
****************************************************************************/ ****************************************************************************/
@@ -145,16 +146,16 @@ void board_button_initialize(void)
(void)sam_configgpio(GPIO_TAMP); (void)sam_configgpio(GPIO_TAMP);
} }
/************************************************************************************ /****************************************************************************
* Name: board_buttons * Name: board_buttons
* *
* Description: * Description:
* After board_button_initialize() has been called, board_buttons() may be called to collect * After board_button_initialize() has been called, board_buttons() may be
* the state of all buttons. board_buttons() returns an 8-bit bit set with each bit * called to collect the state of all buttons. board_buttons() returns an
* associated with a button. See the BUTTON* definitions above for the meaning of * 8-bit bit set with each bit associated with a button. See the BUTTON*
* each bit in the returned value. * definitions above for the meaning of each bit in the returned value.
* *
************************************************************************************/ ****************************************************************************/
uint8_t board_buttons(void) uint8_t board_buttons(void)
{ {
@@ -192,16 +193,20 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
switch (id) switch (id)
{ {
case BUTTON_SCROLLUP: case BUTTON_SCROLLUP:
return board_button_irqx(IRQ_SCROLLUP, irqhandler, &g_irq_scrollup); return board_button_irqx(GPIO_SCROLLUP, IRQ_SCROLLUP,
irqhandler, &g_irq_scrollup);
case BUTTON_SCROLLDOWN: case BUTTON_SCROLLDOWN:
return board_button_irqx(IRQ_SCROLLDWN, irqhandler, &g_irq_scrolldown); return board_button_irqx(GPIO_SCROLLDWN, IRQ_SCROLLDWN,
irqhandler, &g_irq_scrolldown);
case BUTTON_WAKU: case BUTTON_WAKU:
return board_button_irqx(IRQ_WAKU, irqhandler, &g_irq_waku); return board_button_irqx(GPIO_WAKU, IRQ_WAKU,
irqhandler, &g_irq_waku);
case BUTTON_TAMP: case BUTTON_TAMP:
return board_button_irqx(IRQ_WAKU, irqhandler, &g_irq_tamp); return board_button_irqx(GPIO_TAMP, IRQ_WAKU,
irqhandler, &g_irq_tamp);
default: default:
return NULL; return NULL;
+12 -12
View File
@@ -76,10 +76,10 @@ static xcpt_t g_irqsw0;
* Name: board_button_initialize * Name: board_button_initialize
* *
* Description: * Description:
* board_button_initialize() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, board_buttons() may be called to collect the current state of all * After that, board_buttons() may be called to collect the current state
* buttons or board_button_irq() may be called to register button interrupt * of all buttons or board_button_irq() may be called to register button
* handlers. * interrupt handlers.
* *
****************************************************************************/ ****************************************************************************/
@@ -88,16 +88,16 @@ void board_button_initialize(void)
(void)sam_configgpio(GPIO_SW0); (void)sam_configgpio(GPIO_SW0);
} }
/************************************************************************************ /****************************************************************************
* Name: board_buttons * Name: board_buttons
* *
* Description: * Description:
* After board_button_initialize() has been called, board_buttons() may be called to collect * After board_button_initialize() has been called, board_buttons() may be
* the state of all buttons. board_buttons() returns an 8-bit bit set with each bit * called to collect the state of all buttons. board_buttons() returns an
* associated with a button. See the BUTTON* definitions above for the meaning of * 8-bit bit set with each bit associated with a button. See the BUTTON*
* each bit in the returned value. * definitions above for the meaning of each bit in the returned value.
* *
************************************************************************************/ ****************************************************************************/
uint8_t board_buttons(void) uint8_t board_buttons(void)
{ {
@@ -111,7 +111,7 @@ uint8_t board_buttons(void)
* This function may be called to register an interrupt handler that will * This function may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is one * be called when a button is depressed or released. The ID value is one
* of the BUTTON* definitions provided above. The previous interrupt * of the BUTTON* definitions provided above. The previous interrupt
* handler address isreturned (so that it may restored, if so desired). * handler address is returned (so that it may restored, if so desired).
* *
* Configuration Notes: * Configuration Notes:
* Configuration CONFIG_AVR32_GPIOIRQ must be selected to enable the * Configuration CONFIG_AVR32_GPIOIRQ must be selected to enable the
@@ -148,7 +148,7 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
{ {
/* Configure the interrupt */ /* Configure the interrupt */
sam_gpioirq(IRQ_SW0); sam_gpioirq(GPIO_SW0);
(void)irq_attach(IRQ_SW0, irqhandler); (void)irq_attach(IRQ_SW0, irqhandler);
sam_gpioirqenable(IRQ_SW0); sam_gpioirqenable(IRQ_SW0);
} }
+11 -11
View File
@@ -75,10 +75,10 @@ static xcpt_t g_irqsw0;
* Name: board_button_initialize * Name: board_button_initialize
* *
* Description: * Description:
* board_button_initialize() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, board_buttons() may be called to collect the current state of all * After that, board_buttons() may be called to collect the current state
* buttons or board_button_irq() may be called to register button interrupt * of all buttons or board_button_irq() may be called to register button
* handlers. * interrupt handlers.
* *
****************************************************************************/ ****************************************************************************/
@@ -87,16 +87,16 @@ void board_button_initialize(void)
(void)sam_configgpio(GPIO_SW0); (void)sam_configgpio(GPIO_SW0);
} }
/************************************************************************************ /****************************************************************************
* Name: board_buttons * Name: board_buttons
* *
* Description: * Description:
* After board_button_initialize() has been called, board_buttons() may be called to collect * After board_button_initialize() has been called, board_buttons() may be
* the state of all buttons. board_buttons() returns an 8-bit bit set with each bit * called to collect the state of all buttons. board_buttons() returns an
* associated with a button. See the BUTTON* definitions above for the meaning of * 8-bit bit set with each bit associated with a button. See the BUTTON*
* each bit in the returned value. * definitions above for the meaning of each bit in the returned value.
* *
************************************************************************************/ ****************************************************************************/
uint8_t board_buttons(void) uint8_t board_buttons(void)
{ {
@@ -147,7 +147,7 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
{ {
/* Configure the interrupt */ /* Configure the interrupt */
sam_gpioirq(IRQ_SW0); sam_gpioirq(GPIO_SW0);
(void)irq_attach(IRQ_SW0, irqhandler); (void)irq_attach(IRQ_SW0, irqhandler);
sam_gpioirqenable(IRQ_SW0); sam_gpioirqenable(IRQ_SW0);
} }
+12 -12
View File
@@ -74,10 +74,10 @@ static xcpt_t g_irqbp2;
* Name: board_button_initialize * Name: board_button_initialize
* *
* Description: * Description:
* board_button_initialize() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, board_buttons() may be called to collect the current state of all * After that, board_buttons() may be called to collect the current state
* buttons or board_button_irq() may be called to register button interrupt * of all buttons or board_button_irq() may be called to register button
* handlers. * interrupt handlers.
* *
****************************************************************************/ ****************************************************************************/
@@ -86,16 +86,16 @@ void board_button_initialize(void)
(void)sam_configgpio(GPIO_BP2); (void)sam_configgpio(GPIO_BP2);
} }
/************************************************************************************ /****************************************************************************
* Name: board_buttons * Name: board_buttons
* *
* Description: * Description:
* After board_button_initialize() has been called, board_buttons() may be called to collect * After board_button_initialize() has been called, board_buttons() may be
* the state of all buttons. board_buttons() returns an 8-bit bit set with each bit * called to collect the state of all buttons. board_buttons() returns an
* associated with a button. See the BUTTON* definitions above for the meaning of * 8-bit bit set with each bit associated with a button. See the BUTTON*
* each bit in the returned value. * definitions above for the meaning of each bit in the returned value.
* *
************************************************************************************/ ****************************************************************************/
uint8_t board_buttons(void) uint8_t board_buttons(void)
{ {
@@ -109,7 +109,7 @@ uint8_t board_buttons(void)
* This function may be called to register an interrupt handler that will * This function may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is one * be called when a button is depressed or released. The ID value is one
* of the BUTTON* definitions provided above. The previous interrupt * of the BUTTON* definitions provided above. The previous interrupt
* handler address isreturned (so that it may restored, if so desired). * handler address is returned (so that it may restored, if so desired).
* *
* Configuration Notes: * Configuration Notes:
* Configuration CONFIG_AVR32_GPIOIRQ must be selected to enable the * Configuration CONFIG_AVR32_GPIOIRQ must be selected to enable the
@@ -146,7 +146,7 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
{ {
/* Configure the interrupt */ /* Configure the interrupt */
sam_gpioirq(IRQ_BP2); sam_gpioirq(GPIO_BP2);
(void)irq_attach(IRQ_BP2, irqhandler); (void)irq_attach(IRQ_BP2, irqhandler);
sam_gpioirqenable(IRQ_BP2); sam_gpioirqenable(IRQ_BP2);
} }
+18 -4
View File
@@ -126,7 +126,7 @@ uint8_t board_buttons(void)
* This function may be called to register an interrupt handler that will * This function may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is one * be called when a button is depressed or released. The ID value is one
* of the BUTTON* definitions provided above. The previous interrupt * of the BUTTON* definitions provided above. The previous interrupt
* handler address isreturned (so that it may restored, if so desired). * handler address is returned (so that it may restored, if so desired).
* *
* Configuration Notes: * Configuration Notes:
* Configuration CONFIG_SAMA5_PIO_IRQ must be selected to enable the * Configuration CONFIG_SAMA5_PIO_IRQ must be selected to enable the
@@ -155,11 +155,25 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
oldhandler = g_irquser1; oldhandler = g_irquser1;
g_irquser1 = irqhandler; g_irquser1 = irqhandler;
/* Are we attaching or detaching? */
if (irqhandler != NULL)
{
/* Configure the interrupt */
sam_pioirq(PIO_USER);
(void)irq_attach(IRQ_USER1, irqhandler);
sam_pioirqenable(IRQ_USER1);
}
else
{
/* Disable and detach the interrupt */
sam_pioirqdisable(IRQ_USER1);
(void)irq_detach(IRQ_USER1);
}
/* Configure the interrupt */ /* Configure the interrupt */
sam_pioirq(IRQ_USER1);
(void)irq_attach(IRQ_USER1, irqhandler);
sam_pioirqenable(IRQ_USER1);
irqrestore(flags); irqrestore(flags);
} }
+4 -1
View File
@@ -136,12 +136,14 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
irqstate_t flags; irqstate_t flags;
xcpt_t *handler; xcpt_t *handler;
xcpt_t oldhandler; xcpt_t oldhandler;
pio_pinset_t pinset;
int irq; int irq;
#ifdef CONFIG_SAMA5_EMACA #ifdef CONFIG_SAMA5_EMACA
if (intf == EMAC_INTF) if (intf == EMAC_INTF)
{ {
handler = &g_emac_handler; handler = &g_emac_handler;
pinset = PIO_INT_ETH1;
irq = IRQ_INT_ETH1; irq = IRQ_INT_ETH1;
} }
else else
@@ -150,6 +152,7 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
if (intf == GMAC_INTF) if (intf == GMAC_INTF)
{ {
handler = &g_gmac_handler; handler = &g_gmac_handler;
pinset = PIO_INT_ETH0;
irq = IRQ_INT_ETH0; irq = IRQ_INT_ETH0;
} }
else else
@@ -172,7 +175,7 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
/* Configure the interrupt */ /* Configure the interrupt */
sam_pioirq(irq); sam_pioirq(pinset);
(void)irq_attach(irq, irqhandler); (void)irq_attach(irq, irqhandler);
sam_pioirqenable(irq); sam_pioirqenable(irq);
+2 -2
View File
@@ -463,7 +463,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable)
* REVISIT: Since this is a common signal, we will need to come up with some way * REVISIT: Since this is a common signal, we will need to come up with some way
* to inform both EHCI and OHCI drivers when this error occurs. * to inform both EHCI and OHCI drivers when this error occurs.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value:
@@ -493,7 +493,7 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler)
/* Configure the interrupt */ /* Configure the interrupt */
sam_pioirq(IRQ_USBBC_VBUS_OVERCURRENT); sam_pioirq(PIO_USBBC_VBUS_OVERCURRENT);
(void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler); (void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler);
sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT); sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT);
+25 -12
View File
@@ -91,10 +91,10 @@ static xcpt_t g_irquser1;
* Name: board_button_initialize * Name: board_button_initialize
* *
* Description: * Description:
* board_button_initialize() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, board_buttons() may be called to collect the current state of all * After that, board_buttons() may be called to collect the current state
* buttons or board_button_irq() may be called to register button interrupt * of all buttons or board_button_irq() may be called to register button
* handlers. * interrupt handlers.
* *
****************************************************************************/ ****************************************************************************/
@@ -107,10 +107,10 @@ void board_button_initialize(void)
* Name: board_buttons * Name: board_buttons
* *
* Description: * Description:
* After board_button_initialize() has been called, board_buttons() may be called to * After board_button_initialize() has been called, board_buttons() may be
* collect the state of all buttons. board_buttons() returns an 8-bit bit set * called to collect the state of all buttons. board_buttons() returns an
* with each bit associated with a button. See the BUTTON* definitions * 8-bit bit set with each bit associated with a button. See the BUTTON*
* above for the meaning of each bit in the returned value. * definitions above for the meaning of each bit in the returned value.
* *
****************************************************************************/ ****************************************************************************/
@@ -155,11 +155,24 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
oldhandler = g_irquser1; oldhandler = g_irquser1;
g_irquser1 = irqhandler; g_irquser1 = irqhandler;
/* Configure the interrupt */ /* Are we attaching or detaching? */
if (irqhandler != NULL)
{
/* Configure the interrupt */
sam_pioirq(PIO_USER1);
(void)irq_attach(IRQ_USER1, irqhandler);
sam_pioirqenable(IRQ_USER1);
}
else
{
/* Disable and detach the interrupt */
sam_pioirqdisable(IRQ_USER1);
(void)irq_detach(IRQ_USER1);
}
sam_pioirq(IRQ_USER1);
(void)irq_attach(IRQ_USER1, irqhandler);
sam_pioirqenable(IRQ_USER1);
irqrestore(flags); irqrestore(flags);
} }
+4 -1
View File
@@ -136,12 +136,14 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
irqstate_t flags; irqstate_t flags;
xcpt_t *handler; xcpt_t *handler;
xcpt_t oldhandler; xcpt_t oldhandler;
pio_pinset_t pinset;
int irq; int irq;
#ifdef CONFIG_SAMA5_EMACA #ifdef CONFIG_SAMA5_EMACA
if (intf == EMAC_INTF) if (intf == EMAC_INTF)
{ {
handler = &g_emac_handler; handler = &g_emac_handler;
pinset = PIO_INT_ETH1;
irq = IRQ_INT_ETH1; irq = IRQ_INT_ETH1;
} }
else else
@@ -150,6 +152,7 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
if (intf == GMAC_INTF) if (intf == GMAC_INTF)
{ {
handler = &g_gmac_handler; handler = &g_gmac_handler;
pinset = PIO_INT_ETH0;
irq = IRQ_INT_ETH0; irq = IRQ_INT_ETH0;
} }
else else
@@ -172,7 +175,7 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
/* Configure the interrupt */ /* Configure the interrupt */
sam_pioirq(irq); sam_pioirq(pinset);
(void)irq_attach(irq, irqhandler); (void)irq_attach(irq, irqhandler);
sam_pioirqenable(irq); sam_pioirqenable(irq);
+2 -2
View File
@@ -463,7 +463,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable)
* REVISIT: Since this is a common signal, we will need to come up with some way * REVISIT: Since this is a common signal, we will need to come up with some way
* to inform both EHCI and OHCI drivers when this error occurs. * to inform both EHCI and OHCI drivers when this error occurs.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value:
@@ -493,7 +493,7 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler)
/* Configure the interrupt */ /* Configure the interrupt */
sam_pioirq(IRQ_USBBC_VBUS_OVERCURRENT); sam_pioirq(PIO_USBBC_VBUS_OVERCURRENT);
(void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler); (void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler);
sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT); sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT);
+17 -4
View File
@@ -151,11 +151,24 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler)
oldhandler = g_irquser1; oldhandler = g_irquser1;
g_irquser1 = irqhandler; g_irquser1 = irqhandler;
/* Configure the interrupt */ /* Are we attaching or detaching? */
if (irqhandler != NULL)
{
/* Configure the interrupt */
sam_pioirq(PIO_BTN_USER);
(void)irq_attach(IRQ_BTN_USER, irqhandler);
sam_pioirqenable(IRQ_BTN_USER);
}
else
{
/* Disable and detach the interrupt */
sam_pioirqdisable(IRQ_BTN_USER);
(void)irq_detach(IRQ_BTN_USER);
}
sam_pioirq(IRQ_USER1);
(void)irq_attach(IRQ_USER1, irqhandler);
sam_pioirqenable(IRQ_USER1);
irqrestore(flags); irqrestore(flags);
} }
+4 -1
View File
@@ -105,12 +105,14 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
irqstate_t flags; irqstate_t flags;
xcpt_t *handler; xcpt_t *handler;
xcpt_t oldhandler; xcpt_t oldhandler;
pio_pinset_t pinset;
int irq; int irq;
#ifdef CONFIG_SAMA5_EMAC0 #ifdef CONFIG_SAMA5_EMAC0
if (intf == EMAC0_INTF) if (intf == EMAC0_INTF)
{ {
handler = &g_emac0_handler; handler = &g_emac0_handler;
pinset = PIO_INT_ETH0;
irq = IRQ_INT_ETH0; irq = IRQ_INT_ETH0;
} }
else else
@@ -119,6 +121,7 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
if (intf == EMAC1_INTF) if (intf == EMAC1_INTF)
{ {
handler = &g_emac1_handler; handler = &g_emac1_handler;
pinset = PIO_INT_ETH1;
irq = IRQ_INT_ETH1; irq = IRQ_INT_ETH1;
} }
else else
@@ -141,7 +144,7 @@ xcpt_t sam_phyirq(int intf, xcpt_t irqhandler)
/* Configure the interrupt */ /* Configure the interrupt */
sam_pioirq(irq); sam_pioirq(pinset);
(void)irq_attach(irq, irqhandler); (void)irq_attach(irq, irqhandler);
sam_pioirqenable(irq); sam_pioirqenable(irq);
+2 -2
View File
@@ -464,7 +464,7 @@ void sam_usbhost_vbusdrive(int rhport, bool enable)
* REVISIT: Since this is a common signal, we will need to come up with some way * REVISIT: Since this is a common signal, we will need to come up with some way
* to inform both EHCI and OHCI drivers when this error occurs. * to inform both EHCI and OHCI drivers when this error occurs.
* *
* Input paramter: * Input Parameters:
* handler - New over-current interrupt handler * handler - New over-current interrupt handler
* *
* Returned value: * Returned value:
@@ -494,7 +494,7 @@ xcpt_t sam_setup_overcurrent(xcpt_t handler)
/* Configure the interrupt */ /* Configure the interrupt */
sam_pioirq(IRQ_USBBC_VBUS_OVERCURRENT); sam_pioirq(PIO_USBBC_VBUS_OVERCURRENT);
(void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler); (void)irq_attach(IRQ_USBBC_VBUS_OVERCURRENT, handler);
sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT); sam_pioirqenable(IRQ_USBBC_VBUS_OVERCURRENT);
+1 -1
View File
@@ -256,7 +256,7 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
* Setup to receive an interrupt-level callback if an overcurrent condition is * Setup to receive an interrupt-level callback if an overcurrent condition is
* detected. * detected.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value:
+1 -1
View File
@@ -256,7 +256,7 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
* Setup to receive an interrupt-level callback if an overcurrent condition is * Setup to receive an interrupt-level callback if an overcurrent condition is
* detected. * detected.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value:
+1 -1
View File
@@ -256,7 +256,7 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
* Setup to receive an interrupt-level callback if an overcurrent condition is * Setup to receive an interrupt-level callback if an overcurrent condition is
* detected. * detected.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value:
+1 -1
View File
@@ -275,7 +275,7 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
* Setup to receive an interrupt-level callback if an overcurrent condition is * Setup to receive an interrupt-level callback if an overcurrent condition is
* detected. * detected.
* *
* Input paramter: * Input Parameter:
* handler - New overcurrent interrupt handler * handler - New overcurrent interrupt handler
* *
* Returned value: * Returned value: