From patchwork Tue Jan 25 22:01:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lambert X-Patchwork-Id: 507111 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0PM1UA2010918 for ; Tue, 25 Jan 2011 22:02:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753836Ab1AYWBh (ORCPT ); Tue, 25 Jan 2011 17:01:37 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:59221 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753779Ab1AYWBg (ORCPT ); Tue, 25 Jan 2011 17:01:36 -0500 Received: from dlep34.itg.ti.com ([157.170.170.115]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p0PM1TEL014079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Jan 2011 16:01:29 -0600 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id p0PM1TH0011093; Tue, 25 Jan 2011 16:01:29 -0600 (CST) Received: from localhost (dta0193948-ubuntu.am.dhcp.ti.com [128.247.75.14]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id p0PM1Sf00829; Tue, 25 Jan 2011 16:01:28 -0600 (CST) From: David Lambert To: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org Cc: Tony Lindgren , Paul Walmsley , Mark Brown , Liam Girdwood , David Lambert Subject: [PATCH v3 3/4] OMAP4: DMIC: initializes the DMIC driver Date: Tue, 25 Jan 2011 16:01:01 -0600 Message-Id: <1295992862-6154-4-git-send-email-dlambert@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1295992862-6154-1-git-send-email-dlambert@ti.com> References: <1295992862-6154-1-git-send-email-dlambert@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 25 Jan 2011 22:03:00 +0000 (UTC) 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();