From patchwork Thu Oct 18 17:19:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12353 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 CCCA8241AD for ; Thu, 18 Oct 2012 17:19:37 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7FEE3A1834C for ; Thu, 18 Oct 2012 17:19:37 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so13636185iej.11 for ; Thu, 18 Oct 2012 10:19:37 -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:mime-version:content-type :x-gm-message-state; bh=pWX8lqagq/zqXUKJb6kSonxc7LwNh0i8ILhFZ27Exho=; b=XYaRBABZ9o6XJka1dM1356hMK+xTHQddWmlf4R4WE2FhB7D87MkyowXSfHteIICtx+ RnwBI6sebD/i5uQKMmqQHTMZVUuzJl30ikyBTDfxNZVdSB4zC0AuqIHVu0kjNX5+Bd6M kVjwAyu/j3V+kKsXbIYkcStL0LbN35Vv9ufbNlyoZFZUqF6vZJOoYX6iYPOiBpbh49g8 2znSc0DldXzG9Zs1mOrTPyHWLzeFQRNKLaBRpKxyIGoK9BqgWMQiFcFDP1/q7dUVMuUf 6O8ZwXp2Vz5nzX3y5/HFxKAf7jh2xB/fbNsGzZCczHIFRtpqKx4Np/wlVs2Ia0zNWiaT agYw== Received: by 10.50.100.137 with SMTP id ey9mr5627067igb.57.1350580777284; Thu, 18 Oct 2012 10:19:37 -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.67.148 with SMTP id n20csp1109751igt; Thu, 18 Oct 2012 10:19:36 -0700 (PDT) Received: by 10.14.207.5 with SMTP id m5mr33077227eeo.22.1350580775866; Thu, 18 Oct 2012 10:19:35 -0700 (PDT) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com [207.126.144.147]) by mx.google.com with SMTP id n49si3718201eeo.97.2012.10.18.10.19.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Oct 2012 10:19:35 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.147; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKUIA6H+YM6G9KsSOXd/gDpE1827+C91qz@postini.com; Thu, 18 Oct 2012 17:19:35 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5B97BF2; Thu, 18 Oct 2012 17:19:26 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D68044D66; Thu, 18 Oct 2012 17:19:25 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 73C8B24C07D; Thu, 18 Oct 2012 19:19:16 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 18 Oct 2012 19:19:24 +0200 From: Linus Walleij To: , Cc: Anmar Oueja , Linus Walleij , Lee Jones , Samuel Ortiz Subject: [PATCH 7/8] mfd/db8500-prcmu: use the irq_domain_add_simple() Date: Thu, 18 Oct 2012 19:19:22 +0200 Message-ID: <1350580762-8551-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQn50ah58D+g64JDhwbEcFZscqAWCXguTpv02FplRQ9fJK01kSHfGZPoSJOukcsF8xQxOcSk From: Linus Walleij To be able to use SPARSE_IRQ while yet not using device tree, we need to use irq_domain_add_simple() that will allocate descriptors for the IRQs in the non-DT case, and fall back to using the linear irqdomain in the DT case. Cc: Lee Jones Cc: Samuel Ortiz Signed-off-by: Linus Walleij --- Sam, requesting you ACK on this patch so we can merge them all together. Lee, requesting your testing with Device Tree to see that this actually can fly as I wanted it. --- drivers/mfd/db8500-prcmu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 00b8b0f..cea29ba 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -2697,9 +2697,15 @@ static struct irq_domain_ops db8500_irq_ops = { static int db8500_irq_init(struct device_node *np) { - db8500_irq_domain = irq_domain_add_legacy( - np, NUM_PRCMU_WAKEUPS, IRQ_PRCMU_BASE, - 0, &db8500_irq_ops, NULL); + int irq_base = -1; + + /* In the device tree case, just take some IRQs */ + if (!np) + irq_base = IRQ_PRCMU_BASE; + + db8500_irq_domain = irq_domain_add_simple( + np, NUM_PRCMU_WAKEUPS, irq_base, + &db8500_irq_ops, NULL); if (!db8500_irq_domain) { pr_err("Failed to create irqdomain\n");