linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: davidsin@ti.com (David Sin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 9/9] TILER-DMM: Device support for OMAP
Date: Mon,  6 Dec 2010 16:27:26 -0600	[thread overview]
Message-ID: <1291674446-10766-10-git-send-email-davidsin@ti.com> (raw)
In-Reply-To: <1291674446-10766-1-git-send-email-davidsin@ti.com>

Add DMM device support for OMAP utilizing the
OMAP HWMOD framework.

Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
---
 arch/arm/mach-omap2/Makefile       |    2 +
 arch/arm/mach-omap2/dmm-omap44xx.c |   80 ++++++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/dmm-omap44xx.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 60e51bc..fc682ea 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -194,3 +194,5 @@ obj-y					+= $(smc91x-m) $(smc91x-y)
 
 smsc911x-$(CONFIG_SMSC911X)		:= gpmc-smsc911x.o
 obj-y					+= $(smsc911x-m) $(smsc911x-y)
+
+obj-$(CONFIG_ARCH_OMAP4)		+= dmm-omap44xx.o
diff --git a/arch/arm/mach-omap2/dmm-omap44xx.c b/arch/arm/mach-omap2/dmm-omap44xx.c
new file mode 100644
index 0000000..a84490c
--- /dev/null
+++ b/arch/arm/mach-omap2/dmm-omap44xx.c
@@ -0,0 +1,80 @@
+/*
+ * DMM driver support functions for TI OMAP processors.
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <mach/dmm.h>
+#include <plat/omap_device.h>
+#include <plat/omap_hwmod.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+
+static struct dmm *plat_data;
+static int pdata;
+
+#ifdef CONFIG_ARCH_OMAP4
+static struct dmm omap4_plat_data[] = {
+	{
+		.oh_name = "dmm",
+	},
+};
+#define NUM_PDATA ARRAY_SIZE(omap4_plat_data)
+#else
+#define omap4_plat_data NULL
+#define NUM_PDATA 0
+#endif
+
+static struct omap_device_pm_latency omap_dmm_latency[] = {
+	[0] = {
+		.deactivate_func = omap_device_idle_hwmods,
+		.activate_func = omap_device_enable_hwmods,
+		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+	},
+};
+
+static s32 __init dmm_omap_init(void)
+{
+	struct omap_hwmod *oh = NULL;
+	struct omap_device *od = NULL;
+	struct omap_device_pm_latency *ohl = NULL;
+	int ohlc = 0, i = 0;
+
+	plat_data = omap4_plat_data;
+	pdata = NUM_PDATA;
+
+	for (i = 0; i < pdata; i++) {
+		struct dmm *data = &plat_data[i];
+
+		oh = omap_hwmod_lookup(data->oh_name);
+		if (!oh)
+			goto error;
+
+		data->base = oh->_mpu_rt_va;
+		ohl = omap_dmm_latency;
+		ohlc = ARRAY_SIZE(omap_dmm_latency);
+
+		od = omap_device_build(data->oh_name, i, oh, data,
+					 sizeof(*data), ohl, ohlc, false);
+		if (IS_ERR(od))
+			goto error;
+	}
+	return 0;
+error:
+	return -ENODEV;
+}
+
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("David Sin <davidsin@ti.com>");
+device_initcall(dmm_omap_init);
-- 
1.7.0.4

  parent reply	other threads:[~2010-12-06 22:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 22:27 [PATCH 0/9] TI DMM-TILER driver David Sin
2010-12-06 22:27 ` [PATCH 1/9] TILER-DMM: DMM-PAT driver for TI TILER David Sin
2010-12-06 22:27 ` [PATCH 2/9] TILER-DMM: Container manager interface and utility definitons David Sin
2010-12-06 22:27 ` [PATCH 3/9] TILER-DMM: Sample TCM implementation: Simple TILER Allocator (SiTA) David Sin
2010-12-06 22:27 ` [PATCH 4/9] TILER-DMM: TILER Memory Manager interface and implementation David Sin
2010-12-06 22:27 ` [PATCH 5/9] TILER-DMM: TILER interface file and documentation David Sin
2010-12-06 22:27 ` [PATCH 6/9] TILER-DMM: Geometry and view manipulation functions David Sin
2010-12-06 22:27 ` [PATCH 7/9] TILER-DMM: Main TILER driver implementation David Sin
2010-12-06 23:21   ` Tony Lindgren
2010-12-13 17:32     ` David Sin
2010-12-06 22:27 ` [PATCH 8/9] TILER-DMM: Linking TILER driver into the Linux kernel build David Sin
2010-12-06 22:27 ` David Sin [this message]
2010-12-16 13:34 ` [PATCH 0/9] TI DMM-TILER driver Arnd Bergmann
2010-12-16 17:25   ` David Sin
2010-12-16 17:37     ` David Sin
2010-12-16 17:43       ` Arnd Bergmann
2010-12-16 19:02         ` David Sin
2010-12-16 23:28           ` Dave Airlie
2010-12-22 14:33             ` David Sin

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=1291674446-10766-10-git-send-email-davidsin@ti.com \
    --to=davidsin@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).