From patchwork Sat Mar 24 09:41:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 7442 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 DCE0D23E0C for ; Sat, 24 Mar 2012 09:36:37 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 9F4A2A18691 for ; Sat, 24 Mar 2012 09:36:37 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so7727536iag.11 for ; Sat, 24 Mar 2012 02:36: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:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=7CCb5S++VsSSa8HD9duiX0wQLowNv6GQnh+T+v186Ys=; b=jKaciJvZXSRRDlBseIejQ9kwqnnyZeD+7Zj8RjTSTtkcSSVXmL9dxy0VCFOjVZFulO QaiY7VSmK8P+DF142RAGbOPPHDT0WnolG1/Q8nAbwC9jyk1t2YJoyEpxvml/YdtRXFQh f0UpeH7pQTOVVwPYTPMT9PUvUnCZdqgIASc8DeFA7ll9PH4+lxKAwPkE+kKae0jMzLvU Ve7UGQXBjZigFrTQjU6t4/nontmySnHLyU1TAuNgbPIXAnWBU7EVcGapX3yWa4xlhzth EXO8eh8Er7zlU/iLoWiXo0WqmJwTtcXEH8RMWb7hi436z998GphDWevt0j8b2heWaBjA Gj2Q== Received: by 10.50.183.163 with SMTP id en3mr1121572igc.12.1332581797362; Sat, 24 Mar 2012 02:36: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.231.203.79 with SMTP id fh15csp43515ibb; Sat, 24 Mar 2012 02:36:37 -0700 (PDT) Received: by 10.68.74.197 with SMTP id w5mr36105279pbv.129.1332581796648; Sat, 24 Mar 2012 02:36:36 -0700 (PDT) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id g9si12008182pbd.101.2012.03.24.02.36.36; Sat, 24 Mar 2012 02:36:36 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.33; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm2.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0M1D006OVUOYDWE0@mailout3.samsung.com> for patches@linaro.org; Sat, 24 Mar 2012 18:36:34 +0900 (KST) X-AuditID: cbfee61b-b7baeae000004fa7-bf-4f6d95a2250d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id 38.79.20391.2A59D6F4; Sat, 24 Mar 2012 18:36:34 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0M1D00D9XUORGL60@mmp1.samsung.com> for patches@linaro.org; Sat, 24 Mar 2012 18:36:34 +0900 (KST) From: Thomas Abraham To: linux-samsung-soc@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH v4 1/4] ARM: Exynos: Simplify the wakeup interrupt setup code Date: Sat, 24 Mar 2012 15:11:12 +0530 Message-id: <1332582075-16204-2-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1332582075-16204-1-git-send-email-thomas.abraham@linaro.org> References: <1332582075-16204-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No X-Gm-Message-State: ALoCoQmSeo88yJT+kHNdNTvzE3z8TX3zeJKlYQRnPxyIK8VZ5MH0Wj2z20C+UW0iWPrqRaICytgE Simplify the wakeup interrupt setup code in order to add irq domain and device tree support. Cc: Kukjin Kim Signed-off-by: Thomas Abraham --- arch/arm/mach-exynos/common.c | 32 +++++++++++--------------------- 1 files changed, 11 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 36b5837..3768efa 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -995,16 +995,14 @@ static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc) static int __init exynos_init_irq_eint(void) { - int irq; + int irq, *src_int; + unsigned int paddr; - if (soc_is_exynos5250()) - exynos_eint_base = ioremap(EXYNOS5_PA_GPIO1, SZ_4K); - else - exynos_eint_base = ioremap(EXYNOS4_PA_GPIO2, SZ_4K); - - if (exynos_eint_base == NULL) { + paddr = soc_is_exynos5250() ? EXYNOS5_PA_GPIO1 : EXYNOS4_PA_GPIO2; + exynos_eint_base = ioremap(paddr, SZ_4K); + if (!exynos_eint_base) { pr_err("unable to ioremap for EINT base address\n"); - return -ENOMEM; + return -ENXIO; } for (irq = 0 ; irq <= 31 ; irq++) { @@ -1015,20 +1013,12 @@ static int __init exynos_init_irq_eint(void) irq_set_chained_handler(EXYNOS_IRQ_EINT16_31, exynos_irq_demux_eint16_31); - for (irq = 0 ; irq <= 15 ; irq++) { + for (irq = 0 ; irq <= 15; irq++) { eint0_15_data[irq] = IRQ_EINT(irq); - - if (soc_is_exynos5250()) { - irq_set_handler_data(exynos5_eint0_15_src_int[irq], - &eint0_15_data[irq]); - irq_set_chained_handler(exynos5_eint0_15_src_int[irq], - exynos_irq_eint0_15); - } else { - irq_set_handler_data(exynos4_eint0_15_src_int[irq], - &eint0_15_data[irq]); - irq_set_chained_handler(exynos4_eint0_15_src_int[irq], - exynos_irq_eint0_15); - } + src_int = soc_is_exynos5250() ? exynos5_eint0_15_src_int : + exynos4_eint0_15_src_int; + irq_set_handler_data(src_int[irq], &eint0_15_data[irq]); + irq_set_chained_handler(src_int[irq], exynos_irq_eint0_15); } return 0;