From: "G, Manjunath Kondaiah" <manjugk@ti.com>
To: linux-omap@vger.kernel.org, tony@atomide.com
Cc: linux-arm-kernel@lists.infradead.org, "G,
Manjunath Kondaiah" <manjugk@ti.com>,
Benoit Cousson <b-cousson@ti.com>,
Kevin Hilman <khilman@deeprootsystems.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>
Subject: [PATCH v1 8/9] OMAP2+: DMA: hwmod: Device registration
Date: Sat, 4 Dec 2010 09:14:05 +0530 [thread overview]
Message-ID: <1291434246-30716-9-git-send-email-manjugk@ti.com> (raw)
In-Reply-To: <1291434246-30716-1-git-send-email-manjugk@ti.com>
Prepare OMAP2+ DMA to use hwmod infrastructure so that DMA can register
as platform device.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
arch/arm/mach-omap2/dma.c | 74 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 74 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/dma.c
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
new file mode 100644
index 0000000..e2c897a
--- /dev/null
+++ b/arch/arm/mach-omap2/dma.c
@@ -0,0 +1,74 @@
+/*
+ * OMAP2+ DMA driver
+ *
+ * Copyright (C) 2003 - 2008 Nokia Corporation
+ * Author: Juha Yrjölä <juha.yrjola@nokia.com>
+ * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
+ * Graphics DMA and LCD DMA graphics tranformations
+ * by Imre Deak <imre.deak@nokia.com>
+ * OMAP2/3 support Copyright (C) 2004-2007 Texas Instruments, Inc.
+ * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
+ *
+ * Copyright (C) 2009 Texas Instruments
+ * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ * Converted DMA library into platform driver
+ * - G, Manjunath Kondaiah <manjugk@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/device.h>
+
+#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
+#include <plat/dma.h>
+
+static struct omap_device_pm_latency omap2_dma_latency[] = {
+ {
+ .deactivate_func = omap_device_idle_hwmods,
+ .activate_func = omap_device_enable_hwmods,
+ .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+ },
+};
+
+/* One time initializations */
+static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
+{
+ struct omap_device *od;
+ struct omap_system_dma_plat_info *p;
+ char *name = "omap_dma_system";
+
+ p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
+ if (!p) {
+ pr_err("%s: Unable to allocate pdata for %s:%s\n",
+ __func__, name, oh->name);
+ return -ENOMEM;
+ }
+
+ od = omap_device_build(name, 0, oh, p, sizeof(*p),
+ omap2_dma_latency, ARRAY_SIZE(omap2_dma_latency), 0);
+ kfree(p);
+ if (IS_ERR(od)) {
+ pr_err("%s: Cant build omap_device for %s:%s.\n",
+ __func__, name, oh->name);
+ return IS_ERR(od);
+ }
+
+ return 0;
+}
+
+static int __init omap2_system_dma_init(void)
+{
+ return (omap_hwmod_for_each_by_class("dma",
+ omap2_system_dma_init_dev, NULL));
+}
+arch_initcall(omap2_system_dma_init);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-12-04 3:44 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-04 3:43 [PATCH v1 0/9] OMAP: DMA: hwmod and DMA as platform device G, Manjunath Kondaiah
2010-12-04 3:43 ` [PATCH v1 1/9] OMAP: DMA: Replace read/write macros with functions G, Manjunath Kondaiah
2010-12-04 3:43 ` [PATCH v1 2/9] OMAP: DMA: Introduce errata handling feature G, Manjunath Kondaiah
2010-12-04 3:44 ` [PATCH v1 3/9] OMAP2420: hwmod data: add system DMA G, Manjunath Kondaiah
2010-12-15 2:25 ` Paul Walmsley
2010-12-15 11:09 ` G, Manjunath Kondaiah
2010-12-15 12:15 ` [PATCH v1 3/9] OMAP2420: hwmod data: add system DMA] G, Manjunath Kondaiah
2010-12-15 15:39 ` Paul Walmsley
2010-12-04 3:44 ` [PATCH v1 4/9] OMAP2430: hwmod data: add system DMA G, Manjunath Kondaiah
2010-12-15 2:27 ` Paul Walmsley
2010-12-15 10:59 ` G, Manjunath Kondaiah
2010-12-15 15:14 ` Paul Walmsley
2010-12-15 15:53 ` G, Manjunath Kondaiah
2010-12-04 3:44 ` [PATCH v1 5/9] OMAP3: " G, Manjunath Kondaiah
2010-12-04 3:44 ` [PATCH v1 6/9] OMAP4: " G, Manjunath Kondaiah
2010-12-04 3:44 ` [PATCH v1 7/9] OMAP1: DMA: Implement in platform device model G, Manjunath Kondaiah
2010-12-15 0:40 ` Kevin Hilman
2010-12-15 0:55 ` Kevin Hilman
2010-12-15 1:04 ` Tony Lindgren
2010-12-15 2:01 ` G, Manjunath Kondaiah
2010-12-15 2:44 ` Tony Lindgren
2010-12-04 3:44 ` G, Manjunath Kondaiah [this message]
2010-12-04 3:44 ` [PATCH v1 9/9] OMAP: DMA: Convert DMA library into platform driver G, Manjunath Kondaiah
2010-12-07 11:04 ` [PATCH v1 0/9] OMAP: DMA: hwmod and DMA as platform device G, Manjunath Kondaiah
2010-12-14 23:19 ` Tony Lindgren
2010-12-15 0:18 ` Kevin Hilman
2010-12-15 1:37 ` Kevin Hilman
2010-12-15 1:55 ` Tony Lindgren
2010-12-15 2:02 ` Kevin Hilman
2010-12-15 2:08 ` Tony Lindgren
2010-12-15 1:59 ` G, Manjunath Kondaiah
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=1291434246-30716-9-git-send-email-manjugk@ti.com \
--to=manjugk@ti.com \
--cc=b-cousson@ti.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.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