From patchwork Thu Oct 18 17:19:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12350 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 3E89A241AD for ; Thu, 18 Oct 2012 17:19:33 +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 CBB76A1834C for ; Thu, 18 Oct 2012 17:19:32 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so13636175iej.11 for ; Thu, 18 Oct 2012 10:19:32 -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=S3BWikIdeJjRpydaZL7MSmL2haL+Udtht3c2jp9dxj4=; b=HLHaXmM4NDE5cFBEQSAK79sgprajNSf6gKttwtmd3mBDZL5WVobzqqoqDMzjhSLTG/ 6vKbBbSk+JPO3YZIYH1U0woq25Feiu2rTIWKXNI4pIBXHt9i3CsbVvrxg9hWkGiztgMW 2/OdMVRCnJi3A9PABd88NtFWvnRcVmsLpQ+9R1Qo9Pd6QfNOYjVOWLvwHntsLUIoCHMZ /ufaBDty2/FDhHBoPvv77FLx0oGvox7cP4XtTqsjwb31XGYSwPu4nRbSLU4uASoVhL5h pbfIcjMzIVnyvCBuXRDPaDW/oTjO5GzP12v5lysvNNV8LGnmH7GxHS8g1/eNXO4qiQ68 LfxQ== Received: by 10.50.161.169 with SMTP id xt9mr5557404igb.62.1350580772172; Thu, 18 Oct 2012 10:19:32 -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 n20csp1109724igt; Thu, 18 Oct 2012 10:19:31 -0700 (PDT) Received: by 10.14.221.194 with SMTP id r42mr19221659eep.25.1350580770814; Thu, 18 Oct 2012 10:19:30 -0700 (PDT) Received: from eu1sys200aog101.obsmtp.com (eu1sys200aog101.obsmtp.com [207.126.144.111]) by mx.google.com with SMTP id l45si19852635eep.3.2012.10.18.10.19.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Oct 2012 10:19:30 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.111 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.111; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.111 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 eu1sys200aob101.postini.com ([207.126.147.11]) with SMTP ID DSNKUIA6HZy6Q9E15yuHO65I2YNZPpVpERLU@postini.com; Thu, 18 Oct 2012 17:19:30 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 73F31D5; Thu, 18 Oct 2012 17:19:18 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3F7A44D68; Thu, 18 Oct 2012 17:19:18 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id D3D5124C07D; Thu, 18 Oct 2012 19:19:08 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 18 Oct 2012 19:19:17 +0200 From: Linus Walleij To: , Cc: Anmar Oueja , Linus Walleij , Lee Jones , Samuel Ortiz Subject: [PATCH 6/8] mfd/ab8500-core: use irq_domain_add_simple() Date: Thu, 18 Oct 2012 19:19:15 +0200 Message-ID: <1350580755-8516-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: ALoCoQmmtxQXN3qlZljzoc2npp9QDY8g8eh1HKE0VZ6nrl2nwISQgQbAzO1ceW67r5zUrRwVE7xk 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/ab8500-core.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 1667c77..547fff4 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -565,15 +565,10 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np) else num_irqs = AB8500_NR_IRQS; - if (ab8500->irq_base) { - ab8500->domain = irq_domain_add_legacy( - NULL, num_irqs, ab8500->irq_base, - 0, &ab8500_irq_ops, ab8500); - } - else { - ab8500->domain = irq_domain_add_linear( - np, num_irqs, &ab8500_irq_ops, ab8500); - } + /* If ->irq_base is zero this will give a linear mapping */ + ab8500->domain = irq_domain_add_simple(NULL, + num_irqs, ab8500->irq_base, + &ab8500_irq_ops, ab8500); if (!ab8500->domain) { dev_err(ab8500->dev, "Failed to create irqdomain\n");