Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
[~shefty/rdma-dev.git] / arch / arm / mach-omap2 / devices.c
index 2794dba90870ad0dae5d2e328c9159a166cba96a..0b510ad01a00b5a7ad4ae224f17447e8bba6301f 100644 (file)
@@ -355,6 +355,27 @@ static void omap_init_mcpdm(void)
 static inline void omap_init_mcpdm(void) {}
 #endif
 
+#if defined(CONFIG_SND_OMAP_SOC_DMIC) || \
+               defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE)
+
+static void omap_init_dmic(void)
+{
+       struct omap_hwmod *oh;
+       struct platform_device *pdev;
+
+       oh = omap_hwmod_lookup("dmic");
+       if (!oh) {
+               printk(KERN_ERR "Could not look up mcpdm hw_mod\n");
+               return;
+       }
+
+       pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0, NULL, 0, 0);
+       WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n");
+}
+#else
+static inline void omap_init_dmic(void) {}
+#endif
+
 #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
 
 #include <plat/mcspi.h>
@@ -700,6 +721,7 @@ static int __init omap2_init_devices(void)
         */
        omap_init_audio();
        omap_init_mcpdm();
+       omap_init_dmic();
        omap_init_camera();
        omap_init_mbox();
        omap_init_mcspi();