From patchwork Mon Aug 6 10:46:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 10509 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C58482402A for ; Mon, 6 Aug 2012 10:47:07 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 94A8DA18D28 for ; Mon, 6 Aug 2012 10:47:07 +0000 (UTC) Received: by mail-gh0-f180.google.com with SMTP id g10so558437ghb.11 for ; Mon, 06 Aug 2012 03:47:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=UXQZY5cWcoNKCrjBj/FGAu9HMmc//LZTEvDc7LqJxio=; b=PkWZZEObc3YinAbosVOrUA1iADohPxBE9RV933MBJxoBFXKcIGKU8gXShdKg8HtzkM v/XMDPWXXesRsu9NuLF4XUqeh+R6EC98DXPIc4i3Tf3yO3gYwR0XQFPbutEahh+1ojnx Jlto1vyDrPwdip6hxka4ByW3JWqRBIhx557a6vy4+UKGbwaTHUsXFM2kGUbO0PiF2AAH c6tGPnca1FmFm5GVSD8vvP4TRFix4YJtQvUJDj6fBA0onrNBtHk1LF1EWWjNJTWXsJuU qSfEMSCWQnRWXt6HCgYGS/9mk3d7/PhAEMGyJvard2VShLjE6xxd9t7GQmjrDFPH409v N6DQ== Received: by 10.50.94.166 with SMTP id dd6mr4901392igb.11.1344250027075; Mon, 06 Aug 2012 03:47:07 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.87.40 with SMTP id u8csp433409igz; Mon, 6 Aug 2012 03:47:06 -0700 (PDT) Received: by 10.180.19.169 with SMTP id g9mr17366319wie.9.1344250025730; Mon, 06 Aug 2012 03:47:05 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id u10si16661650wix.1.2012.08.06.03.47.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 03:47:05 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by weyu7 with SMTP id u7so2363888wey.37 for ; Mon, 06 Aug 2012 03:47:05 -0700 (PDT) Received: by 10.216.144.234 with SMTP id n84mr5366896wej.78.1344250025168; Mon, 06 Aug 2012 03:47:05 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id t7sm22043908wix.6.2012.08.06.03.47.03 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 03:47:04 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: STEricsson_nomadik_linux@list.st.com, linus.walleij@stericsson.com, arnd@arndb.de, dmitry.torokhov@gmail.com, sameo@linux.intel.com, Lee Jones Subject: [PATCH 4/6] mfd: Use interrupt-parent as IRQ controller if specified in DT Date: Mon, 6 Aug 2012 11:46:40 +0100 Message-Id: <1344250002-6011-5-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344250002-6011-1-git-send-email-lee.jones@linaro.org> References: <1344250002-6011-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlgOR8Mp4IOKWDz7jTm172/p0j/vcIfeinKmrJ1eYyqtNGBK17NSR5wGQOhO+rOJaqCGWSK Without this patch the default behaviour is to climb the Device Tree and use the first encountered interrupt controller. This does not take into account if a device node has specified to use a particular IRQ controller using the interrupt-parent property. This patch ensures that property is adhered to. Signed-off-by: Lee Jones --- drivers/mfd/mfd-core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 0c3a01c..f10f27b 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -20,6 +20,7 @@ #include #include #include +#include int mfd_cell_enable(struct platform_device *pdev) { @@ -78,7 +79,7 @@ static int mfd_add_device(struct device *parent, int id, { struct resource *res; struct platform_device *pdev; - struct device_node *np = NULL; + struct device_node *np, *parent_node = NULL; struct irq_domain *domain = NULL; int ret = -ENOMEM; int r; @@ -97,7 +98,12 @@ static int mfd_add_device(struct device *parent, int id, for_each_child_of_node(parent->of_node, np) { if (of_device_is_compatible(np, cell->of_compatible)) { pdev->dev.of_node = np; - domain = irq_find_host(parent->of_node); +#ifdef CONFIG_OF + parent_node = of_irq_find_parent(np); +#endif + if (!parent_node) + parent_node = parent->of_node; + domain = irq_find_host(parent_node); break; } }