diff options
author | David Lambert <dlambert@ti.com> | 2011-07-24 15:59:39 -0400 |
---|---|---|
committer | Paolo Pisati <paolo.pisati@canonical.com> | 2012-08-17 04:18:23 -0400 |
commit | d06190da37c76a1bb7f85c5c17d4705b3a395ffd (patch) | |
tree | 48af77209da929c98352f43b5bb0f94625f5ab60 | |
parent | aca83ec70eaaa2579b61c70fd1aec8d65dfaa8b4 (diff) |
Subject: [PATCH 059/104] OMAP: DMIC: Add omap_device for DMIC
Register DMIC device through omap device model.
Signed-off-by: David Lambert <dlambert@ti.com>
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
-rw-r--r-- | 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 2afeda91643..53c6bb1de58 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
@@ -75,6 +75,40 @@ void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, | |||
75 | 75 | ||
76 | /*-------------------------------------------------------------------------*/ | 76 | /*-------------------------------------------------------------------------*/ |
77 | 77 | ||
78 | #if defined(CONFIG_SND_OMAP_SOC_DMIC) || \ | ||
79 | defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE) | ||
80 | |||
81 | static struct omap_device_pm_latency omap_dmic_latency[] = { | ||
82 | { | ||
83 | .deactivate_func = omap_device_idle_hwmods, | ||
84 | .activate_func = omap_device_enable_hwmods, | ||
85 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | static void omap_init_dmic(void) | ||
90 | { | ||
91 | struct omap_hwmod *oh; | ||
92 | struct omap_device *od; | ||
93 | |||
94 | oh = omap_hwmod_lookup("dmic"); | ||
95 | if (!oh) { | ||
96 | printk(KERN_ERR "Could not look up dmic hw_mod\n"); | ||
97 | return; | ||
98 | } | ||
99 | |||
100 | od = omap_device_build("omap-dmic-dai", -1, oh, NULL, 0, | ||
101 | omap_dmic_latency, | ||
102 | ARRAY_SIZE(omap_dmic_latency), 0); | ||
103 | if (IS_ERR(od)) | ||
104 | printk(KERN_ERR "Could not build omap_device for omap-dmic-dai\n"); | ||
105 | } | ||
106 | #else | ||
107 | static inline void omap_init_dmic(void) {} | ||
108 | #endif | ||
109 | |||
110 | /*-------------------------------------------------------------------------*/ | ||
111 | |||
78 | #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ | 112 | #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ |
79 | defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) | 113 | defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) |
80 | 114 | ||
@@ -299,6 +333,7 @@ static int __init omap_init_devices(void) | |||
299 | * in alphabetical order so they're easier to sort through. | 333 | * in alphabetical order so they're easier to sort through. |
300 | */ | 334 | */ |
301 | omap_init_rng(); | 335 | omap_init_rng(); |
336 | omap_init_dmic(); | ||
302 | omap_init_mcpdm(); | 337 | omap_init_mcpdm(); |
303 | omap_init_uwire(); | 338 | omap_init_uwire(); |
304 | return 0; | 339 | return 0; |