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) 37425925ddSJarkko 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) 50425925ddSJarkko 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 10759b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2420 108*3cf32bbaSKishon Vijay Abraham I struct resource omap2420_mcbsp_res[][6] = { 10978673bc8SEduardo Valentin { 110*3cf32bbaSKishon Vijay Abraham I { 111*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_MCBSP1_BASE, 112*3cf32bbaSKishon Vijay Abraham I .end = OMAP24XX_MCBSP1_BASE + SZ_256, 113*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 11478673bc8SEduardo Valentin }, 11578673bc8SEduardo Valentin { 116*3cf32bbaSKishon Vijay Abraham I .name = "rx", 117*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP1_IRQ_RX, 118*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 119*3cf32bbaSKishon Vijay Abraham I }, 120*3cf32bbaSKishon Vijay Abraham I { 121*3cf32bbaSKishon Vijay Abraham I .name = "tx", 122*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP1_IRQ_TX, 123*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 124*3cf32bbaSKishon Vijay Abraham I }, 125*3cf32bbaSKishon Vijay Abraham I { 126*3cf32bbaSKishon Vijay Abraham I .name = "rx", 127*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP1_RX, 128*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 129*3cf32bbaSKishon Vijay Abraham I }, 130*3cf32bbaSKishon Vijay Abraham I { 131*3cf32bbaSKishon Vijay Abraham I .name = "tx", 132*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP1_TX, 133*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 134*3cf32bbaSKishon Vijay Abraham I }, 135*3cf32bbaSKishon Vijay Abraham I }, 136*3cf32bbaSKishon Vijay Abraham I { 137*3cf32bbaSKishon Vijay Abraham I { 138*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_MCBSP2_BASE, 139*3cf32bbaSKishon Vijay Abraham I .end = OMAP24XX_MCBSP2_BASE + SZ_256, 140*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 141*3cf32bbaSKishon Vijay Abraham I }, 142*3cf32bbaSKishon Vijay Abraham I { 143*3cf32bbaSKishon Vijay Abraham I .name = "rx", 144*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP2_IRQ_RX, 145*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 146*3cf32bbaSKishon Vijay Abraham I }, 147*3cf32bbaSKishon Vijay Abraham I { 148*3cf32bbaSKishon Vijay Abraham I .name = "tx", 149*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP2_IRQ_TX, 150*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 151*3cf32bbaSKishon Vijay Abraham I }, 152*3cf32bbaSKishon Vijay Abraham I { 153*3cf32bbaSKishon Vijay Abraham I .name = "rx", 154*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP2_RX, 155*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 156*3cf32bbaSKishon Vijay Abraham I }, 157*3cf32bbaSKishon Vijay Abraham I { 158*3cf32bbaSKishon Vijay Abraham I .name = "tx", 159*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP2_TX, 160*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 161*3cf32bbaSKishon Vijay Abraham I }, 16278673bc8SEduardo Valentin }, 16378673bc8SEduardo Valentin }; 164*3cf32bbaSKishon Vijay Abraham I #define OMAP2420_MCBSP_RES_SZ ARRAY_SIZE(omap2420_mcbsp_res[1]) 165*3cf32bbaSKishon Vijay Abraham I #define OMAP2420_MCBSP_COUNT ARRAY_SIZE(omap2420_mcbsp_res) 16678673bc8SEduardo Valentin #else 167*3cf32bbaSKishon Vijay Abraham I #define omap2420_mcbsp_res NULL 168*3cf32bbaSKishon Vijay Abraham I #define OMAP2420_MCBSP_RES_SZ 0 169*3cf32bbaSKishon Vijay Abraham I #define OMAP2420_MCBSP_COUNT 0 17005228c35SJarkko Nikula #endif 17105228c35SJarkko Nikula 172*3cf32bbaSKishon Vijay Abraham I #define omap2420_mcbsp_pdata NULL 173*3cf32bbaSKishon Vijay Abraham I 17459b479e0STony Lindgren #ifdef CONFIG_SOC_OMAP2430 175*3cf32bbaSKishon Vijay Abraham I struct resource omap2430_mcbsp_res[][6] = { 17605228c35SJarkko Nikula { 177*3cf32bbaSKishon Vijay Abraham I { 178*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_MCBSP1_BASE, 179*3cf32bbaSKishon Vijay Abraham I .end = OMAP24XX_MCBSP1_BASE + SZ_256, 180*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 18105228c35SJarkko Nikula }, 18205228c35SJarkko Nikula { 183*3cf32bbaSKishon Vijay Abraham I .name = "rx", 184*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP1_IRQ_RX, 185*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 18605228c35SJarkko Nikula }, 18705228c35SJarkko Nikula { 188*3cf32bbaSKishon Vijay Abraham I .name = "tx", 189*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP1_IRQ_TX, 190*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 19105228c35SJarkko Nikula }, 19205228c35SJarkko Nikula { 193*3cf32bbaSKishon Vijay Abraham I .name = "rx", 194*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP1_RX, 195*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 19605228c35SJarkko Nikula }, 19705228c35SJarkko Nikula { 198*3cf32bbaSKishon Vijay Abraham I .name = "tx", 199*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP1_TX, 200*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 201*3cf32bbaSKishon Vijay Abraham I }, 202*3cf32bbaSKishon Vijay Abraham I }, 203*3cf32bbaSKishon Vijay Abraham I { 204*3cf32bbaSKishon Vijay Abraham I { 205*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_MCBSP2_BASE, 206*3cf32bbaSKishon Vijay Abraham I .end = OMAP24XX_MCBSP2_BASE + SZ_256, 207*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 208*3cf32bbaSKishon Vijay Abraham I }, 209*3cf32bbaSKishon Vijay Abraham I { 210*3cf32bbaSKishon Vijay Abraham I .name = "rx", 211*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP2_IRQ_RX, 212*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 213*3cf32bbaSKishon Vijay Abraham I }, 214*3cf32bbaSKishon Vijay Abraham I { 215*3cf32bbaSKishon Vijay Abraham I .name = "tx", 216*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP2_IRQ_TX, 217*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 218*3cf32bbaSKishon Vijay Abraham I }, 219*3cf32bbaSKishon Vijay Abraham I { 220*3cf32bbaSKishon Vijay Abraham I .name = "rx", 221*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP2_RX, 222*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 223*3cf32bbaSKishon Vijay Abraham I }, 224*3cf32bbaSKishon Vijay Abraham I { 225*3cf32bbaSKishon Vijay Abraham I .name = "tx", 226*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP2_TX, 227*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 228*3cf32bbaSKishon Vijay Abraham I }, 229*3cf32bbaSKishon Vijay Abraham I }, 230*3cf32bbaSKishon Vijay Abraham I { 231*3cf32bbaSKishon Vijay Abraham I { 232*3cf32bbaSKishon Vijay Abraham I .start = OMAP2430_MCBSP3_BASE, 233*3cf32bbaSKishon Vijay Abraham I .end = OMAP2430_MCBSP3_BASE + SZ_256, 234*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 235*3cf32bbaSKishon Vijay Abraham I }, 236*3cf32bbaSKishon Vijay Abraham I { 237*3cf32bbaSKishon Vijay Abraham I .name = "rx", 238*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP3_IRQ_RX, 239*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 240*3cf32bbaSKishon Vijay Abraham I }, 241*3cf32bbaSKishon Vijay Abraham I { 242*3cf32bbaSKishon Vijay Abraham I .name = "tx", 243*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP3_IRQ_TX, 244*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 245*3cf32bbaSKishon Vijay Abraham I }, 246*3cf32bbaSKishon Vijay Abraham I { 247*3cf32bbaSKishon Vijay Abraham I .name = "rx", 248*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP3_RX, 249*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 250*3cf32bbaSKishon Vijay Abraham I }, 251*3cf32bbaSKishon Vijay Abraham I { 252*3cf32bbaSKishon Vijay Abraham I .name = "tx", 253*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP3_TX, 254*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 255*3cf32bbaSKishon Vijay Abraham I }, 256*3cf32bbaSKishon Vijay Abraham I }, 257*3cf32bbaSKishon Vijay Abraham I { 258*3cf32bbaSKishon Vijay Abraham I { 259*3cf32bbaSKishon Vijay Abraham I .start = OMAP2430_MCBSP4_BASE, 260*3cf32bbaSKishon Vijay Abraham I .end = OMAP2430_MCBSP4_BASE + SZ_256, 261*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 262*3cf32bbaSKishon Vijay Abraham I }, 263*3cf32bbaSKishon Vijay Abraham I { 264*3cf32bbaSKishon Vijay Abraham I .name = "rx", 265*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP4_IRQ_RX, 266*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 267*3cf32bbaSKishon Vijay Abraham I }, 268*3cf32bbaSKishon Vijay Abraham I { 269*3cf32bbaSKishon Vijay Abraham I .name = "tx", 270*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP4_IRQ_TX, 271*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 272*3cf32bbaSKishon Vijay Abraham I }, 273*3cf32bbaSKishon Vijay Abraham I { 274*3cf32bbaSKishon Vijay Abraham I .name = "rx", 275*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP4_RX, 276*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 277*3cf32bbaSKishon Vijay Abraham I }, 278*3cf32bbaSKishon Vijay Abraham I { 279*3cf32bbaSKishon Vijay Abraham I .name = "tx", 280*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP4_TX, 281*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 282*3cf32bbaSKishon Vijay Abraham I }, 283*3cf32bbaSKishon Vijay Abraham I }, 284*3cf32bbaSKishon Vijay Abraham I { 285*3cf32bbaSKishon Vijay Abraham I { 286*3cf32bbaSKishon Vijay Abraham I .start = OMAP2430_MCBSP5_BASE, 287*3cf32bbaSKishon Vijay Abraham I .end = OMAP2430_MCBSP5_BASE + SZ_256, 288*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 289*3cf32bbaSKishon Vijay Abraham I }, 290*3cf32bbaSKishon Vijay Abraham I { 291*3cf32bbaSKishon Vijay Abraham I .name = "rx", 292*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP5_IRQ_RX, 293*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 294*3cf32bbaSKishon Vijay Abraham I }, 295*3cf32bbaSKishon Vijay Abraham I { 296*3cf32bbaSKishon Vijay Abraham I .name = "tx", 297*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP5_IRQ_TX, 298*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 299*3cf32bbaSKishon Vijay Abraham I }, 300*3cf32bbaSKishon Vijay Abraham I { 301*3cf32bbaSKishon Vijay Abraham I .name = "rx", 302*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP5_RX, 303*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 304*3cf32bbaSKishon Vijay Abraham I }, 305*3cf32bbaSKishon Vijay Abraham I { 306*3cf32bbaSKishon Vijay Abraham I .name = "tx", 307*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP5_TX, 308*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 309*3cf32bbaSKishon Vijay Abraham I }, 31005228c35SJarkko Nikula }, 31105228c35SJarkko Nikula }; 312*3cf32bbaSKishon Vijay Abraham I #define OMAP2430_MCBSP_RES_SZ ARRAY_SIZE(omap2430_mcbsp_res[1]) 313*3cf32bbaSKishon Vijay Abraham I #define OMAP2430_MCBSP_COUNT ARRAY_SIZE(omap2430_mcbsp_res) 31405228c35SJarkko Nikula #else 315*3cf32bbaSKishon Vijay Abraham I #define omap2430_mcbsp_res NULL 316*3cf32bbaSKishon Vijay Abraham I #define OMAP2430_MCBSP_RES_SZ 0 317*3cf32bbaSKishon Vijay Abraham I #define OMAP2430_MCBSP_COUNT 0 31878673bc8SEduardo Valentin #endif 31978673bc8SEduardo Valentin 320*3cf32bbaSKishon Vijay Abraham I #define omap2430_mcbsp_pdata NULL 321*3cf32bbaSKishon Vijay Abraham I 322a8eb7ca0STony Lindgren #ifdef CONFIG_ARCH_OMAP3 323*3cf32bbaSKishon Vijay Abraham I struct resource omap34xx_mcbsp_res[][7] = { 324*3cf32bbaSKishon Vijay Abraham I { 325*3cf32bbaSKishon Vijay Abraham I { 326*3cf32bbaSKishon Vijay Abraham I .start = OMAP34XX_MCBSP1_BASE, 327*3cf32bbaSKishon Vijay Abraham I .end = OMAP34XX_MCBSP1_BASE + SZ_256, 328*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 329*3cf32bbaSKishon Vijay Abraham I }, 330*3cf32bbaSKishon Vijay Abraham I { 331*3cf32bbaSKishon Vijay Abraham I .name = "rx", 332*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP1_IRQ_RX, 333*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 334*3cf32bbaSKishon Vijay Abraham I }, 335*3cf32bbaSKishon Vijay Abraham I { 336*3cf32bbaSKishon Vijay Abraham I .name = "tx", 337*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP1_IRQ_TX, 338*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 339*3cf32bbaSKishon Vijay Abraham I }, 340*3cf32bbaSKishon Vijay Abraham I { 341*3cf32bbaSKishon Vijay Abraham I .name = "rx", 342*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP1_RX, 343*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 344*3cf32bbaSKishon Vijay Abraham I }, 345*3cf32bbaSKishon Vijay Abraham I { 346*3cf32bbaSKishon Vijay Abraham I .name = "tx", 347*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP1_TX, 348*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 349*3cf32bbaSKishon Vijay Abraham I }, 350*3cf32bbaSKishon Vijay Abraham I }, 351*3cf32bbaSKishon Vijay Abraham I { 352*3cf32bbaSKishon Vijay Abraham I { 353*3cf32bbaSKishon Vijay Abraham I .start = OMAP34XX_MCBSP2_BASE, 354*3cf32bbaSKishon Vijay Abraham I .end = OMAP34XX_MCBSP2_BASE + SZ_256, 355*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 356*3cf32bbaSKishon Vijay Abraham I }, 357*3cf32bbaSKishon Vijay Abraham I { 358*3cf32bbaSKishon Vijay Abraham I .name = "sidetone", 359*3cf32bbaSKishon Vijay Abraham I .start = OMAP34XX_MCBSP2_ST_BASE, 360*3cf32bbaSKishon Vijay Abraham I .end = OMAP34XX_MCBSP2_ST_BASE + SZ_256, 361*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 362*3cf32bbaSKishon Vijay Abraham I }, 363*3cf32bbaSKishon Vijay Abraham I { 364*3cf32bbaSKishon Vijay Abraham I .name = "rx", 365*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP2_IRQ_RX, 366*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 367*3cf32bbaSKishon Vijay Abraham I }, 368*3cf32bbaSKishon Vijay Abraham I { 369*3cf32bbaSKishon Vijay Abraham I .name = "tx", 370*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP2_IRQ_TX, 371*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 372*3cf32bbaSKishon Vijay Abraham I }, 373*3cf32bbaSKishon Vijay Abraham I { 374*3cf32bbaSKishon Vijay Abraham I .name = "rx", 375*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP2_RX, 376*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 377*3cf32bbaSKishon Vijay Abraham I }, 378*3cf32bbaSKishon Vijay Abraham I { 379*3cf32bbaSKishon Vijay Abraham I .name = "tx", 380*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP2_TX, 381*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 382*3cf32bbaSKishon Vijay Abraham I }, 383*3cf32bbaSKishon Vijay Abraham I }, 384*3cf32bbaSKishon Vijay Abraham I { 385*3cf32bbaSKishon Vijay Abraham I { 386*3cf32bbaSKishon Vijay Abraham I .start = OMAP34XX_MCBSP3_BASE, 387*3cf32bbaSKishon Vijay Abraham I .end = OMAP34XX_MCBSP3_BASE + SZ_256, 388*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 389*3cf32bbaSKishon Vijay Abraham I }, 390*3cf32bbaSKishon Vijay Abraham I { 391*3cf32bbaSKishon Vijay Abraham I .name = "sidetone", 392*3cf32bbaSKishon Vijay Abraham I .start = OMAP34XX_MCBSP3_ST_BASE, 393*3cf32bbaSKishon Vijay Abraham I .end = OMAP34XX_MCBSP3_ST_BASE + SZ_256, 394*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 395*3cf32bbaSKishon Vijay Abraham I }, 396*3cf32bbaSKishon Vijay Abraham I { 397*3cf32bbaSKishon Vijay Abraham I .name = "rx", 398*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP3_IRQ_RX, 399*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 400*3cf32bbaSKishon Vijay Abraham I }, 401*3cf32bbaSKishon Vijay Abraham I { 402*3cf32bbaSKishon Vijay Abraham I .name = "tx", 403*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP3_IRQ_TX, 404*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 405*3cf32bbaSKishon Vijay Abraham I }, 406*3cf32bbaSKishon Vijay Abraham I { 407*3cf32bbaSKishon Vijay Abraham I .name = "rx", 408*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP3_RX, 409*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 410*3cf32bbaSKishon Vijay Abraham I }, 411*3cf32bbaSKishon Vijay Abraham I { 412*3cf32bbaSKishon Vijay Abraham I .name = "tx", 413*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP3_TX, 414*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 415*3cf32bbaSKishon Vijay Abraham I }, 416*3cf32bbaSKishon Vijay Abraham I }, 417*3cf32bbaSKishon Vijay Abraham I { 418*3cf32bbaSKishon Vijay Abraham I { 419*3cf32bbaSKishon Vijay Abraham I .start = OMAP34XX_MCBSP4_BASE, 420*3cf32bbaSKishon Vijay Abraham I .end = OMAP34XX_MCBSP4_BASE + SZ_256, 421*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 422*3cf32bbaSKishon Vijay Abraham I }, 423*3cf32bbaSKishon Vijay Abraham I { 424*3cf32bbaSKishon Vijay Abraham I .name = "rx", 425*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP4_IRQ_RX, 426*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 427*3cf32bbaSKishon Vijay Abraham I }, 428*3cf32bbaSKishon Vijay Abraham I { 429*3cf32bbaSKishon Vijay Abraham I .name = "tx", 430*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP4_IRQ_TX, 431*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 432*3cf32bbaSKishon Vijay Abraham I }, 433*3cf32bbaSKishon Vijay Abraham I { 434*3cf32bbaSKishon Vijay Abraham I .name = "rx", 435*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP4_RX, 436*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 437*3cf32bbaSKishon Vijay Abraham I }, 438*3cf32bbaSKishon Vijay Abraham I { 439*3cf32bbaSKishon Vijay Abraham I .name = "tx", 440*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP4_TX, 441*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 442*3cf32bbaSKishon Vijay Abraham I }, 443*3cf32bbaSKishon Vijay Abraham I }, 444*3cf32bbaSKishon Vijay Abraham I { 445*3cf32bbaSKishon Vijay Abraham I { 446*3cf32bbaSKishon Vijay Abraham I .start = OMAP34XX_MCBSP5_BASE, 447*3cf32bbaSKishon Vijay Abraham I .end = OMAP34XX_MCBSP5_BASE + SZ_256, 448*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 449*3cf32bbaSKishon Vijay Abraham I }, 450*3cf32bbaSKishon Vijay Abraham I { 451*3cf32bbaSKishon Vijay Abraham I .name = "rx", 452*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP5_IRQ_RX, 453*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 454*3cf32bbaSKishon Vijay Abraham I }, 455*3cf32bbaSKishon Vijay Abraham I { 456*3cf32bbaSKishon Vijay Abraham I .name = "tx", 457*3cf32bbaSKishon Vijay Abraham I .start = INT_24XX_MCBSP5_IRQ_TX, 458*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 459*3cf32bbaSKishon Vijay Abraham I }, 460*3cf32bbaSKishon Vijay Abraham I { 461*3cf32bbaSKishon Vijay Abraham I .name = "rx", 462*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP5_RX, 463*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 464*3cf32bbaSKishon Vijay Abraham I }, 465*3cf32bbaSKishon Vijay Abraham I { 466*3cf32bbaSKishon Vijay Abraham I .name = "tx", 467*3cf32bbaSKishon Vijay Abraham I .start = OMAP24XX_DMA_MCBSP5_TX, 468*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 469*3cf32bbaSKishon Vijay Abraham I }, 470*3cf32bbaSKishon Vijay Abraham I }, 471*3cf32bbaSKishon Vijay Abraham I }; 472*3cf32bbaSKishon Vijay Abraham I 47378673bc8SEduardo Valentin static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { 47478673bc8SEduardo Valentin { 475451fd82dSPeter Ujfalusi .buffer_size = 0x80, /* The FIFO has 128 locations */ 47678673bc8SEduardo Valentin }, 47778673bc8SEduardo Valentin { 478451fd82dSPeter Ujfalusi .buffer_size = 0x500, /* The FIFO has 1024 + 256 locations */ 47978673bc8SEduardo Valentin }, 4809c8e3a0fSChandra Shekhar { 481451fd82dSPeter Ujfalusi .buffer_size = 0x80, /* The FIFO has 128 locations */ 4829c8e3a0fSChandra Shekhar }, 4839c8e3a0fSChandra Shekhar { 484451fd82dSPeter Ujfalusi .buffer_size = 0x80, /* The FIFO has 128 locations */ 4859c8e3a0fSChandra Shekhar }, 4869c8e3a0fSChandra Shekhar { 487451fd82dSPeter Ujfalusi .buffer_size = 0x80, /* The FIFO has 128 locations */ 4889c8e3a0fSChandra Shekhar }, 48978673bc8SEduardo Valentin }; 490*3cf32bbaSKishon Vijay Abraham I #define OMAP34XX_MCBSP_RES_SZ ARRAY_SIZE(omap34xx_mcbsp_res[1]) 491*3cf32bbaSKishon Vijay Abraham I #define OMAP34XX_MCBSP_COUNT ARRAY_SIZE(omap34xx_mcbsp_res) 49278673bc8SEduardo Valentin #else 49378673bc8SEduardo Valentin #define omap34xx_mcbsp_pdata NULL 494*3cf32bbaSKishon Vijay Abraham I #define omap34XX_mcbsp_res NULL 495*3cf32bbaSKishon Vijay Abraham I #define OMAP34XX_MCBSP_RES_SZ 0 496*3cf32bbaSKishon Vijay Abraham I #define OMAP34XX_MCBSP_COUNT 0 49778673bc8SEduardo Valentin #endif 49878673bc8SEduardo Valentin 499*3cf32bbaSKishon Vijay Abraham I struct resource omap44xx_mcbsp_res[][6] = { 500a5b92cc3SSyed Rafiuddin { 501*3cf32bbaSKishon Vijay Abraham I { 502*3cf32bbaSKishon Vijay Abraham I .name = "mpu", 503*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_MCBSP1_BASE, 504*3cf32bbaSKishon Vijay Abraham I .end = OMAP44XX_MCBSP1_BASE + SZ_256, 505*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 506a5b92cc3SSyed Rafiuddin }, 507a5b92cc3SSyed Rafiuddin { 508*3cf32bbaSKishon Vijay Abraham I .name = "dma", 509*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_MCBSP1_DMA_BASE, 510*3cf32bbaSKishon Vijay Abraham I .end = OMAP44XX_MCBSP1_DMA_BASE + SZ_256, 511*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 512a5b92cc3SSyed Rafiuddin }, 513a5b92cc3SSyed Rafiuddin { 514*3cf32bbaSKishon Vijay Abraham I .name = "rx", 515*3cf32bbaSKishon Vijay Abraham I .start = 0, 516*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 517a5b92cc3SSyed Rafiuddin }, 518a5b92cc3SSyed Rafiuddin { 519*3cf32bbaSKishon Vijay Abraham I .name = "tx", 520*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_IRQ_MCBSP1, 521*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 522*3cf32bbaSKishon Vijay Abraham I }, 523*3cf32bbaSKishon Vijay Abraham I { 524*3cf32bbaSKishon Vijay Abraham I .name = "rx", 525*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_DMA_MCBSP1_RX, 526*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 527*3cf32bbaSKishon Vijay Abraham I }, 528*3cf32bbaSKishon Vijay Abraham I { 529*3cf32bbaSKishon Vijay Abraham I .name = "tx", 530*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_DMA_MCBSP1_TX, 531*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 532*3cf32bbaSKishon Vijay Abraham I }, 533*3cf32bbaSKishon Vijay Abraham I }, 534*3cf32bbaSKishon Vijay Abraham I { 535*3cf32bbaSKishon Vijay Abraham I { 536*3cf32bbaSKishon Vijay Abraham I .name = "mpu", 537*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_MCBSP2_BASE, 538*3cf32bbaSKishon Vijay Abraham I .end = OMAP44XX_MCBSP2_BASE + SZ_256, 539*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 540*3cf32bbaSKishon Vijay Abraham I }, 541*3cf32bbaSKishon Vijay Abraham I { 542*3cf32bbaSKishon Vijay Abraham I .name = "dma", 543*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_MCBSP2_DMA_BASE, 544*3cf32bbaSKishon Vijay Abraham I .end = OMAP44XX_MCBSP2_DMA_BASE + SZ_256, 545*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 546*3cf32bbaSKishon Vijay Abraham I }, 547*3cf32bbaSKishon Vijay Abraham I { 548*3cf32bbaSKishon Vijay Abraham I .name = "rx", 549*3cf32bbaSKishon Vijay Abraham I .start = 0, 550*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 551*3cf32bbaSKishon Vijay Abraham I }, 552*3cf32bbaSKishon Vijay Abraham I { 553*3cf32bbaSKishon Vijay Abraham I .name = "tx", 554*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_IRQ_MCBSP2, 555*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 556*3cf32bbaSKishon Vijay Abraham I }, 557*3cf32bbaSKishon Vijay Abraham I { 558*3cf32bbaSKishon Vijay Abraham I .name = "rx", 559*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_DMA_MCBSP2_RX, 560*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 561*3cf32bbaSKishon Vijay Abraham I }, 562*3cf32bbaSKishon Vijay Abraham I { 563*3cf32bbaSKishon Vijay Abraham I .name = "tx", 564*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_DMA_MCBSP2_TX, 565*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 566*3cf32bbaSKishon Vijay Abraham I }, 567*3cf32bbaSKishon Vijay Abraham I }, 568*3cf32bbaSKishon Vijay Abraham I { 569*3cf32bbaSKishon Vijay Abraham I { 570*3cf32bbaSKishon Vijay Abraham I .name = "mpu", 571*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_MCBSP3_BASE, 572*3cf32bbaSKishon Vijay Abraham I .end = OMAP44XX_MCBSP3_BASE + SZ_256, 573*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 574*3cf32bbaSKishon Vijay Abraham I }, 575*3cf32bbaSKishon Vijay Abraham I { 576*3cf32bbaSKishon Vijay Abraham I .name = "dma", 577*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_MCBSP3_DMA_BASE, 578*3cf32bbaSKishon Vijay Abraham I .end = OMAP44XX_MCBSP3_DMA_BASE + SZ_256, 579*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 580*3cf32bbaSKishon Vijay Abraham I }, 581*3cf32bbaSKishon Vijay Abraham I { 582*3cf32bbaSKishon Vijay Abraham I .name = "rx", 583*3cf32bbaSKishon Vijay Abraham I .start = 0, 584*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 585*3cf32bbaSKishon Vijay Abraham I }, 586*3cf32bbaSKishon Vijay Abraham I { 587*3cf32bbaSKishon Vijay Abraham I .name = "tx", 588*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_IRQ_MCBSP3, 589*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 590*3cf32bbaSKishon Vijay Abraham I }, 591*3cf32bbaSKishon Vijay Abraham I { 592*3cf32bbaSKishon Vijay Abraham I .name = "rx", 593*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_DMA_MCBSP3_RX, 594*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 595*3cf32bbaSKishon Vijay Abraham I }, 596*3cf32bbaSKishon Vijay Abraham I { 597*3cf32bbaSKishon Vijay Abraham I .name = "tx", 598*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_DMA_MCBSP3_TX, 599*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 600*3cf32bbaSKishon Vijay Abraham I }, 601*3cf32bbaSKishon Vijay Abraham I }, 602*3cf32bbaSKishon Vijay Abraham I { 603*3cf32bbaSKishon Vijay Abraham I { 604*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_MCBSP4_BASE, 605*3cf32bbaSKishon Vijay Abraham I .end = OMAP44XX_MCBSP4_BASE + SZ_256, 606*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_MEM, 607*3cf32bbaSKishon Vijay Abraham I }, 608*3cf32bbaSKishon Vijay Abraham I { 609*3cf32bbaSKishon Vijay Abraham I .name = "rx", 610*3cf32bbaSKishon Vijay Abraham I .start = 0, 611*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 612*3cf32bbaSKishon Vijay Abraham I }, 613*3cf32bbaSKishon Vijay Abraham I { 614*3cf32bbaSKishon Vijay Abraham I .name = "tx", 615*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_IRQ_MCBSP4, 616*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_IRQ, 617*3cf32bbaSKishon Vijay Abraham I }, 618*3cf32bbaSKishon Vijay Abraham I { 619*3cf32bbaSKishon Vijay Abraham I .name = "rx", 620*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_DMA_MCBSP4_RX, 621*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 622*3cf32bbaSKishon Vijay Abraham I }, 623*3cf32bbaSKishon Vijay Abraham I { 624*3cf32bbaSKishon Vijay Abraham I .name = "tx", 625*3cf32bbaSKishon Vijay Abraham I .start = OMAP44XX_DMA_MCBSP4_TX, 626*3cf32bbaSKishon Vijay Abraham I .flags = IORESOURCE_DMA, 627*3cf32bbaSKishon Vijay Abraham I }, 628a5b92cc3SSyed Rafiuddin }, 629a5b92cc3SSyed Rafiuddin }; 630*3cf32bbaSKishon Vijay Abraham I #define omap44xx_mcbsp_pdata NULL 631*3cf32bbaSKishon Vijay Abraham I #define OMAP44XX_MCBSP_RES_SZ ARRAY_SIZE(omap44xx_mcbsp_res[1]) 632*3cf32bbaSKishon Vijay Abraham I #define OMAP44XX_MCBSP_COUNT ARRAY_SIZE(omap44xx_mcbsp_res) 633a5b92cc3SSyed Rafiuddin 634b4b58f58SChandra Shekhar static int __init omap2_mcbsp_init(void) 63578673bc8SEduardo Valentin { 636*3cf32bbaSKishon Vijay Abraham I if (cpu_is_omap2420()) 637*3cf32bbaSKishon Vijay Abraham I omap_mcbsp_count = OMAP2420_MCBSP_COUNT; 638*3cf32bbaSKishon Vijay Abraham I else if (cpu_is_omap2430()) 639*3cf32bbaSKishon Vijay Abraham I omap_mcbsp_count = OMAP2430_MCBSP_COUNT; 640*3cf32bbaSKishon Vijay Abraham I else if (cpu_is_omap34xx()) 641*3cf32bbaSKishon Vijay Abraham I omap_mcbsp_count = OMAP34XX_MCBSP_COUNT; 642*3cf32bbaSKishon Vijay Abraham I else if (cpu_is_omap44xx()) 643*3cf32bbaSKishon Vijay Abraham I omap_mcbsp_count = OMAP44XX_MCBSP_COUNT; 644b4b58f58SChandra Shekhar 645b4b58f58SChandra Shekhar mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), 646b4b58f58SChandra Shekhar GFP_KERNEL); 647b4b58f58SChandra Shekhar if (!mcbsp_ptr) 648b4b58f58SChandra Shekhar return -ENOMEM; 649b4b58f58SChandra Shekhar 65005228c35SJarkko Nikula if (cpu_is_omap2420()) 651*3cf32bbaSKishon Vijay Abraham I omap_mcbsp_register_board_cfg(omap2420_mcbsp_res[0], 652*3cf32bbaSKishon Vijay Abraham I OMAP2420_MCBSP_RES_SZ, 653*3cf32bbaSKishon Vijay Abraham I omap2420_mcbsp_pdata, 654*3cf32bbaSKishon Vijay Abraham I OMAP2420_MCBSP_COUNT); 65505228c35SJarkko Nikula if (cpu_is_omap2430()) 656*3cf32bbaSKishon Vijay Abraham I omap_mcbsp_register_board_cfg(omap2430_mcbsp_res[0], 657*3cf32bbaSKishon Vijay Abraham I OMAP2420_MCBSP_RES_SZ, 658*3cf32bbaSKishon Vijay Abraham I omap2430_mcbsp_pdata, 659*3cf32bbaSKishon Vijay Abraham I OMAP2430_MCBSP_COUNT); 6609c8e3a0fSChandra Shekhar if (cpu_is_omap34xx()) 661*3cf32bbaSKishon Vijay Abraham I omap_mcbsp_register_board_cfg(omap34xx_mcbsp_res[0], 662*3cf32bbaSKishon Vijay Abraham I OMAP34XX_MCBSP_RES_SZ, 663*3cf32bbaSKishon Vijay Abraham I omap34xx_mcbsp_pdata, 664*3cf32bbaSKishon Vijay Abraham I OMAP34XX_MCBSP_COUNT); 665a5b92cc3SSyed Rafiuddin if (cpu_is_omap44xx()) 666*3cf32bbaSKishon Vijay Abraham I omap_mcbsp_register_board_cfg(omap44xx_mcbsp_res[0], 667*3cf32bbaSKishon Vijay Abraham I OMAP44XX_MCBSP_RES_SZ, 668*3cf32bbaSKishon Vijay Abraham I omap44xx_mcbsp_pdata, 669*3cf32bbaSKishon Vijay Abraham I OMAP44XX_MCBSP_COUNT); 67078673bc8SEduardo Valentin 67178673bc8SEduardo Valentin return omap_mcbsp_init(); 67278673bc8SEduardo Valentin } 67378673bc8SEduardo Valentin arch_initcall(omap2_mcbsp_init); 674