summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-02-20 09:43:45 +0100
committerLinus Walleij <linus.walleij@linaro.org>2019-02-20 09:43:45 +0100
commit2f7db3c70fdfb22480a1b0aa734664fc256532f2 (patch)
tree32ecdf860fda4b4eb7a3f024e36092e5bc72b86c /kernel
parentgpio: tegra: Fix offset of pinctrl calls (diff)
parentgpio: mockup: rework debugfs interface (diff)
downloadlinux-2f7db3c70fdfb22480a1b0aa734664fc256532f2.tar.xz
linux-2f7db3c70fdfb22480a1b0aa734664fc256532f2.zip
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')
-rw-r--r--kernel/irq/irq_sim.c12
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)