From patchwork Fri Mar 8 17:27:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunter, Jon" X-Patchwork-Id: 2239621 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 99A1CDF215 for ; Fri, 8 Mar 2013 17:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759811Ab3CHR1w (ORCPT ); Fri, 8 Mar 2013 12:27:52 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:49621 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759468Ab3CHR1v (ORCPT ); Fri, 8 Mar 2013 12:27:51 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r28HRfXx017692; Fri, 8 Mar 2013 11:27:41 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r28HRfOS011215; Fri, 8 Mar 2013 11:27:41 -0600 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Fri, 8 Mar 2013 11:27:40 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r28HRe6w001827; Fri, 8 Mar 2013 11:27:40 -0600 Received: from localhost (h0-170.vpn.ti.com [172.24.0.170]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r28HReV15816; Fri, 8 Mar 2013 11:27:40 -0600 (CST) From: Jon Hunter To: Tony Lindgren , Benoit Cousson CC: device-tree , linux-omap , linux-arm , Jon Hunter Subject: [PATCH 1/9] ARM: OMAP2+: Prepare for device-tree PMU support Date: Fri, 8 Mar 2013 11:27:25 -0600 Message-ID: <1362763654-9660-2-git-send-email-jon-hunter@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362763654-9660-1-git-send-email-jon-hunter@ti.com> References: <1362763654-9660-1-git-send-email-jon-hunter@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org If device-tree is present, then do not create the PMU device from within the OMAP specific PMU code. This is required to allow device-tree to create the PMU device from the PMU device-tree node. PMU is not currently supported for OMAP4430 (due to a dependency on having a cross-trigger interface driver) and so ensure that this indicated on boot with or without device-tree. Signed-off-by: Jon Hunter Acked-by: Tony Lindgren --- arch/arm/mach-omap2/pmu.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c index 9debf82..9ace8ea 100644 --- a/arch/arm/mach-omap2/pmu.c +++ b/arch/arm/mach-omap2/pmu.c @@ -11,6 +11,8 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ +#include + #include #include "soc.h" @@ -63,6 +65,15 @@ static int __init omap_init_pmu(void) unsigned oh_num; char **oh_names; + /* XXX Remove this check when the CTI driver is available */ + if (cpu_is_omap443x()) { + pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n"); + return 0; + } + + if (of_have_populated_dt()) + return 0; + /* * To create an ARM-PMU device the following HWMODs * are required for the various OMAP2+ devices. @@ -75,9 +86,6 @@ static int __init omap_init_pmu(void) if (cpu_is_omap443x()) { oh_num = ARRAY_SIZE(omap4430_pmu_oh_names); oh_names = omap4430_pmu_oh_names; - /* XXX Remove the next two lines when CTI driver available */ - pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n"); - return 0; } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { oh_num = ARRAY_SIZE(omap3_pmu_oh_names); oh_names = omap3_pmu_oh_names;