summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorInha Song <ideal.song@samsung.com>2014-04-30 20:09:09 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:59:48 +0900
commita7258efca5cad5ce831c71d30c2f0861a18a40e2 (patch)
tree6fae337380223dac27056ff7662bc1c52950c917 /sound
parent6f143cfe2f3d73aa53e485171f0dceef4c6c7b35 (diff)
downloadlinux-3.10-a7258efca5cad5ce831c71d30c2f0861a18a40e2.tar.gz
linux-3.10-a7258efca5cad5ce831c71d30c2f0861a18a40e2.tar.bz2
linux-3.10-a7258efca5cad5ce831c71d30c2f0861a18a40e2.zip
ASoC: samsung: Modify i2s driver to support idma
i2s-sec driver uses the internal dma. Because ASoC idma devices are not registered as platform device, asoc_idma_platform_register() should be called for idma registration. Change-Id: Iaf7b0c0e3cdf66f4eda720cd705cf802c391d76b Signed-off-by: Inha Song <ideal.song@samsung.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/samsung/i2s.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index a486c45b86a..4d26f605e38 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
+#include <linux/of_irq.h>
#include <linux/pm_runtime.h>
#include <sound/soc.h>
@@ -994,7 +995,8 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
if (i2s->quirks & QUIRK_SEC_DAI)
idma_reg_addr_init(i2s->addr,
- i2s->sec_dai->idma_playback.dma_addr);
+ i2s->sec_dai->idma_playback.dma_addr,
+ i2s->sec_dai->idma_playback.irq);
probe_exit:
/* Reset any constraint on RFS and BFS */
@@ -1145,7 +1147,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
struct s3c_audio_pdata *i2s_pdata = pdev->dev.platform_data;
struct samsung_i2s *i2s_cfg = NULL;
struct resource *res;
- u32 regs_base, quirks = 0, idma_addr = 0;
+ u32 regs_base, quirks = 0, idma_addr = 0, idma_irq = 0;
struct device_node *np = pdev->dev.of_node;
enum samsung_dai_type samsung_dai_type;
int ret = 0;
@@ -1159,10 +1161,12 @@ static int samsung_i2s_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Unable to get drvdata\n");
return -EFAULT;
}
+
snd_soc_register_component(&sec_dai->pdev->dev,
&samsung_i2s_component,
&sec_dai->i2s_dai_drv, 1);
- asoc_dma_platform_register(&pdev->dev);
+ asoc_idma_platform_register(&pdev->dev);
+
return 0;
}
@@ -1219,6 +1223,14 @@ static int samsung_i2s_probe(struct platform_device *pdev)
return -EINVAL;
}
}
+
+ idma_irq = irq_of_parse_and_map(np, 0);
+ if (idma_irq == NO_IRQ) {
+ if (quirks & QUIRK_SEC_DAI) {
+ dev_err(&pdev->dev, "idma irq is not specified");
+ return -EINVAL;
+ }
+ }
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1273,6 +1285,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
sec_dai->base = regs_base;
sec_dai->quirks = quirks;
sec_dai->idma_playback.dma_addr = idma_addr;
+ sec_dai->idma_playback.irq = idma_irq;
sec_dai->pri_dai = pri_dai;
pri_dai->sec_dai = sec_dai;
}
@@ -1318,7 +1331,11 @@ static int samsung_i2s_remove(struct platform_device *pdev)
i2s->pri_dai = NULL;
i2s->sec_dai = NULL;
- asoc_dma_platform_unregister(&pdev->dev);
+ if (other)
+ asoc_idma_platform_unregister(&pdev->dev);
+ else
+ asoc_dma_platform_unregister(&pdev->dev);
+
snd_soc_unregister_component(&pdev->dev);
return 0;