aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2011-10-07 00:50:10 -0500
committerSimon Wilson <simonwilson@google.com>2011-11-07 16:14:53 -0800
commitc2d94d033992f58410efb9f3df7f8b64b5adc3bf (patch)
tree9bb687df8f34074fdcdd2bd197a4c1c11ffd1435 /arch/arm/mach-omap2/devices.c
parent2ef0e8c96a75a92663347f766e9bba6f37f8fae9 (diff)
downloadkernel_samsung_espresso10-c2d94d033992f58410efb9f3df7f8b64b5adc3bf.zip
kernel_samsung_espresso10-c2d94d033992f58410efb9f3df7f8b64b5adc3bf.tar.gz
kernel_samsung_espresso10-c2d94d033992f58410efb9f3df7f8b64b5adc3bf.tar.bz2
OMAP4: McASP: Move device creation to mach-omap2
McASP module is only present in OMAP4 so its device creation belongs to mach-omap2, not to plat-omap as it's not present in OMAP1. Change-Id: I9c2ff61fe8fa91927f0db822a35eb48625ffebe3 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index c43d24a..cf7a0ba 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -473,6 +473,39 @@ static void omap_init_audio(void)
static inline void omap_init_audio(void) {}
#endif
+#if defined(CONFIG_SND_OMAP_SOC_MCASP) || \
+ defined(CONFIG_SND_OMAP_SOC_MCASP_MODULE)
+static struct omap_device_pm_latency omap_mcasp_latency[] = {
+ {
+ .deactivate_func = omap_device_idle_hwmods,
+ .activate_func = omap_device_enable_hwmods,
+ .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+ },
+};
+
+static void omap_init_mcasp(void)
+{
+ struct omap_hwmod *oh;
+ struct omap_device *od;
+ char *oh_name = "omap-mcasp-dai";
+ char *dev_name = "omap-mcasp-dai";
+
+ oh = omap_hwmod_lookup(oh_name);
+ if (!oh) {
+ pr_err("%s: could not look up %s\n", __func__, oh_name);
+ return;
+ }
+
+ od = omap_device_build(dev_name, -1, oh, NULL, 0,
+ omap_mcasp_latency,
+ ARRAY_SIZE(omap_mcasp_latency), 0);
+ WARN(IS_ERR(od), "could not build omap_device for %s:%s\n",
+ oh_name, dev_name);
+}
+#else
+static inline void omap_init_mcasp(void) {}
+#endif
+
#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
#include <plat/mcspi.h>
@@ -893,6 +926,7 @@ static int __init omap2_init_devices(void)
omap_init_audio();
omap_init_camera();
omap_init_mbox();
+ omap_init_mcasp();
omap_init_mcspi();
omap_init_pmu();
omap_hdq_init();