From patchwork Wed Dec 7 13:59:52 2011 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: 5530 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 5557123E18 for ; Wed, 7 Dec 2011 13:58:40 +0000 (UTC) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by fiordland.canonical.com (Postfix) with ESMTP id 4C0A3A18522 for ; Wed, 7 Dec 2011 13:58:40 +0000 (UTC) Received: by mail-ee0-f52.google.com with SMTP id c14so573066eek.11 for ; Wed, 07 Dec 2011 05:58:40 -0800 (PST) Received: by 10.14.4.20 with SMTP id 20mr3751592eei.202.1323266320170; Wed, 07 Dec 2011 05:58:40 -0800 (PST) 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.205.129.2 with SMTP id hg2cs71251bkc; Wed, 7 Dec 2011 05:58:39 -0800 (PST) Received: by 10.68.27.66 with SMTP id r2mr3449984pbg.10.1323266317189; Wed, 07 Dec 2011 05:58:37 -0800 (PST) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id d9si3330417pbw.220.2011.12.07.05.58.36; Wed, 07 Dec 2011 05:58:37 -0800 (PST) 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 <0LVU005L96TGQW30@mailout3.samsung.com> for patches@linaro.org; Wed, 07 Dec 2011 22:58:35 +0900 (KST) X-AuditID: cbfee61b-b7b95ae00000198b-0e-4edf710b117b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id 5C.4B.06539.B017FDE4; Wed, 07 Dec 2011 22:58:35 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0LVU00BJT6TAY680@mmp2.samsung.com> for patches@linaro.org; Wed, 07 Dec 2011 22:58:35 +0900 (KST) From: Thomas Abraham To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, patches@linaro.org, Rob Herring , Grant Likely Subject: [PATCH 4/4] arm: exynos4: add device tree support for external wakeup interrupt controller Date: Wed, 07 Dec 2011 19:29:52 +0530 Message-id: <1323266392-28330-5-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1323266392-28330-4-git-send-email-thomas.abraham@linaro.org> References: <1323266392-28330-1-git-send-email-thomas.abraham@linaro.org> <1323266392-28330-2-git-send-email-thomas.abraham@linaro.org> <1323266392-28330-3-git-send-email-thomas.abraham@linaro.org> <1323266392-28330-4-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== Add device tree support for external wakeup source interrupt controller on Exynos4. Cc: Rob Herring Cc: Grant Likely Signed-off-by: Thomas Abraham --- .../bindings/arm/samsung/wakeup-eint.txt | 14 ++++++++++++++ arch/arm/mach-exynos/cpu.c | 5 ++++- arch/arm/mach-exynos/irq-eint.c | 9 +++++++++ 3 files changed, 27 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/samsung/wakeup-eint.txt diff --git a/Documentation/devicetree/bindings/arm/samsung/wakeup-eint.txt b/Documentation/devicetree/bindings/arm/samsung/wakeup-eint.txt new file mode 100644 index 0000000..0ca5782 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/samsung/wakeup-eint.txt @@ -0,0 +1,14 @@ +* Samsung Exynos4 External Wakeup Interrupt Source Controller + +Samsung Exynos4 processor supports 32 external wakeup interrupt sources. First +16 of these interrupts are directly connected to GIC and the rest 16 of the +interrupts are grouped together to deliver a single interrupt to GIC. + +Required properties: + +- compatible: should be "samsung,exynos4210-wakeup-eint". +- interrupt-controller: Identifies the node as an interrupt controller. +- interrupt-cells: Specifies the number of cells required to specify the + interrupt source number. The value of should be <2>. The first cell + represents the wakeup interrupt source number and the second cell + should be zero (currently unused). diff --git a/arch/arm/mach-exynos/cpu.c b/arch/arm/mach-exynos/cpu.c index 6d27c36..306c13c 100644 --- a/arch/arm/mach-exynos/cpu.c +++ b/arch/arm/mach-exynos/cpu.c @@ -245,6 +245,8 @@ static void exynos4_gic_irq_fix_base(struct irq_data *d) #ifdef CONFIG_OF static const struct of_device_id exynos4_dt_irq_match[] = { { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, + { .compatible = "samsung,exynos4210-wakeup-eint", + .data = exynos4_init_irq_eint, }, {}, }; #endif @@ -278,7 +280,8 @@ void __init exynos4_init_irq(void) * uses GIC instead of VIC. */ s5p_init_irq(NULL, 0); - exynos4_init_irq_eint(); + if (!of_have_populated_dt()) + exynos4_init_irq_eint(); } struct sysdev_class exynos4_sysclass = { diff --git a/arch/arm/mach-exynos/irq-eint.c b/arch/arm/mach-exynos/irq-eint.c index 771b156..e78fdfa 100644 --- a/arch/arm/mach-exynos/irq-eint.c +++ b/arch/arm/mach-exynos/irq-eint.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -210,6 +211,14 @@ int __init exynos4_init_irq_eint(void) } domain->nr_irq = EXYNOS4_EINT_NR; domain->ops = &irq_domain_simple_ops; +#ifdef CONFIG_OF + if (of_have_populated_dt()) { + domain->of_node = of_find_compatible_node(NULL, NULL, + "samsung,exynos4210-wakeup-eint"); + if (!domain->of_node) + pr_info("exynos4_init_irq_eint: of_node not found\n"); + } +#endif irq_domain_add(domain); irq_domain_for_each_irq(domain, hwirq, irq) {