Merged in masayuki2009/nuttx.nuttx/change_cxd56_gpioint_config (pull request #901)
change cxd56 gpioint config * arch/arm/src/cxd56xx: Change cxd56_gpioint_config to handle argument Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com> * configs/spresense: Apply API change of cxd56_gpioint_config() Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com> Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
parent
5179fa9a64
commit
ae2506619f
@ -404,6 +404,7 @@ static int gpioint_handler(int irq, FAR void *context, FAR void *arg)
|
||||
* pin - Pin number defined in cxd56_pinconfig.h
|
||||
* gpiocfg - GPIO Interrupt Polarity and Noise Filter Configuration Value
|
||||
* isr - Interrupt handler. If isr is NULL, then free an allocated handler.
|
||||
* arg - Argument for the interrupt handler
|
||||
*
|
||||
* Returned Value:
|
||||
* IRQ number on success; a negated errno value on failure.
|
||||
@ -413,7 +414,8 @@ static int gpioint_handler(int irq, FAR void *context, FAR void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr)
|
||||
int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr,
|
||||
FAR void *arg)
|
||||
{
|
||||
int slot;
|
||||
int irq;
|
||||
@ -474,12 +476,12 @@ int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr)
|
||||
|
||||
if ((gpiocfg & GPIOINT_TOGGLE_MODE_MASK) || GPIOINT_IS_EDGE(gpiocfg))
|
||||
{
|
||||
irq_attach(irq, gpioint_handler, (void *)pin); /* call intermediate handler */
|
||||
irq_attach(irq, gpioint_handler, arg); /* call intermediate handler */
|
||||
g_isr[slot] = isr;
|
||||
}
|
||||
else
|
||||
{
|
||||
irq_attach(irq, isr, (void *)pin); /* call user handler directly */
|
||||
irq_attach(irq, isr, arg); /* call user handler directly */
|
||||
g_isr[slot] = NULL;
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,7 @@ extern "C"
|
||||
* pin - Pin number defined in cxd56_pinconfig.h
|
||||
* gpiocfg - GPIO Interrupt Polarity and Noise Filter Configuration Value
|
||||
* isr - Interrupt handler
|
||||
* arg - Argument for the interrupt handler
|
||||
*
|
||||
* Returned Value:
|
||||
* IRQ number on success; a negated errno value on failure.
|
||||
@ -144,7 +145,8 @@ extern "C"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr);
|
||||
int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr,
|
||||
FAR void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cxd56_gpioint_irq
|
||||
|
@ -312,7 +312,8 @@ static int board_sdcard_detect_int(int irq, FAR void *context, FAR void *arg)
|
||||
inserted ?
|
||||
GPIOINT_PSEUDO_EDGE_RISE :
|
||||
GPIOINT_PSEUDO_EDGE_FALL,
|
||||
board_sdcard_detect_int);
|
||||
board_sdcard_detect_int,
|
||||
NULL);
|
||||
}
|
||||
|
||||
return OK;
|
||||
@ -357,7 +358,8 @@ int board_sdcard_initialize(void)
|
||||
cxd56_pin_config(PINCONF_SDIO_CD_GPIO);
|
||||
ret = cxd56_gpioint_config(PIN_SDIO_CD,
|
||||
GPIOINT_PSEUDO_EDGE_FALL,
|
||||
board_sdcard_detect_int);
|
||||
board_sdcard_detect_int,
|
||||
NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Failed to configure GPIO int. \n");
|
||||
|
Loading…
Reference in New Issue
Block a user