From patchwork Wed Apr 10 20:50:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 2423291 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 06C14DF2E5 for ; Wed, 10 Apr 2013 20:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934717Ab3DJUvF (ORCPT ); Wed, 10 Apr 2013 16:51:05 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:37370 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755531Ab3DJUvE (ORCPT ); Wed, 10 Apr 2013 16:51:04 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r3AKoxpu015247; Wed, 10 Apr 2013 15:50:59 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r3AKoxvG004071; Wed, 10 Apr 2013 15:50:59 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Wed, 10 Apr 2013 15:50:59 -0500 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 r3AKoxBI003845; Wed, 10 Apr 2013 15:50:59 -0500 Received: from localhost (lta0273185-ubuntu1-128247075044.am.dhcp.ti.com [128.247.75.44]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r3AKoxV29888; Wed, 10 Apr 2013 15:50:59 -0500 (CDT) From: Andy Gross To: CC: Benoit Cousson , , Santosh Shilimkar , Nishanth Menon , Andy Gross Subject: [PATCH v2 2/2] ARM: OMAP2+: Enable DT usage during dmm create Date: Wed, 10 Apr 2013 15:50:43 -0500 Message-ID: <1365627043-11846-3-git-send-email-andy.gross@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1365627043-11846-1-git-send-email-andy.gross@ti.com> References: <1365627043-11846-1-git-send-email-andy.gross@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 DMM device tree information is present, use it for creating the device. Otherwise fall back to using the hwmod entry. Signed-off-by: Andy Gross --- arch/arm/mach-omap2/drm.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c index 59a4af7..e1e20ec 100644 --- a/arch/arm/mach-omap2/drm.c +++ b/arch/arm/mach-omap2/drm.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "soc.h" #include "omap_device.h" @@ -47,13 +48,17 @@ static int __init omap_init_drm(void) struct omap_hwmod *oh = NULL; struct platform_device *pdev; - /* lookup and populate the DMM information, if present - OMAP4+ */ - oh = omap_hwmod_lookup("dmm"); + if (!of_find_compatible_node(NULL, NULL, "ti,dmm")) { - if (oh) { - pdev = omap_device_build(oh->name, -1, oh, NULL, 0); - WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", - oh->name); + /* resort to hwmod lookup - LEGACY */ + /* lookup and populate the DMM information, OMAP4+ only */ + oh = omap_hwmod_lookup("dmm"); + + if (oh) { + pdev = omap_device_build(oh->name, -1, oh, NULL, 0); + WARN(IS_ERR(pdev), "Could not build device for %s\n", + oh->name); + } } platform_data.omaprev = GET_OMAP_TYPE;