diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2019-02-20 09:43:45 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-02-20 09:43:45 +0100 |
commit | 2f7db3c70fdfb22480a1b0aa734664fc256532f2 (patch) | |
tree | 32ecdf860fda4b4eb7a3f024e36092e5bc72b86c /kernel/irq | |
parent | 11da905412833d9b369a6a09a401f87149d674dc (diff) | |
parent | 2a9e27408e12de455b9fcf66b5d0166f2129579e (diff) |
Merge tag 'gpio-v5.1-updates-for-linus-part-2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel
gpio: updates for v5.1 - part 2
- gpio-mockup updates improving the user-space testing interface and
adding line state tracking for correct edge interrupts
- interrupt simulator patch exposing the irq type configuration to
users
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/irq_sim.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index 98a20e1594ce..b992f88c5613 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -25,10 +25,22 @@ static void irq_sim_irqunmask(struct irq_data *data) irq_ctx->enabled = true; } +static int irq_sim_set_type(struct irq_data *data, unsigned int type) +{ + /* We only support rising and falling edge trigger types. */ + if (type & ~IRQ_TYPE_EDGE_BOTH) + return -EINVAL; + + irqd_set_trigger_type(data, type); + + return 0; +} + static struct irq_chip irq_sim_irqchip = { .name = "irq_sim", .irq_mask = irq_sim_irqmask, .irq_unmask = irq_sim_irqunmask, + .irq_set_type = irq_sim_set_type, }; static void irq_sim_handle_irq(struct irq_work *work) |