diff options
author | Misael Lopez Cruz <misael.lopez@ti.com> | 2011-07-29 14:31:38 -0500 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-08-03 17:22:32 -0700 |
commit | 1f164666af25c9e55289490f79cfbba18fc5c5b2 (patch) | |
tree | cf0f996796655f3c2bd7227bcdf68d3f603b4475 | |
parent | 02f6cc06aa65e284263b12c32483d9b24ad12d1a (diff) | |
download | kernel_samsung_tuna-1f164666af25c9e55289490f79cfbba18fc5c5b2.tar.gz kernel_samsung_tuna-1f164666af25c9e55289490f79cfbba18fc5c5b2.tar.bz2 kernel_samsung_tuna-1f164666af25c9e55289490f79cfbba18fc5c5b2.zip |
OMAP4: AESS: Move device creation to mach-omap2
Audio Engine Subsystem is only present in OMAP4 so its
device should built in mach-omap2 as it's not applicable
for OMAP1.
omap_device_scale API is passed for AESS OPP selection.
Change-Id: I1a031b625ce78aa5feb3cbc35d6e227289e3e63a
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 49 | ||||
-rw-r--r-- | arch/arm/plat-omap/devices.c | 53 |
2 files changed, 49 insertions, 53 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 33f95e32ca4..d9add973e2e 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -35,6 +35,8 @@ #include <plat/omap4-keypad.h> #include <plat/mcpdm.h> +#include <sound/omap-abe-dsp.h> + #include "mux.h" #include "control.h" #include "devices.h" @@ -337,6 +339,52 @@ static void omap_init_mcpdm(void) static inline void omap_init_mcpdm(void) {} #endif +#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; + char *oh_name = "aess"; + char *dev_name = "aess"; + + oh = omap_hwmod_lookup(oh_name); + if (!oh) { + pr_err("%s: could not look up %s\n", __func__, oh_name); + return; + } + + pdata = kzalloc(sizeof(struct omap4_abe_dsp_pdata), GFP_KERNEL); + if (!pdata) { + pr_err("%s: could not allocate platform data\n", __func__); + return; + } + + pdata->device_scale = omap_device_scale; + + od = omap_device_build(dev_name, -1, oh, pdata, + sizeof(struct omap4_abe_dsp_pdata), + omap_aess_latency, + ARRAY_SIZE(omap_aess_latency), 0); + WARN(IS_ERR(od), "could not build omap_device for %s:%s\n", + oh_name, dev_name); + + kfree(pdata); +} +#else +static inline void omap_init_aess(void) {} +#endif + #if defined CONFIG_ARCH_OMAP4 static struct platform_device omap_abe_dai = { @@ -804,6 +852,7 @@ static int __init omap2_init_devices(void) * in alphabetical order so they're easier to sort through. */ omap_init_mcpdm(); + omap_init_aess(); omap_init_abe(); omap_init_audio(); omap_init_camera(); diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index b60a3083c6f..d8add7e7b2e 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -33,9 +33,6 @@ #include <plat/remoteproc.h> #include <plat/omap44xx.h> -#include <sound/omap-abe-dsp.h> - - /*-------------------------------------------------------------------------*/ #if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE) @@ -131,55 +128,6 @@ fail: /*-------------------------------------------------------------------------*/ -#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("aess"); - 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("aess", -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_HW_RANDOM_OMAP) || defined(CONFIG_HW_RANDOM_OMAP_MODULE) #ifdef CONFIG_ARCH_OMAP2 @@ -379,7 +327,6 @@ static int __init omap_init_devices(void) * in alphabetical order so they're easier to sort through. */ omap_init_rng(); - omap_init_aess(); omap_init_uwire(); return 0; } |