aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJarkko Nikula <jarkko.nikula@bitmer.com>2011-09-26 03:45:38 -0400
committerTony Lindgren <tony@atomide.com>2011-09-26 20:46:35 -0400
commit40246e0003f02160a116db249270129b0c600e95 (patch)
tree5a7184088f40a232a444cb3bd90ea7a4152239e6 /arch
parent00a327c05c31a19ae2e36cdb556ad283a751fc4b (diff)
ARM: OMAP: mcbsp: Move out omap_mcbsp_register_board_cfg from plat-omap/devices.c
Only OMAP1s are using omap_mcbsp_register_board_cfg after OMAP2+ hwmod conversion so it can be moved to mach-omap1/mcbsp.c. Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap1/mcbsp.c32
-rw-r--r--arch/arm/plat-omap/devices.c46
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h2
3 files changed, 32 insertions, 48 deletions
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index ab7395d84bc8..3c985ac1dfc7 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -31,6 +31,7 @@
31static int dsp_use; 31static int dsp_use;
32static struct clk *api_clk; 32static struct clk *api_clk;
33static struct clk *dsp_clk; 33static struct clk *dsp_clk;
34static struct platform_device **omap_mcbsp_devices;
34 35
35static void omap1_mcbsp_request(unsigned int id) 36static void omap1_mcbsp_request(unsigned int id)
36{ 37{
@@ -369,6 +370,37 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
369#define OMAP16XX_MCBSP_COUNT 0 370#define OMAP16XX_MCBSP_COUNT 0
370#endif 371#endif
371 372
373static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
374 struct omap_mcbsp_platform_data *config, int size)
375{
376 int i;
377
378 omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *),
379 GFP_KERNEL);
380 if (!omap_mcbsp_devices) {
381 printk(KERN_ERR "Could not register McBSP devices\n");
382 return;
383 }
384
385 for (i = 0; i < size; i++) {
386 struct platform_device *new_mcbsp;
387 int ret;
388
389 new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1);
390 if (!new_mcbsp)
391 continue;
392 platform_device_add_resources(new_mcbsp, &res[i * res_count],
393 res_count);
394 new_mcbsp->dev.platform_data = &config[i];
395 ret = platform_device_add(new_mcbsp);
396 if (ret) {
397 platform_device_put(new_mcbsp);
398 continue;
399 }
400 omap_mcbsp_devices[i] = new_mcbsp;
401 }
402}
403
372static int __init omap1_mcbsp_init(void) 404static int __init omap1_mcbsp_init(void)
373{ 405{
374 if (!cpu_class_is_omap1()) 406 if (!cpu_class_is_omap1())
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index ea28f98d5d6a..bd9a06b3ee89 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -26,54 +26,8 @@
26#include <plat/mmc.h> 26#include <plat/mmc.h>
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>
30#include <plat/omap44xx.h> 29#include <plat/omap44xx.h>
31 30
32/*-------------------------------------------------------------------------*/
33
34#if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE)
35
36static struct platform_device **omap_mcbsp_devices;
37
38void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
39 struct omap_mcbsp_platform_data *config, int size)
40{
41 int i;
42
43 omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *),
44 GFP_KERNEL);
45 if (!omap_mcbsp_devices) {
46 printk(KERN_ERR "Could not register McBSP devices\n");
47 return;
48 }
49
50 for (i = 0; i < size; i++) {
51 struct platform_device *new_mcbsp;
52 int ret;
53
54 new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1);
55 if (!new_mcbsp)
56 continue;
57 platform_device_add_resources(new_mcbsp, &res[i * res_count],
58 res_count);
59 new_mcbsp->dev.platform_data = &config[i];
60 ret = platform_device_add(new_mcbsp);
61 if (ret) {
62 platform_device_put(new_mcbsp);
63 continue;
64 }
65 omap_mcbsp_devices[i] = new_mcbsp;
66 }
67}
68
69#else
70void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
71 struct omap_mcbsp_platform_data *config, int size)
72{ }
73#endif
74
75/*-------------------------------------------------------------------------*/
76
77#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ 31#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
78 defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) 32 defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
79 33
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index 8ab14d808f0f..7adfd92d6c1a 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -407,8 +407,6 @@ extern int omap_mcbsp_count, omap_mcbsp_cache_size;
407#define id_to_mcbsp_ptr(id) mcbsp_ptr[id]; 407#define id_to_mcbsp_ptr(id) mcbsp_ptr[id];
408 408
409int omap_mcbsp_init(void); 409int omap_mcbsp_init(void);
410void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
411 struct omap_mcbsp_platform_data *config, int size);
412void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config); 410void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config);
413#ifdef CONFIG_ARCH_OMAP3 411#ifdef CONFIG_ARCH_OMAP3
414void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold); 412void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold);