From 91243f130352bfe55b835edd2b4f53585d198cd3 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sat, 12 Feb 2011 22:19:09 -0600 Subject: [PATCH 09/60] OMAP: AESS: Add omap_device for AESS commit 3ca7a3854e1bad22ac005df86834043cd967d6e2 upstream Register Audio Engine Subsystem (AESS) device through omap device framework. Change-Id: Ia0b380544730c11c25207eb8b50892b52351c0b5 Signed-off-by: Liam Girdwood Signed-off-by: Jorge Eduardo Candelaria Signed-off-by: Margarita Olaya Cabrera Signed-off-by: Misael Lopez Cruz Integrated-by: Jingdong Lu --- arch/arm/plat-omap/devices.c | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index 0015759..28c4e52 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -21,6 +21,8 @@ #include #include +#include +#include #include #include #include @@ -30,6 +32,8 @@ #include #include +#include + /*-------------------------------------------------------------------------*/ #if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE) @@ -117,6 +121,54 @@ static inline void omap_init_mcpdm(void) {} /*-------------------------------------------------------------------------*/ +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP) || \ + defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + +static struct omap_device_pm_latency omap_aess_latency[] = { + { + .deactivate_func = omap_device_idle_hwmods, + .activate_func = omap_device_enable_hwmods, + .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, + }, +}; + +static void omap_init_aess(void) +{ + struct omap_hwmod *oh; + struct omap_device *od; + struct omap4_abe_dsp_pdata *pdata; + + oh = omap_hwmod_lookup("omap-aess-audio"); + if (!oh) { + printk (KERN_ERR "Could not look up aess hw_mod\n"); + return; + } + + pdata = kzalloc(sizeof(struct omap4_abe_dsp_pdata), GFP_KERNEL); + if (!pdata) { + printk(KERN_ERR "Could not allocate platform data\n"); + return; + } + + /* FIXME: Add correct context loss counter */ + //pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count; + + od = omap_device_build("omap-aess-audio", -1, oh, pdata, + sizeof(struct omap4_abe_dsp_pdata), + omap_aess_latency, + ARRAY_SIZE(omap_aess_latency), 0); + + kfree(pdata); + + if (IS_ERR(od)) + printk(KERN_ERR "Could not build omap_device for omap-aess-audio\n"); +} +#else +static inline void omap_init_aess(void) {} +#endif + +/*-------------------------------------------------------------------------*/ + #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) @@ -300,6 +352,7 @@ static int __init omap_init_devices(void) */ omap_init_rng(); omap_init_mcpdm(); + omap_init_aess(); omap_init_uwire(); return 0; } -- 1.7.4.1