From patchwork Fri Aug 22 13:51:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 35827 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 711F320540 for ; Fri, 22 Aug 2014 13:54:18 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id b6sf35264451yha.1 for ; Fri, 22 Aug 2014 06:54:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=05SdybucwbBvXzfjAN41/GatZx5dRHJB5oFhynT5lRA=; b=DayNuqV7CMDqh3scP0wdFmjlYBR8Y/vVRf288Kusx3WlQe5Qae7MWoLGDEJhk9wN3s OrR5uwpk34QmkHPzqVjm9KYvHvL0hkChXNRry6zTtpAjlYCaKQMMfM+Oo1jFDvdQQXY1 sxbd/ihT0h2pd4LHlmTagKSx7+CjIkFrm+llZXk/YpckWRoEEKeIZXrp7YVCAN18OGZ9 qgH2ErOkyXMqtusU32tW5CbboH5wyat4L7nMYRPkgrHJQyfPkNtTxCbB6RJcNCBAVAYC h4g7RfF7k2q61KwMvX06OeMXscvh7XMgLy2tlM9jjYIGsfZLg5AHAOPLqWw+lCL0bzim ufyA== X-Gm-Message-State: ALoCoQnwwdDJI8LEdeMcCnOu9IUPAmPBn099zV/0RPG8t7fQm5O4xPL83QsSlGgy2AxisLJyKdYs X-Received: by 10.236.14.99 with SMTP id c63mr3440020yhc.40.1408715658296; Fri, 22 Aug 2014 06:54:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.103.177 with SMTP id y46ls465312qge.79.gmail; Fri, 22 Aug 2014 06:54:18 -0700 (PDT) X-Received: by 10.53.5.163 with SMTP id cn3mr212954vdd.3.1408715658160; Fri, 22 Aug 2014 06:54:18 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id jv1si12849564vdb.16.2014.08.22.06.54.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:54:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so12193646vcb.21 for ; Fri, 22 Aug 2014 06:54:18 -0700 (PDT) X-Received: by 10.220.77.65 with SMTP id f1mr221256vck.48.1408715657980; Fri, 22 Aug 2014 06:54:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp18772vcb; Fri, 22 Aug 2014 06:54:17 -0700 (PDT) X-Received: by 10.68.189.137 with SMTP id gi9mr6457293pbc.87.1408715656796; Fri, 22 Aug 2014 06:54:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id om6si40958813pdb.252.2014.08.22.06.54.15 for ; Fri, 22 Aug 2014 06:54:16 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756680AbaHVNyN (ORCPT + 21 others); Fri, 22 Aug 2014 09:54:13 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:33538 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756338AbaHVNyJ (ORCPT ); Fri, 22 Aug 2014 09:54:09 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s7MDrjIX001049; Fri, 22 Aug 2014 08:53:45 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7MDriGP008675; Fri, 22 Aug 2014 08:53:44 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 22 Aug 2014 08:53:44 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7MDriSP023746; Fri, 22 Aug 2014 08:53:44 -0500 From: Nishanth Menon To: Tony Lindgren , Tero Kristo , Paul Walmsley CC: Kevin Hilman , , , , Keerthy , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Santosh Shilimkar , Nishanth Menon Subject: [PATCH 3/6] ARM: OMAP4+: PRM: register interrupt information from DT Date: Fri, 22 Aug 2014 08:51:50 -0500 Message-ID: <1408715513-25851-4-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1408715513-25851-1-git-send-email-nm@ti.com> References: <1408715513-25851-1-git-send-email-nm@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nm@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Allow the PRM interrupt information to be picked up from device tree. the only exception is for OMAP4 which uses values pre-populated and allows compatibility with older dtb. Signed-off-by: Nishanth Menon --- arch/arm/mach-omap2/prm44xx.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index d4d745e..5a70c91 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "soc.h" @@ -699,11 +700,50 @@ int __init omap44xx_prm_init(void) return prm_register(&omap44xx_prm_ll_data); } +static struct of_device_id omap_prm_dt_match_table[] = { + { .compatible = "ti,omap4-prm" }, + { .compatible = "ti,omap5-prm" }, + { .compatible = "ti,dra7-prm" }, + { } +}; + static int omap44xx_prm_late_init(void) { + struct device_node *np; + int irq_num; + if (!(prm_features & PRM_HAS_IO_WAKEUP)) return 0; + /* OMAP4+ is DT only now */ + if (!of_have_populated_dt()) + return 0; + + np = of_find_matching_node(NULL, omap_prm_dt_match_table); + + if (!np) { + /* Default loaded up with OMAP4 values */ + if (!cpu_is_omap44xx()) + return 0; + } else { + irq_num = of_irq_get(np, 0); + /* + * Already have OMAP4 IRQ num. For all other platforms, we need + * IRQ numbers from DT + */ + if (irq_num < 0 && !cpu_is_omap44xx()) { + if (irq_num == -EPROBE_DEFER) + return irq_num; + + /* Have nothing to do */ + return 0; + } + + /* Once OMAP4 DT is filled as well */ + if (irq_num >= 0) + omap4_prcm_irq_setup.irq = irq_num; + } + omap44xx_prm_enable_io_wakeup(); return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);