From: Andy Gross <andy.gross@ti.com>
To: devicetree-discuss@lists.ozlabs.org
Cc: Benoit Cousson <b-cousson@ti.com>,
linux-omap@vger.kernel.org,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Nishanth Menon <nm@ti.com>, Andy Gross <andy.gross@ti.com>
Subject: [PATCH v2 2/2] ARM: OMAP2+: Enable DT usage during dmm create
Date: Wed, 10 Apr 2013 15:50:43 -0500 [thread overview]
Message-ID: <1365627043-11846-3-git-send-email-andy.gross@ti.com> (raw)
In-Reply-To: <1365627043-11846-1-git-send-email-andy.gross@ti.com>
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 <andy.gross@ti.com>
---
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 <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/platform_data/omap_drm.h>
+#include <linux/of.h>
#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;
--
1.7.5.4
prev parent reply other threads:[~2013-04-10 20:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 20:50 [PATCH v2 0/2] ARM: dts: OMAP4+: Add dmm device bindings Andy Gross
2013-04-10 20:50 ` [PATCH v2 1/2] ARM: dts: OMAP4+: Add DMM bindings Andy Gross
2013-04-10 20:50 ` Andy Gross [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1365627043-11846-3-git-send-email-andy.gross@ti.com \
--to=andy.gross@ti.com \
--cc=b-cousson@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=santosh.shilimkar@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).