Skip to content

Commit

Permalink
mfd: stmpe: Support gpio over irq under device tree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sean Cross authored and Lee Jones committed Sep 26, 2014
1 parent bdaf670 commit 851ec59
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/mfd/stmpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,12 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
if (pdata->id < 0)
pdata->id = -1;

pdata->irq_trigger = IRQF_TRIGGER_NONE;
pdata->irq_gpio = of_get_named_gpio_flags(np, "irq-gpio", 0,
&pdata->irq_trigger);
if (gpio_is_valid(pdata->irq_gpio))
pdata->irq_over_gpio = 1;
else
pdata->irq_trigger = IRQF_TRIGGER_NONE;

of_property_read_u32(np, "st,autosleep-timeout",
&pdata->autosleep_timeout);
Expand Down

0 comments on commit 851ec59

Please sign in to comment.