From patchwork Mon Jan 7 14:29:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1941191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 85C953FC5A for ; Mon, 7 Jan 2013 14:33:47 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TsDiK-0003mN-4A; Mon, 07 Jan 2013 14:30:09 +0000 Received: from mail-out.m-online.net ([2001:a60:0:28:0:1:25:1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TsDi9-0003h9-Sw for linux-arm-kernel@lists.infradead.org; Mon, 07 Jan 2013 14:30:00 +0000 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3YfzWz5GYKz3hhck; Mon, 7 Jan 2013 15:29:51 +0100 (CET) X-Auth-Info: Ehz8ji/ukkR+CEx3QSFYZni25Fe1BxjTnygPmRdSLX4= Received: from mashiro.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3YfzWz2SLvzbbtp; Mon, 7 Jan 2013 15:29:51 +0100 (CET) From: Marek Vasut To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] mfd: stmpe: Pull IRQ GPIO number from DT during DT-based probe Date: Mon, 7 Jan 2013 15:29:49 +0100 Message-Id: <1357568989-16237-1-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130107_092959_936517_4450FE3A X-CRM114-Status: UNSURE ( 9.52 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Marek Vasut , Vipul Kumar Samar , Samuel Ortiz , Viresh Kumar , Linus Walleij , linux-input@vger.kernel.org, Lee Jones X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Cc: Lee Jones Cc: Linus Walleij Cc: Samuel Ortiz Cc: Vipul Kumar Samar Cc: Viresh Kumar --- 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);