aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorZiyann <jaraidaniel@gmail.com>2014-08-18 13:58:26 +0200
committerZiyann <jaraidaniel@gmail.com>2014-10-03 01:17:50 +0200
commit58aced66f6ef2866e1b4739589b99a8aa16d72ce (patch)
tree53ca5f09f17398f9d06985e59415dd8e0943ee13 /arch/arm/plat-omap
parentbfaedad70aa4f41d6303f17608182f5fa3b2d031 (diff)
downloadkernel_samsung_tuna-58aced66f6ef2866e1b4739589b99a8aa16d72ce.zip
kernel_samsung_tuna-58aced66f6ef2866e1b4739589b99a8aa16d72ce.tar.gz
kernel_samsung_tuna-58aced66f6ef2866e1b4739589b99a8aa16d72ce.tar.bz2
[Blaze] OMAP: DMIC: Add omap_device for DMIC
Register DMIC device through omap device model. Change-Id: Ib8984f2d8f5746a20e146900d0ef866a6d4e0b35 Signed-off-by: David Lambert <dlambert@ti.com> Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Chris Kelly <c-kelly@ti.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/devices.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index f24c6d3..548cd19 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -78,6 +78,40 @@ void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
/*-------------------------------------------------------------------------*/
+#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("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_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
@@ -371,6 +405,7 @@ static int __init omap_init_devices(void)
* in alphabetical order so they're easier to sort through.
*/
omap_init_rng();
+ omap_init_dmic();
omap_init_uwire();
return 0;
}