Skip to content

Commit 851ec59

Browse files
Sean CrossLee Jones
authored andcommitted
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>
1 parent bdaf670 commit 851ec59

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎drivers/mfd/stmpe.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,12 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
11221122
if (pdata->id < 0)
11231123
pdata->id = -1;
11241124

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;
11261131

11271132
of_property_read_u32(np, "st,autosleep-timeout",
11281133
&pdata->autosleep_timeout);

0 commit comments

Comments
 (0)