summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Guiriec <s-guiriec@ti.com>2012-05-14 22:32:54 +0200
committerXavier Boudet <x-boudet@ti.com>2012-07-10 17:26:52 +0200
commit96f2f2fce7ae939937076571a1bf7744de03640f (patch)
treed1e3ce4d864e377a27a0ce4a89ada6ed280ed4c4
parent98fa1385e8176d158098ab1dcfef0388bd7b87f8 (diff)
ARM: OMAP4+: devices: Add McASP.
Add McASP platform device for OMAP4/5 Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
-rw-r--r--arch/arm/mach-omap2/devices.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index a7b35d8c06d4..9f8c8fe39258 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -58,7 +58,7 @@
static const char * const *mac_device_fixup_paths;
int count_mac_device_fixup_paths;
-/* macro for building platform_device for McBSP ports */
+/* macro for building platform_device for McBSP ports */
#define OMAP_MCBSP_PLATFORM_DEVICE(port_nr) \
static struct platform_device omap_mcbsp##port_nr = { \
.name = "omap-mcbsp-dai", \
@@ -393,6 +393,36 @@ 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 platform_device *pdev;
+
+ oh = omap_hwmod_lookup("mcasp");
+ if (!oh) {
+ pr_err("could not look up mcasp hw_mod\n");
+ return;
+ }
+
+ pdev = omap_device_build("omap-mcasp", -1, oh, NULL, 0,
+ omap_mcasp_latency,
+ ARRAY_SIZE(omap_mcasp_latency), 0);
+ WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcasp-audio.\n");
+}
+#else
+static inline void omap_init_mcasp(void) {}
+#endif
+
#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
@@ -407,7 +437,7 @@ static struct omap_device_pm_latency omap_mcpdm_latency[] = {
static void __init omap_init_mcpdm(void)
{
struct omap_hwmod *oh;
- struct platform_device *pdev;
+ struct platform_device *pdev;
oh = omap_hwmod_lookup("mcpdm");
if (!oh) {
@@ -1083,6 +1113,8 @@ static int __init omap2_init_devices(void)
omap_init_abe();
omap_init_aess();
omap_init_audio();
+ omap_init_mcasp();
+ omap_init_mcpdm();
omap_init_dmic();
omap_init_mcpdm();
omap_init_camera();