diff options
author | Sebastien Guiriec <s-guiriec@ti.com> | 2012-05-14 22:32:54 +0200 |
---|---|---|
committer | Guillaume Aubertin <g-aubertin@ti.com> | 2012-06-26 12:20:55 +0200 |
commit | dabbe23eb2e48bdb4da1c94cc6d865b1a18059ca (patch) | |
tree | 41560d0196ac6409a24dd1ce32d91e1332c05f1b | |
parent | b7baf5af8ef00fab0cfc9f3610f479049afc1f75 (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.c | 36 |
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(); |