irq_nextlevel: add API to query if an IRQ line is enabled
There is an API to query if any IRQ is enabled but there is none to query individual IRQ line. So add one. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
71281292fb
commit
d3e3552f65
|
@ -25,12 +25,15 @@ typedef void (*irq_next_level_func_t)(struct device *dev, unsigned int irq);
|
|||
typedef unsigned int (*irq_next_level_get_state_t)(struct device *dev);
|
||||
typedef void (*irq_next_level_priority_t)(struct device *dev,
|
||||
unsigned int irq, unsigned int prio, u32_t flags);
|
||||
typedef int (*irq_next_level_get_line_state_t)(struct device *dev,
|
||||
unsigned int irq);
|
||||
|
||||
struct irq_next_level_api {
|
||||
irq_next_level_func_t intr_enable;
|
||||
irq_next_level_func_t intr_disable;
|
||||
irq_next_level_get_state_t intr_get_state;
|
||||
irq_next_level_priority_t intr_set_priority;
|
||||
irq_next_level_get_line_state_t intr_get_line_state;
|
||||
};
|
||||
/**
|
||||
* @endcond
|
||||
|
@ -109,6 +112,24 @@ static inline void irq_set_priority_next_level(struct device *dev, u32_t irq,
|
|||
api->intr_set_priority(dev, irq, prio, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IRQ line enable state.
|
||||
*
|
||||
* Query if a particular IRQ line is enabled.
|
||||
*
|
||||
* @param dev Pointer to the device structure for the driver instance.
|
||||
* @param irq IRQ line to be queried.
|
||||
*
|
||||
* @return interrupt enable state, true or false
|
||||
*/
|
||||
static inline unsigned int irq_line_is_enabled_next_level(struct device *dev,
|
||||
unsigned int irq)
|
||||
{
|
||||
const struct irq_next_level_api *api = dev->driver_api;
|
||||
|
||||
return api->intr_get_line_state(dev, irq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue