Thread (18 messages) 18 messages, 7 authors, 2013-02-14

[PATCH] mfd: stmpe: Pull IRQ GPIO number from DT during DT-based probe

From: marex@denx.de (Marek Vasut)
Date: 2013-01-07 14:29:49
Also in: linux-input
Subsystem: multifunction devices (mfd), the rest · Maintainers: Lee Jones, Linus Torvalds

In case of a DT-based probe of the stmpe MFD driver, the irq_gpio was zero,
which resulted in the driver failing to probe.

Implement DT properties "irq-over-gpio" and "irq-gpios" which are already used
in "arch/arm/boot/dts/spear320-hmi.dts" to circumvent these problems. The new
behaviour is the expected one and copies the behavior of platform_data-based
probe.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Lee Jones <redacted>
Cc: Linus Walleij <redacted>
Cc: Samuel Ortiz <redacted>
Cc: Vipul Kumar Samar <redacted>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/mfd/stmpe.c |    5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 4b11202..fb9cd6f 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1018,6 +1018,11 @@ void stmpe_of_probe(struct stmpe_platform_data *pdata, struct device_node *np)
 	pdata->id = -1;
 	pdata->irq_trigger = IRQF_TRIGGER_NONE;
 
+	pdata->irq_over_gpio = of_get_property(np, "irq-over-gpio", NULL);
+	pdata->irq_gpio = of_get_named_gpio(np, "irq-gpios", 0);
+	if (!gpio_is_valid(pdata->irq_gpio))
+		pdata->irq_gpio = -1;
+
 	of_property_read_u32(np, "st,autosleep-timeout",
 			&pdata->autosleep_timeout);
 
-- 
1.7.10.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help