xref: /linux/arch/arm/mach-omap2/mcbsp.c (revision 425925dd750acc17234977decfda1f9cc223389a)
178673bc8SEduardo Valentin /*
278673bc8SEduardo Valentin  * linux/arch/arm/mach-omap2/mcbsp.c
378673bc8SEduardo Valentin  *
478673bc8SEduardo Valentin  * Copyright (C) 2008 Instituto Nokia de Tecnologia
578673bc8SEduardo Valentin  * Contact: Eduardo Valentin <eduardo.valentin@indt.org.br>
678673bc8SEduardo Valentin  *
778673bc8SEduardo Valentin  * This program is free software; you can redistribute it and/or modify
878673bc8SEduardo Valentin  * it under the terms of the GNU General Public License version 2 as
978673bc8SEduardo Valentin  * published by the Free Software Foundation.
1078673bc8SEduardo Valentin  *
1178673bc8SEduardo Valentin  * Multichannel mode not supported.
1278673bc8SEduardo Valentin  */
1378673bc8SEduardo Valentin #include <linux/module.h>
1478673bc8SEduardo Valentin #include <linux/init.h>
1578673bc8SEduardo Valentin #include <linux/clk.h>
1678673bc8SEduardo Valentin #include <linux/err.h>
1778673bc8SEduardo Valentin #include <linux/io.h>
1878673bc8SEduardo Valentin #include <linux/platform_device.h>
195a0e3ad6STejun Heo #include <linux/slab.h>
2078673bc8SEduardo Valentin 
21dd7667aaSTony Lindgren #include <mach/irqs.h>
22ce491cf8STony Lindgren #include <plat/dma.h>
23ce491cf8STony Lindgren #include <plat/cpu.h>
24ce491cf8STony Lindgren #include <plat/mcbsp.h>
254814ced5SPaul Walmsley 
264814ced5SPaul Walmsley #include "control.h"
274814ced5SPaul Walmsley 
2878673bc8SEduardo Valentin 
29cf4c87abSPaul Walmsley /* McBSP internal signal muxing functions */
30cf4c87abSPaul Walmsley 
31cf4c87abSPaul Walmsley void omap2_mcbsp1_mux_clkr_src(u8 mux)
32cf4c87abSPaul Walmsley {
33cf4c87abSPaul Walmsley 	u32 v;
34cf4c87abSPaul Walmsley 
35cf4c87abSPaul Walmsley 	v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
36cf4c87abSPaul Walmsley 	if (mux == CLKR_SRC_CLKR)
37*425925ddSJarkko Nikula 		v &= ~OMAP2_MCBSP1_CLKR_MASK;
38cf4c87abSPaul Walmsley 	else if (mux == CLKR_SRC_CLKX)
39cf4c87abSPaul Walmsley 		v |= OMAP2_MCBSP1_CLKR_MASK;
40cf4c87abSPaul Walmsley 	omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
41cf4c87abSPaul Walmsley }
42cf4c87abSPaul Walmsley EXPORT_SYMBOL(omap2_mcbsp1_mux_clkr_src);
43cf4c87abSPaul Walmsley 
44cf4c87abSPaul Walmsley void omap2_mcbsp1_mux_fsr_src(u8 mux)
45cf4c87abSPaul Walmsley {
46cf4c87abSPaul Walmsley 	u32 v;
47cf4c87abSPaul Walmsley 
48cf4c87abSPaul Walmsley 	v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
49cf4c87abSPaul Walmsley 	if (mux == FSR_SRC_FSR)
50*425925ddSJarkko Nikula 		v &= ~OMAP2_MCBSP1_FSR_MASK;
51cf4c87abSPaul Walmsley 	else if (mux == FSR_SRC_FSX)
52cf4c87abSPaul Walmsley 		v |= OMAP2_MCBSP1_FSR_MASK;
53cf4c87abSPaul Walmsley 	omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
54cf4c87abSPaul Walmsley }
55cf4c87abSPaul Walmsley EXPORT_SYMBOL(omap2_mcbsp1_mux_fsr_src);
56cf4c87abSPaul Walmsley 
57d1358657SPaul Walmsley /* McBSP CLKS source switching function */
58d1358657SPaul Walmsley 
59d1358657SPaul Walmsley int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
60d1358657SPaul Walmsley {
61d1358657SPaul Walmsley 	struct omap_mcbsp *mcbsp;
62d1358657SPaul Walmsley 	struct clk *fck_src;
63d1358657SPaul Walmsley 	char *fck_src_name;
64d1358657SPaul Walmsley 	int r;
65d1358657SPaul Walmsley 
66d1358657SPaul Walmsley 	if (!omap_mcbsp_check_valid_id(id)) {
67d1358657SPaul Walmsley 		pr_err("%s: Invalid id (%d)\n", __func__, id + 1);
68d1358657SPaul Walmsley 		return -EINVAL;
69d1358657SPaul Walmsley 	}
70d1358657SPaul Walmsley 	mcbsp = id_to_mcbsp_ptr(id);
71d1358657SPaul Walmsley 
72d1358657SPaul Walmsley 	if (fck_src_id == MCBSP_CLKS_PAD_SRC)
73d1358657SPaul Walmsley 		fck_src_name = "pad_fck";
74d1358657SPaul Walmsley 	else if (fck_src_id == MCBSP_CLKS_PRCM_SRC)
75d1358657SPaul Walmsley 		fck_src_name = "prcm_fck";
76d1358657SPaul Walmsley 	else
77d1358657SPaul Walmsley 		return -EINVAL;
78d1358657SPaul Walmsley 
79d1358657SPaul Walmsley 	fck_src = clk_get(mcbsp->dev, fck_src_name);
80d1358657SPaul Walmsley 	if (IS_ERR_OR_NULL(fck_src)) {
81d1358657SPaul Walmsley 		pr_err("omap-mcbsp: %s: could not clk_get() %s\n", "clks",
82d1358657SPaul Walmsley 		       fck_src_name);
83d1358657SPaul Walmsley 		return -EINVAL;
84d1358657SPaul Walmsley 	}
85d1358657SPaul Walmsley 
86d1358657SPaul Walmsley 	clk_disable(mcbsp->fclk);
87d1358657SPaul Walmsley 
88d1358657SPaul Walmsley 	r = clk_set_parent(mcbsp->fclk, fck_src);
89d1358657SPaul Walmsley 	if (IS_ERR_VALUE(r)) {
90d1358657SPaul Walmsley 		pr_err("omap-mcbsp: %s: could not clk_set_parent() to %s\n",
91d1358657SPaul Walmsley 		       "clks", fck_src_name);
92d1358657SPaul Walmsley 		clk_put(fck_src);
93d1358657SPaul Walmsley 		return -EINVAL;
94d1358657SPaul Walmsley 	}
95d1358657SPaul Walmsley 
96d1358657SPaul Walmsley 	clk_enable(mcbsp->fclk);
97d1358657SPaul Walmsley 
98d1358657SPaul Walmsley 	clk_put(fck_src);
99d1358657SPaul Walmsley 
100d1358657SPaul Walmsley 	return 0;
101d1358657SPaul Walmsley }
102d1358657SPaul Walmsley EXPORT_SYMBOL(omap2_mcbsp_set_clks_src);
103d1358657SPaul Walmsley 
104d1358657SPaul Walmsley 
105cf4c87abSPaul Walmsley /* Platform data */
10678673bc8SEduardo Valentin 
10705228c35SJarkko Nikula #ifdef CONFIG_ARCH_OMAP2420
10805228c35SJarkko Nikula static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = {
10978673bc8SEduardo Valentin 	{
11065846909SRussell King 		.phys_base	= OMAP24XX_MCBSP1_BASE,
11178673bc8SEduardo Valentin 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP1_RX,
11278673bc8SEduardo Valentin 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP1_TX,
11378673bc8SEduardo Valentin 		.rx_irq		= INT_24XX_MCBSP1_IRQ_RX,
11478673bc8SEduardo Valentin 		.tx_irq		= INT_24XX_MCBSP1_IRQ_TX,
11578673bc8SEduardo Valentin 	},
11678673bc8SEduardo Valentin 	{
11765846909SRussell King 		.phys_base	= OMAP24XX_MCBSP2_BASE,
11878673bc8SEduardo Valentin 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP2_RX,
11978673bc8SEduardo Valentin 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP2_TX,
12078673bc8SEduardo Valentin 		.rx_irq		= INT_24XX_MCBSP2_IRQ_RX,
12178673bc8SEduardo Valentin 		.tx_irq		= INT_24XX_MCBSP2_IRQ_TX,
12278673bc8SEduardo Valentin 	},
12378673bc8SEduardo Valentin };
12405228c35SJarkko Nikula #define OMAP2420_MCBSP_PDATA_SZ		ARRAY_SIZE(omap2420_mcbsp_pdata)
125c8c99699SJanusz Krzysztofik #define OMAP2420_MCBSP_REG_NUM		(OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
12678673bc8SEduardo Valentin #else
12705228c35SJarkko Nikula #define omap2420_mcbsp_pdata		NULL
12805228c35SJarkko Nikula #define OMAP2420_MCBSP_PDATA_SZ		0
129c8c99699SJanusz Krzysztofik #define OMAP2420_MCBSP_REG_NUM		0
13005228c35SJarkko Nikula #endif
13105228c35SJarkko Nikula 
13205228c35SJarkko Nikula #ifdef CONFIG_ARCH_OMAP2430
13305228c35SJarkko Nikula static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = {
13405228c35SJarkko Nikula 	{
13505228c35SJarkko Nikula 		.phys_base	= OMAP24XX_MCBSP1_BASE,
13605228c35SJarkko Nikula 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP1_RX,
13705228c35SJarkko Nikula 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP1_TX,
13805228c35SJarkko Nikula 		.rx_irq		= INT_24XX_MCBSP1_IRQ_RX,
13905228c35SJarkko Nikula 		.tx_irq		= INT_24XX_MCBSP1_IRQ_TX,
14005228c35SJarkko Nikula 	},
14105228c35SJarkko Nikula 	{
14205228c35SJarkko Nikula 		.phys_base	= OMAP24XX_MCBSP2_BASE,
14305228c35SJarkko Nikula 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP2_RX,
14405228c35SJarkko Nikula 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP2_TX,
14505228c35SJarkko Nikula 		.rx_irq		= INT_24XX_MCBSP2_IRQ_RX,
14605228c35SJarkko Nikula 		.tx_irq		= INT_24XX_MCBSP2_IRQ_TX,
14705228c35SJarkko Nikula 	},
14805228c35SJarkko Nikula 	{
14905228c35SJarkko Nikula 		.phys_base	= OMAP2430_MCBSP3_BASE,
15005228c35SJarkko Nikula 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP3_RX,
15105228c35SJarkko Nikula 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP3_TX,
15205228c35SJarkko Nikula 		.rx_irq		= INT_24XX_MCBSP3_IRQ_RX,
15305228c35SJarkko Nikula 		.tx_irq		= INT_24XX_MCBSP3_IRQ_TX,
15405228c35SJarkko Nikula 	},
15505228c35SJarkko Nikula 	{
15605228c35SJarkko Nikula 		.phys_base	= OMAP2430_MCBSP4_BASE,
15705228c35SJarkko Nikula 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP4_RX,
15805228c35SJarkko Nikula 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP4_TX,
15905228c35SJarkko Nikula 		.rx_irq		= INT_24XX_MCBSP4_IRQ_RX,
16005228c35SJarkko Nikula 		.tx_irq		= INT_24XX_MCBSP4_IRQ_TX,
16105228c35SJarkko Nikula 	},
16205228c35SJarkko Nikula 	{
16305228c35SJarkko Nikula 		.phys_base	= OMAP2430_MCBSP5_BASE,
16405228c35SJarkko Nikula 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP5_RX,
16505228c35SJarkko Nikula 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP5_TX,
16605228c35SJarkko Nikula 		.rx_irq		= INT_24XX_MCBSP5_IRQ_RX,
16705228c35SJarkko Nikula 		.tx_irq		= INT_24XX_MCBSP5_IRQ_TX,
16805228c35SJarkko Nikula 	},
16905228c35SJarkko Nikula };
17005228c35SJarkko Nikula #define OMAP2430_MCBSP_PDATA_SZ		ARRAY_SIZE(omap2430_mcbsp_pdata)
171c8c99699SJanusz Krzysztofik #define OMAP2430_MCBSP_REG_NUM		(OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
17205228c35SJarkko Nikula #else
17305228c35SJarkko Nikula #define omap2430_mcbsp_pdata		NULL
17405228c35SJarkko Nikula #define OMAP2430_MCBSP_PDATA_SZ		0
175c8c99699SJanusz Krzysztofik #define OMAP2430_MCBSP_REG_NUM		0
17678673bc8SEduardo Valentin #endif
17778673bc8SEduardo Valentin 
178a8eb7ca0STony Lindgren #ifdef CONFIG_ARCH_OMAP3
17978673bc8SEduardo Valentin static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
18078673bc8SEduardo Valentin 	{
18165846909SRussell King 		.phys_base	= OMAP34XX_MCBSP1_BASE,
18278673bc8SEduardo Valentin 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP1_RX,
18378673bc8SEduardo Valentin 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP1_TX,
18478673bc8SEduardo Valentin 		.rx_irq		= INT_24XX_MCBSP1_IRQ_RX,
18578673bc8SEduardo Valentin 		.tx_irq		= INT_24XX_MCBSP1_IRQ_TX,
186451fd82dSPeter Ujfalusi 		.buffer_size	= 0x80, /* The FIFO has 128 locations */
18778673bc8SEduardo Valentin 	},
18878673bc8SEduardo Valentin 	{
18965846909SRussell King 		.phys_base	= OMAP34XX_MCBSP2_BASE,
190d912fa92SEero Nurkkala 		.phys_base_st	= OMAP34XX_MCBSP2_ST_BASE,
19178673bc8SEduardo Valentin 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP2_RX,
19278673bc8SEduardo Valentin 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP2_TX,
19378673bc8SEduardo Valentin 		.rx_irq		= INT_24XX_MCBSP2_IRQ_RX,
19478673bc8SEduardo Valentin 		.tx_irq		= INT_24XX_MCBSP2_IRQ_TX,
195451fd82dSPeter Ujfalusi 		.buffer_size	= 0x500, /* The FIFO has 1024 + 256 locations */
19678673bc8SEduardo Valentin 	},
1979c8e3a0fSChandra Shekhar 	{
1989c8e3a0fSChandra Shekhar 		.phys_base	= OMAP34XX_MCBSP3_BASE,
199d912fa92SEero Nurkkala 		.phys_base_st	= OMAP34XX_MCBSP3_ST_BASE,
2009c8e3a0fSChandra Shekhar 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP3_RX,
2019c8e3a0fSChandra Shekhar 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP3_TX,
2029c8e3a0fSChandra Shekhar 		.rx_irq		= INT_24XX_MCBSP3_IRQ_RX,
2039c8e3a0fSChandra Shekhar 		.tx_irq		= INT_24XX_MCBSP3_IRQ_TX,
204451fd82dSPeter Ujfalusi 		.buffer_size	= 0x80, /* The FIFO has 128 locations */
2059c8e3a0fSChandra Shekhar 	},
2069c8e3a0fSChandra Shekhar 	{
2079c8e3a0fSChandra Shekhar 		.phys_base	= OMAP34XX_MCBSP4_BASE,
2089c8e3a0fSChandra Shekhar 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP4_RX,
2099c8e3a0fSChandra Shekhar 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP4_TX,
2109c8e3a0fSChandra Shekhar 		.rx_irq		= INT_24XX_MCBSP4_IRQ_RX,
2119c8e3a0fSChandra Shekhar 		.tx_irq		= INT_24XX_MCBSP4_IRQ_TX,
212451fd82dSPeter Ujfalusi 		.buffer_size	= 0x80, /* The FIFO has 128 locations */
2139c8e3a0fSChandra Shekhar 	},
2149c8e3a0fSChandra Shekhar 	{
2159c8e3a0fSChandra Shekhar 		.phys_base	= OMAP34XX_MCBSP5_BASE,
2169c8e3a0fSChandra Shekhar 		.dma_rx_sync	= OMAP24XX_DMA_MCBSP5_RX,
2179c8e3a0fSChandra Shekhar 		.dma_tx_sync	= OMAP24XX_DMA_MCBSP5_TX,
2189c8e3a0fSChandra Shekhar 		.rx_irq		= INT_24XX_MCBSP5_IRQ_RX,
2199c8e3a0fSChandra Shekhar 		.tx_irq		= INT_24XX_MCBSP5_IRQ_TX,
220451fd82dSPeter Ujfalusi 		.buffer_size	= 0x80, /* The FIFO has 128 locations */
2219c8e3a0fSChandra Shekhar 	},
22278673bc8SEduardo Valentin };
22378673bc8SEduardo Valentin #define OMAP34XX_MCBSP_PDATA_SZ		ARRAY_SIZE(omap34xx_mcbsp_pdata)
224c8c99699SJanusz Krzysztofik #define OMAP34XX_MCBSP_REG_NUM		(OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
22578673bc8SEduardo Valentin #else
22678673bc8SEduardo Valentin #define omap34xx_mcbsp_pdata		NULL
22778673bc8SEduardo Valentin #define OMAP34XX_MCBSP_PDATA_SZ		0
228c8c99699SJanusz Krzysztofik #define OMAP34XX_MCBSP_REG_NUM		0
22978673bc8SEduardo Valentin #endif
23078673bc8SEduardo Valentin 
231a5b92cc3SSyed Rafiuddin static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = {
232a5b92cc3SSyed Rafiuddin 	{
233a5b92cc3SSyed Rafiuddin 		.phys_base      = OMAP44XX_MCBSP1_BASE,
234a5b92cc3SSyed Rafiuddin 		.dma_rx_sync    = OMAP44XX_DMA_MCBSP1_RX,
235a5b92cc3SSyed Rafiuddin 		.dma_tx_sync    = OMAP44XX_DMA_MCBSP1_TX,
2369319b9daSJorge Eduardo Candelaria 		.tx_irq         = OMAP44XX_IRQ_MCBSP1,
237a5b92cc3SSyed Rafiuddin 	},
238a5b92cc3SSyed Rafiuddin 	{
239a5b92cc3SSyed Rafiuddin 		.phys_base      = OMAP44XX_MCBSP2_BASE,
240a5b92cc3SSyed Rafiuddin 		.dma_rx_sync    = OMAP44XX_DMA_MCBSP2_RX,
241a5b92cc3SSyed Rafiuddin 		.dma_tx_sync    = OMAP44XX_DMA_MCBSP2_TX,
2429319b9daSJorge Eduardo Candelaria 		.tx_irq         = OMAP44XX_IRQ_MCBSP2,
243d1358657SPaul Walmsley 		/* XXX .ops ? */
244a5b92cc3SSyed Rafiuddin 	},
245a5b92cc3SSyed Rafiuddin 	{
246a5b92cc3SSyed Rafiuddin 		.phys_base      = OMAP44XX_MCBSP3_BASE,
247a5b92cc3SSyed Rafiuddin 		.dma_rx_sync    = OMAP44XX_DMA_MCBSP3_RX,
248a5b92cc3SSyed Rafiuddin 		.dma_tx_sync    = OMAP44XX_DMA_MCBSP3_TX,
2499319b9daSJorge Eduardo Candelaria 		.tx_irq         = OMAP44XX_IRQ_MCBSP3,
250d1358657SPaul Walmsley 		/* XXX .ops ? */
251a5b92cc3SSyed Rafiuddin 	},
252a5b92cc3SSyed Rafiuddin 	{
253a5b92cc3SSyed Rafiuddin 		.phys_base      = OMAP44XX_MCBSP4_BASE,
254a5b92cc3SSyed Rafiuddin 		.dma_rx_sync    = OMAP44XX_DMA_MCBSP4_RX,
255a5b92cc3SSyed Rafiuddin 		.dma_tx_sync    = OMAP44XX_DMA_MCBSP4_TX,
2569319b9daSJorge Eduardo Candelaria 		.tx_irq         = OMAP44XX_IRQ_MCBSP4,
257d1358657SPaul Walmsley 		/* XXX .ops ? */
258a5b92cc3SSyed Rafiuddin 	},
259a5b92cc3SSyed Rafiuddin };
260a5b92cc3SSyed Rafiuddin #define OMAP44XX_MCBSP_PDATA_SZ		ARRAY_SIZE(omap44xx_mcbsp_pdata)
261c8c99699SJanusz Krzysztofik #define OMAP44XX_MCBSP_REG_NUM		(OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
262a5b92cc3SSyed Rafiuddin 
263b4b58f58SChandra Shekhar static int __init omap2_mcbsp_init(void)
26478673bc8SEduardo Valentin {
265c8c99699SJanusz Krzysztofik 	if (cpu_is_omap2420()) {
26605228c35SJarkko Nikula 		omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ;
267c8c99699SJanusz Krzysztofik 		omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16);
268c8c99699SJanusz Krzysztofik 	} else if (cpu_is_omap2430()) {
26905228c35SJarkko Nikula 		omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ;
270c8c99699SJanusz Krzysztofik 		omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32);
271c8c99699SJanusz Krzysztofik 	} else if (cpu_is_omap34xx()) {
272b4b58f58SChandra Shekhar 		omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ;
273c8c99699SJanusz Krzysztofik 		omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32);
274c8c99699SJanusz Krzysztofik 	} else if (cpu_is_omap44xx()) {
275a5b92cc3SSyed Rafiuddin 		omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ;
276c8c99699SJanusz Krzysztofik 		omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32);
277c8c99699SJanusz Krzysztofik 	}
278b4b58f58SChandra Shekhar 
279b4b58f58SChandra Shekhar 	mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
280b4b58f58SChandra Shekhar 								GFP_KERNEL);
281b4b58f58SChandra Shekhar 	if (!mcbsp_ptr)
282b4b58f58SChandra Shekhar 		return -ENOMEM;
283b4b58f58SChandra Shekhar 
28405228c35SJarkko Nikula 	if (cpu_is_omap2420())
28505228c35SJarkko Nikula 		omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata,
28605228c35SJarkko Nikula 						OMAP2420_MCBSP_PDATA_SZ);
28705228c35SJarkko Nikula 	if (cpu_is_omap2430())
28805228c35SJarkko Nikula 		omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata,
28905228c35SJarkko Nikula 						OMAP2430_MCBSP_PDATA_SZ);
2909c8e3a0fSChandra Shekhar 	if (cpu_is_omap34xx())
2919c8e3a0fSChandra Shekhar 		omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata,
2929c8e3a0fSChandra Shekhar 						OMAP34XX_MCBSP_PDATA_SZ);
293a5b92cc3SSyed Rafiuddin 	if (cpu_is_omap44xx())
294a5b92cc3SSyed Rafiuddin 		omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata,
295a5b92cc3SSyed Rafiuddin 						OMAP44XX_MCBSP_PDATA_SZ);
29678673bc8SEduardo Valentin 
29778673bc8SEduardo Valentin 	return omap_mcbsp_init();
29878673bc8SEduardo Valentin }
29978673bc8SEduardo Valentin arch_initcall(omap2_mcbsp_init);
300