diff options
author | Jorge Eduardo Candelaria <jorge.candelaria@ti.com> | 2011-07-24 15:59:39 -0400 |
---|---|---|
committer | Paolo Pisati <paolo.pisati@canonical.com> | 2012-08-17 04:18:22 -0400 |
commit | aca83ec70eaaa2579b61c70fd1aec8d65dfaa8b4 (patch) | |
tree | b3a986e27f765572bd962bece452f730052ee019 | |
parent | c21ba296482e71ff1bf2af1afe361a1ca25c7ea9 (diff) |
Subject: [PATCH 058/104] OMAP: McPDM: Convert McPDM device to omap_device
McPDM device is converted to omap device.
Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ticom>
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
-rw-r--r-- | arch/arm/plat-omap/devices.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index ea28f98d5d6..2afeda91643 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
28 | #include <plat/menelaus.h> | 28 | #include <plat/menelaus.h> |
29 | #include <plat/mcbsp.h> | 29 | #include <plat/mcbsp.h> |
30 | #include <plat/mcpdm.h> | ||
30 | #include <plat/omap44xx.h> | 31 | #include <plat/omap44xx.h> |
31 | 32 | ||
32 | /*-------------------------------------------------------------------------*/ | 33 | /*-------------------------------------------------------------------------*/ |
@@ -77,31 +78,38 @@ void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, | |||
77 | #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ | 78 | #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ |
78 | defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) | 79 | defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) |
79 | 80 | ||
80 | static struct resource mcpdm_resources[] = { | 81 | static struct omap_device_pm_latency omap_mcpdm_latency[] = { |
81 | { | 82 | { |
82 | .name = "mcpdm_mem", | 83 | .deactivate_func = omap_device_idle_hwmods, |
83 | .start = OMAP44XX_MCPDM_BASE, | 84 | .activate_func = omap_device_enable_hwmods, |
84 | .end = OMAP44XX_MCPDM_BASE + SZ_4K, | 85 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, |
85 | .flags = IORESOURCE_MEM, | ||
86 | }, | ||
87 | { | ||
88 | .name = "mcpdm_irq", | ||
89 | .start = OMAP44XX_IRQ_MCPDM, | ||
90 | .end = OMAP44XX_IRQ_MCPDM, | ||
91 | .flags = IORESOURCE_IRQ, | ||
92 | }, | 86 | }, |
93 | }; | 87 | }; |
94 | 88 | ||
95 | static struct platform_device omap_mcpdm_device = { | ||
96 | .name = "omap-mcpdm", | ||
97 | .id = -1, | ||
98 | .num_resources = ARRAY_SIZE(mcpdm_resources), | ||
99 | .resource = mcpdm_resources, | ||
100 | }; | ||
101 | |||
102 | static void omap_init_mcpdm(void) | 89 | static void omap_init_mcpdm(void) |
103 | { | 90 | { |
104 | (void) platform_device_register(&omap_mcpdm_device); | 91 | struct omap_hwmod *oh; |
92 | struct omap_device *od; | ||
93 | struct omap_mcpdm_platform_data *pdata; | ||
94 | |||
95 | oh = omap_hwmod_lookup("mcpdm"); | ||
96 | if (!oh) { | ||
97 | printk(KERN_ERR "Could not look up mcpdm hw_mod\n"); | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | pdata = kzalloc(sizeof(struct omap_mcpdm_platform_data), GFP_KERNEL); | ||
102 | if (!pdata) { | ||
103 | printk(KERN_ERR "Could not allocate platform data\n"); | ||
104 | return; | ||
105 | } | ||
106 | |||
107 | od = omap_device_build("omap-mcpdm", -1, oh, pdata, | ||
108 | sizeof(struct omap_mcpdm_platform_data), | ||
109 | omap_mcpdm_latency, | ||
110 | ARRAY_SIZE(omap_mcpdm_latency), 0); | ||
111 | if (IS_ERR(od)) | ||
112 | printk(KERN_ERR "Could not build omap_device for omap-mcpdm-dai\n"); | ||
105 | } | 113 | } |
106 | #else | 114 | #else |
107 | static inline void omap_init_mcpdm(void) {} | 115 | static inline void omap_init_mcpdm(void) {} |