diff options
Diffstat (limited to 'arch/arm/mach-davinci/devices-da8xx.c')
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 80 |
1 files changed, 73 insertions, 7 deletions
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index b85b781b05fd..ddfdd820e6f2 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -463,16 +463,23 @@ static struct resource da830_mcasp1_resources[] = { }, /* TX event */ { + .name = "tx", .start = DAVINCI_DA830_DMA_MCASP1_AXEVT, .end = DAVINCI_DA830_DMA_MCASP1_AXEVT, .flags = IORESOURCE_DMA, }, /* RX event */ { + .name = "rx", .start = DAVINCI_DA830_DMA_MCASP1_AREVT, .end = DAVINCI_DA830_DMA_MCASP1_AREVT, .flags = IORESOURCE_DMA, }, + { + .name = "common", + .start = IRQ_DA8XX_MCASPINT, + .flags = IORESOURCE_IRQ, + }, }; static struct platform_device da830_mcasp1_device = { @@ -482,6 +489,41 @@ static struct platform_device da830_mcasp1_device = { .resource = da830_mcasp1_resources, }; +static struct resource da830_mcasp2_resources[] = { + { + .name = "mpu", + .start = DAVINCI_DA830_MCASP2_REG_BASE, + .end = DAVINCI_DA830_MCASP2_REG_BASE + (SZ_1K * 12) - 1, + .flags = IORESOURCE_MEM, + }, + /* TX event */ + { + .name = "tx", + .start = DAVINCI_DA830_DMA_MCASP2_AXEVT, + .end = DAVINCI_DA830_DMA_MCASP2_AXEVT, + .flags = IORESOURCE_DMA, + }, + /* RX event */ + { + .name = "rx", + .start = DAVINCI_DA830_DMA_MCASP2_AREVT, + .end = DAVINCI_DA830_DMA_MCASP2_AREVT, + .flags = IORESOURCE_DMA, + }, + { + .name = "common", + .start = IRQ_DA8XX_MCASPINT, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device da830_mcasp2_device = { + .name = "davinci-mcasp", + .id = 2, + .num_resources = ARRAY_SIZE(da830_mcasp2_resources), + .resource = da830_mcasp2_resources, +}; + static struct resource da850_mcasp_resources[] = { { .name = "mpu", @@ -491,16 +533,23 @@ static struct resource da850_mcasp_resources[] = { }, /* TX event */ { + .name = "tx", .start = DAVINCI_DA8XX_DMA_MCASP0_AXEVT, .end = DAVINCI_DA8XX_DMA_MCASP0_AXEVT, .flags = IORESOURCE_DMA, }, /* RX event */ { + .name = "rx", .start = DAVINCI_DA8XX_DMA_MCASP0_AREVT, .end = DAVINCI_DA8XX_DMA_MCASP0_AREVT, .flags = IORESOURCE_DMA, }, + { + .name = "common", + .start = IRQ_DA8XX_MCASPINT, + .flags = IORESOURCE_IRQ, + }, }; static struct platform_device da850_mcasp_device = { @@ -512,14 +561,31 @@ static struct platform_device da850_mcasp_device = { void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata) { - /* DA830/OMAP-L137 has 3 instances of McASP */ - if (cpu_is_davinci_da830() && id == 1) { - da830_mcasp1_device.dev.platform_data = pdata; - platform_device_register(&da830_mcasp1_device); - } else if (cpu_is_davinci_da850()) { - da850_mcasp_device.dev.platform_data = pdata; - platform_device_register(&da850_mcasp_device); + struct platform_device *pdev; + + switch (id) { + case 0: + /* Valid for DA830/OMAP-L137 or DA850/OMAP-L138 */ + pdev = &da850_mcasp_device; + break; + case 1: + /* Valid for DA830/OMAP-L137 only */ + if (!cpu_is_davinci_da830()) + return; + pdev = &da830_mcasp1_device; + break; + case 2: + /* Valid for DA830/OMAP-L137 only */ + if (!cpu_is_davinci_da830()) + return; + pdev = &da830_mcasp2_device; + break; + default: + return; } + + pdev->dev.platform_data = pdata; + platform_device_register(pdev); } static struct resource da8xx_pruss_resources[] = { |