diff options
author | 2021-02-23 11:33:13 +0100 | |
---|---|---|
committer | 2021-02-23 11:33:13 +0100 | |
commit | d6310078d9f8c416e85f641a631aecf58f9c97ff (patch) | |
tree | 58ed5d9818ada3e970d93438083731abd6293ba9 /kernel/irq/manage.c | |
parent | Merge branch 'for-5.12/doc' into for-linus (diff) | |
parent | HID: google: Get HID report on probe to confirm tablet switch state (diff) | |
download | wireguard-linux-d6310078d9f8c416e85f641a631aecf58f9c97ff.tar.xz wireguard-linux-d6310078d9f8c416e85f641a631aecf58f9c97ff.zip |
Merge branch 'for-5.12/google' into for-linus
- User experience improvements for hid-google from Nicolas Boichat
Diffstat (limited to '')
-rw-r--r-- | kernel/irq/manage.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index c826ba4141fe..dec3f73e8db9 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -2822,3 +2822,41 @@ out_unlock: return err; } EXPORT_SYMBOL_GPL(irq_set_irqchip_state); + +/** + * irq_has_action - Check whether an interrupt is requested + * @irq: The linux irq number + * + * Returns: A snapshot of the current state + */ +bool irq_has_action(unsigned int irq) +{ + bool res; + + rcu_read_lock(); + res = irq_desc_has_action(irq_to_desc(irq)); + rcu_read_unlock(); + return res; +} +EXPORT_SYMBOL_GPL(irq_has_action); + +/** + * irq_check_status_bit - Check whether bits in the irq descriptor status are set + * @irq: The linux irq number + * @bitmask: The bitmask to evaluate + * + * Returns: True if one of the bits in @bitmask is set + */ +bool irq_check_status_bit(unsigned int irq, unsigned int bitmask) +{ + struct irq_desc *desc; + bool res = false; + + rcu_read_lock(); + desc = irq_to_desc(irq); + if (desc) + res = !!(desc->status_use_accessors & bitmask); + rcu_read_unlock(); + return res; +} +EXPORT_SYMBOL_GPL(irq_check_status_bit); |