aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-04-10 20:05:01 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-11 12:51:30 -0400
commitcb00e3a16dc60618c1ce56882e8bde1ad55069d9 (patch)
tree4c0b6a71f220cb860dd7e83ab0408926bb654d9b
parenta7c1a644e16400a33e122f2b03c6a34240001b49 (diff)
ASoC: samsung: use irq resource for idma
With multiplatform kernels, we cannot use hardwired IRQ numbers in device drivers. This changes the idma driver to use a proper resource, like all other drivers do. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--arch/arm/plat-samsung/devs.c6
-rw-r--r--sound/soc/samsung/idma.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 51afedda9ab6..d81d9fbc8866 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -146,14 +146,20 @@ struct platform_device s3c_device_camif = {
146 146
147/* ASOC DMA */ 147/* ASOC DMA */
148 148
149#ifdef CONFIG_PLAT_S5P
150static struct resource samsung_asoc_idma_resource = DEFINE_RES_IRQ(IRQ_I2S0);
151
149struct platform_device samsung_asoc_idma = { 152struct platform_device samsung_asoc_idma = {
150 .name = "samsung-idma", 153 .name = "samsung-idma",
151 .id = -1, 154 .id = -1,
155 .num_resources = 1,
156 .resource = &samsung_asoc_idma_resource,
152 .dev = { 157 .dev = {
153 .dma_mask = &samsung_device_dma_mask, 158 .dma_mask = &samsung_device_dma_mask,
154 .coherent_dma_mask = DMA_BIT_MASK(32), 159 .coherent_dma_mask = DMA_BIT_MASK(32),
155 } 160 }
156}; 161};
162#endif
157 163
158/* FB */ 164/* FB */
159 165
diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c
index a07950b0c8ce..f36a5414f5c4 100644
--- a/sound/soc/samsung/idma.c
+++ b/sound/soc/samsung/idma.c
@@ -68,6 +68,8 @@ static struct idma_info {
68 dma_addr_t lp_tx_addr; 68 dma_addr_t lp_tx_addr;
69} idma; 69} idma;
70 70
71static int idma_irq;
72
71static void idma_getpos(dma_addr_t *src) 73static void idma_getpos(dma_addr_t *src)
72{ 74{
73 *src = idma.lp_tx_addr + 75 *src = idma.lp_tx_addr +
@@ -305,7 +307,7 @@ static int idma_open(struct snd_pcm_substream *substream)
305 if (prtd == NULL) 307 if (prtd == NULL)
306 return -ENOMEM; 308 return -ENOMEM;
307 309
308 ret = request_irq(IRQ_I2S0, iis_irq, 0, "i2s", prtd); 310 ret = request_irq(idma_irq, iis_irq, 0, "i2s", prtd);
309 if (ret < 0) { 311 if (ret < 0) {
310 pr_err("fail to claim i2s irq , ret = %d\n", ret); 312 pr_err("fail to claim i2s irq , ret = %d\n", ret);
311 kfree(prtd); 313 kfree(prtd);
@@ -324,7 +326,7 @@ static int idma_close(struct snd_pcm_substream *substream)
324 struct snd_pcm_runtime *runtime = substream->runtime; 326 struct snd_pcm_runtime *runtime = substream->runtime;
325 struct idma_ctrl *prtd = runtime->private_data; 327 struct idma_ctrl *prtd = runtime->private_data;
326 328
327 free_irq(IRQ_I2S0, prtd); 329 free_irq(idma_irq, prtd);
328 330
329 if (!prtd) 331 if (!prtd)
330 pr_err("idma_close called with prtd == NULL\n"); 332 pr_err("idma_close called with prtd == NULL\n");
@@ -418,6 +420,10 @@ static struct snd_soc_platform_driver asoc_idma_platform = {
418 420
419static int asoc_idma_platform_probe(struct platform_device *pdev) 421static int asoc_idma_platform_probe(struct platform_device *pdev)
420{ 422{
423 idma_irq = platform_get_irq(pdev, 0);
424 if (idma_irq < 0)
425 return idma_irq;
426
421 return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform); 427 return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform);
422} 428}
423 429