Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: stmpe: Support gpio over irq under device tree

The stmpe_platform_data has a irq_over_gpio field, which allows the
system to read STMPE events whenever an IRQ occurs on a GPIO pin.
This patch adds the ability to configure this field and to use a GPIO
as an IRQ source for boards configuring the STMPE in device tree.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Sean Cross and committed by
Lee Jones
851ec596 bdaf6703

+6 -1
+6 -1
drivers/mfd/stmpe.c
··· 1122 1122 if (pdata->id < 0) 1123 1123 pdata->id = -1; 1124 1124 1125 - pdata->irq_trigger = IRQF_TRIGGER_NONE; 1125 + pdata->irq_gpio = of_get_named_gpio_flags(np, "irq-gpio", 0, 1126 + &pdata->irq_trigger); 1127 + if (gpio_is_valid(pdata->irq_gpio)) 1128 + pdata->irq_over_gpio = 1; 1129 + else 1130 + pdata->irq_trigger = IRQF_TRIGGER_NONE; 1126 1131 1127 1132 of_property_read_u32(np, "st,autosleep-timeout", 1128 1133 &pdata->autosleep_timeout);