WM8904 interface enable method now returns the previous interrupt state

This commit is contained in:
Gregory Nutt 2014-08-04 14:52:59 -06:00
parent c68e42c437
commit b305f9186a
1 changed files with 4 additions and 2 deletions

View File

@ -128,6 +128,7 @@
#define WM8904_DETACH(s) ((s)->attach(s,NULL,NULL)) #define WM8904_DETACH(s) ((s)->attach(s,NULL,NULL))
#define WM8904_ENABLE(s) ((s)->enable(s,true)) #define WM8904_ENABLE(s) ((s)->enable(s,true))
#define WM8904_DISABLE(s) ((s)->enable(s,false)) #define WM8904_DISABLE(s) ((s)->enable(s,false))
#define WM8904_RESTORE(s,e) ((s)->enable(s,e))
/**************************************************************************** /****************************************************************************
* Public Types * Public Types
@ -171,12 +172,13 @@ struct wm8904_lower_s
* *
* attach - Attach or detach the WM8904 interrupt handler to the GPIO * attach - Attach or detach the WM8904 interrupt handler to the GPIO
* interrupt * interrupt
* enable - Enable or disable the GPIO interrupt * enable - Enable or disable the GPIO interrupt. Returns the
* previous interrupt state.
*/ */
CODE int (*attach)(FAR const struct wm8904_lower_s *lower, CODE int (*attach)(FAR const struct wm8904_lower_s *lower,
wm8904_handler_t isr, FAR void *arg); wm8904_handler_t isr, FAR void *arg);
CODE void (*enable)(FAR const struct wm8904_lower_s *lower, bool enable); CODE bool (*enable)(FAR const struct wm8904_lower_s *lower, bool enable);
}; };
/**************************************************************************** /****************************************************************************