ASoC: Samsung: Add quirk for internal DMA
authorPadmavathi Venna <padma.v@samsung.com>
Fri, 7 Nov 2014 06:54:39 +0000 (12:24 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 7 Nov 2014 10:38:17 +0000 (10:38 +0000)
Internal DMA is available only on some of Samsung platforms.
So added a quirk for the same and made it optional.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/linux/platform_data/asoc-s3c.h
sound/soc/samsung/i2s.c

index a6591c693ebba4a19feb6cefeaf43de403df74c0..5e0bc779e6c531b6141a4c0c8dca9d14c977a8e7 100644 (file)
@@ -27,6 +27,7 @@ struct samsung_i2s {
 #define QUIRK_NO_MUXPSR                (1 << 2)
 #define QUIRK_NEED_RSTCLR      (1 << 3)
 #define QUIRK_SUPPORTS_TDM     (1 << 4)
+#define QUIRK_SUPPORTS_IDMA    (1 << 5)
        /* Quirks of the I2S controller */
        u32 quirks;
        dma_addr_t idma_addr;
index 9d513473b3007c0c3e022ca6927e29071dfb6db6..38b9a524cc9f254bf70e20aac56dfe3460347555 100644 (file)
@@ -987,7 +987,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
        if (i2s->quirks & QUIRK_NEED_RSTCLR)
                writel(CON_RSTCLR, i2s->addr + I2SCON);
 
-       if (i2s->quirks & QUIRK_SEC_DAI)
+       if (i2s->quirks & QUIRK_SUPPORTS_IDMA)
                idma_reg_addr_init(i2s->addr,
                                        i2s->sec_dai->idma_playback.dma_addr);
 
@@ -1199,10 +1199,9 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                quirks = i2s_dai_data->quirks;
                if (of_property_read_u32(np, "samsung,idma-addr",
                                         &idma_addr)) {
-                       if (quirks & QUIRK_SEC_DAI) {
-                               dev_err(&pdev->dev, "idma address is not"\
+                       if (quirks & QUIRK_SUPPORTS_IDMA) {
+                               dev_info(&pdev->dev, "idma address is not"\
                                                "specified");
-                               return -EINVAL;
                        }
                }
        }
@@ -1309,13 +1308,14 @@ static const struct samsung_i2s_dai_data i2sv3_dai_type = {
 
 static const struct samsung_i2s_dai_data i2sv5_dai_type = {
        .dai_type = TYPE_PRI,
-       .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR,
+       .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR |
+                       QUIRK_SUPPORTS_IDMA,
 };
 
 static const struct samsung_i2s_dai_data i2sv6_dai_type = {
        .dai_type = TYPE_PRI,
        .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR |
-                       QUIRK_SUPPORTS_TDM,
+                       QUIRK_SUPPORTS_TDM | QUIRK_SUPPORTS_IDMA,
 };
 
 static const struct samsung_i2s_dai_data samsung_dai_type_pri = {