All of lore.kernel.org
 help / color / mirror / Atom feed
From: "G, Manjunath Kondaiah" <manjugk@ti.com>
To: linux-omap@vger.kernel.org
Cc: "G, Manjunath Kondaiah" <manjugk@ti.com>,
	linux-arm-kernel@lists.infradead.org,
	Kevin Hilman <khilman@deeprootsystems.com>,
	Tony Lindgren <tony@atomide.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Benoit Cousson <b-cousson@ti.com>
Subject: [PATCH v5 08/14] OMAP2+: DMA: hwmod: Device registration
Date: Wed, 24 Nov 2010 18:21:44 +0530	[thread overview]
Message-ID: <1290603110-14119-9-git-send-email-manjugk@ti.com> (raw)
In-Reply-To: <1290603110-14119-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: linux-arm-kernel@lists.infradead.org
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Benoit Cousson <b-cousson@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

  parent reply	other threads:[~2010-11-24 12:52 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 12:51 [PATCH v5 00/14] OMAP: DMA: hwmod and DMA as platform device G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 01/14] OMAP: DMA: Replace read/write macros with functions G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 02/14] OMAP: DMA: Introduce errata handling feature G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 03/14] OMAP2420: hwmod data: add system DMA G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 04/14] OMAP2430: " G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 05/14] OMAP3: " G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 06/14] OMAP4: " G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 07/14] OMAP1: DMA: Implement in platform device model G, Manjunath Kondaiah
2010-11-24 12:51 ` G, Manjunath Kondaiah [this message]
2010-11-24 12:51 ` [PATCH v5 09/14] OMAP: DMA: Convert DMA library into platform driver G, Manjunath Kondaiah
2010-12-02 18:44   ` Tony Lindgren
2010-12-02 18:44     ` Tony Lindgren
2010-12-02 18:46     ` Tony Lindgren
2010-12-02 18:46       ` Tony Lindgren
2010-12-02 18:49       ` Tony Lindgren
2010-12-02 18:49         ` Tony Lindgren
2010-12-02 20:04         ` G, Manjunath Kondaiah
2010-12-02 20:04           ` G, Manjunath Kondaiah
2010-12-02 20:52           ` Tony Lindgren
2010-12-02 20:52             ` Tony Lindgren
2010-12-03 16:43             ` G, Manjunath Kondaiah
2010-12-03 16:43               ` G, Manjunath Kondaiah
2010-12-03 23:24               ` Tony Lindgren
2010-12-03 23:24                 ` Tony Lindgren
2011-01-13 11:20               ` G, Manjunath Kondaiah
2011-01-13 11:20                 ` G, Manjunath Kondaiah
2011-01-19 19:04                 ` Tony Lindgren
2011-01-19 19:04                   ` Tony Lindgren
2010-11-24 12:51 ` [PATCH v5 10/14] OMAP: DMA: Use DMA device attributes G, Manjunath Kondaiah
2010-12-02 17:07   ` Tony Lindgren
2010-12-02 17:07     ` Tony Lindgren
2010-12-02 17:32     ` G, Manjunath Kondaiah
2010-12-02 17:32       ` G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 11/14] OMAP2+: DMA: descriptor autoloading feature G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 12/14] OMAP3630: DMA: Add work around for erratum i557 G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 13/14] OMAP2+: DMA: Replace sysconfig register access with API's G, Manjunath Kondaiah
2010-11-24 12:51 ` [PATCH v5 14/14] OMAP: PM: DMA: Enable runtime pm G, Manjunath Kondaiah
     [not found] ` <20101125112811.GA27574@GLPP-machine>
2010-12-01 19:04   ` [PATCH v5 00/14] OMAP: DMA: hwmod and DMA as platform device G, Manjunath Kondaiah
2010-12-01 19:04     ` G, Manjunath Kondaiah
2010-12-02  2:37     ` Tony Lindgren
2010-12-02  2:37       ` Tony Lindgren

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=1290603110-14119-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.