diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-09-14 08:05:54 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 11:13:00 -0400 |
commit | 5a40c57af55b17dabe25854c9245171515bb5d23 (patch) | |
tree | c048a3f3c5d55f567c81dd87b076be4b4239b916 /sound/soc/omap | |
parent | acd08ecd11dce04d077b7dd5cf65eebc157a5bea (diff) |
ASoC: omap-mcpdm: Use platform_get_resource_* to get resources
Get the needed resources in a correct way and avoid using defines for them.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap')
-rw-r--r-- | sound/soc/omap/omap-mcpdm.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index baf92da42aec..f90d5de605c3 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c | |||
@@ -71,15 +71,11 @@ struct omap_mcpdm { | |||
71 | static struct omap_pcm_dma_data omap_mcpdm_dai_dma_params[] = { | 71 | static struct omap_pcm_dma_data omap_mcpdm_dai_dma_params[] = { |
72 | { | 72 | { |
73 | .name = "Audio playback", | 73 | .name = "Audio playback", |
74 | .dma_req = OMAP44XX_DMA_MCPDM_DL, | ||
75 | .data_type = OMAP_DMA_DATA_TYPE_S32, | 74 | .data_type = OMAP_DMA_DATA_TYPE_S32, |
76 | .port_addr = OMAP44XX_MCPDM_L3_BASE + MCPDM_REG_DN_DATA, | ||
77 | }, | 75 | }, |
78 | { | 76 | { |
79 | .name = "Audio capture", | 77 | .name = "Audio capture", |
80 | .dma_req = OMAP44XX_DMA_MCPDM_UP, | ||
81 | .data_type = OMAP_DMA_DATA_TYPE_S32, | 78 | .data_type = OMAP_DMA_DATA_TYPE_S32, |
82 | .port_addr = OMAP44XX_MCPDM_L3_BASE + MCPDM_REG_UP_DATA, | ||
83 | }, | 79 | }, |
84 | }; | 80 | }; |
85 | 81 | ||
@@ -452,10 +448,33 @@ static __devinit int asoc_mcpdm_probe(struct platform_device *pdev) | |||
452 | 448 | ||
453 | mutex_init(&mcpdm->mutex); | 449 | mutex_init(&mcpdm->mutex); |
454 | 450 | ||
451 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); | ||
452 | if (res == NULL) | ||
453 | return -ENOMEM; | ||
454 | |||
455 | omap_mcpdm_dai_dma_params[0].port_addr = res->start + MCPDM_REG_DN_DATA; | ||
456 | omap_mcpdm_dai_dma_params[1].port_addr = res->start + MCPDM_REG_UP_DATA; | ||
457 | |||
455 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 458 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
456 | if (res == NULL) | 459 | if (res == NULL) |
457 | return -ENOMEM; | 460 | return -ENOMEM; |
458 | 461 | ||
462 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "dn_link"); | ||
463 | if (!res) | ||
464 | return -ENODEV; | ||
465 | |||
466 | omap_mcpdm_dai_dma_params[0].dma_req = res->start; | ||
467 | |||
468 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "up_link"); | ||
469 | if (!res) | ||
470 | return -ENODEV; | ||
471 | |||
472 | omap_mcpdm_dai_dma_params[1].dma_req = res->start; | ||
473 | |||
474 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); | ||
475 | if (res == NULL) | ||
476 | return -ENOMEM; | ||
477 | |||
459 | if (!devm_request_mem_region(&pdev->dev, res->start, | 478 | if (!devm_request_mem_region(&pdev->dev, res->start, |
460 | resource_size(res), "McPDM")) | 479 | resource_size(res), "McPDM")) |
461 | return -EBUSY; | 480 | return -EBUSY; |