public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: David Lambert <dlambert@ti.com>
To: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org
Cc: Tony Lindgren <tony@atomide.com>, Paul Walmsley <paul@pwsan.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	David Lambert <dlambert@ti.com>
Subject: [PATCH v3 3/4] OMAP4: DMIC: initializes the DMIC driver
Date: Tue, 25 Jan 2011 16:01:01 -0600	[thread overview]
Message-ID: <1295992862-6154-4-git-send-email-dlambert@ti.com> (raw)
In-Reply-To: <1295992862-6154-1-git-send-email-dlambert@ti.com>

This code is used to read the HWMOD database and initialize
the DMIC driver.

Signed-off-by: David Lambert <dlambert@ti.com>
---
 arch/arm/plat-omap/devices.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index fc81912..b347f75 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -72,6 +72,40 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
 
 /*-------------------------------------------------------------------------*/
 
+#if defined(CONFIG_SND_OMAP_SOC_DMIC) || \
+	defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE)
+
+static struct omap_device_pm_latency omap_dmic_latency[] = {
+	{
+		.deactivate_func = omap_device_idle_hwmods,
+		.activate_func = omap_device_enable_hwmods,
+		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+	},
+};
+
+static void omap_init_dmic(void)
+{
+	struct omap_hwmod *oh;
+	struct omap_device *od;
+
+	oh = omap_hwmod_lookup("omap-dmic");
+	if (!oh) {
+		printk(KERN_ERR "Could not look up dmic hw_mod\n");
+		return;
+	}
+
+	od = omap_device_build("omap-dmic-dai", -1, oh, NULL, 0,
+				omap_dmic_latency,
+				ARRAY_SIZE(omap_dmic_latency), 0);
+	if (IS_ERR(od))
+		printk(KERN_ERR "Could not build omap_device for omap-dmic-dai\n");
+}
+#else
+static inline void omap_init_dmic(void) {}
+#endif
+
+/*-------------------------------------------------------------------------*/
+
 #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
 		defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
 
@@ -328,6 +362,7 @@ static int __init omap_init_devices(void)
 	/* please keep these calls, and their implementations above,
 	 * in alphabetical order so they're easier to sort through.
 	 */
+	omap_init_dmic();
 	omap_init_rng();
 	omap_init_mcpdm();
 	omap_init_uwire();
-- 
1.7.0.4


  parent reply	other threads:[~2011-01-25 22:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 22:00 [PATCH v3 0/4] Adding OMAP DMIC driver to kernel David Lambert
2011-01-25 22:00 ` [PATCH v3 1/4] ASoC: DMIC: Adding the OMAP DMIC driver David Lambert
2011-01-28  7:43   ` Varadarajan, Charulatha
2011-01-28  8:45   ` Varadarajan, Charulatha
2011-01-25 22:01 ` [PATCH v3 2/4] OMAP4: hwmod: add entries for " David Lambert
2011-01-25 23:54   ` Paul Walmsley
2011-01-26 12:55     ` Lambert, David
2011-01-26 17:28       ` Paul Walmsley
2011-02-14 15:36   ` Cousson, Benoit
2011-01-25 22:01 ` David Lambert [this message]
2011-01-28  7:46   ` [PATCH v3 3/4] OMAP4: DMIC: initializes the " Varadarajan, Charulatha
2011-01-25 22:01 ` [PATCH v3 4/4] OMAP4: DMIC: Add DMIC codec platform devices David Lambert
2011-01-26  1:22 ` [PATCH v3 0/4] Adding OMAP DMIC driver to kernel 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=1295992862-6154-4-git-send-email-dlambert@ti.com \
    --to=dlambert@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=paul@pwsan.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