Commit b0759736 authored by Padmavathi Venna's avatar Padmavathi Venna Committed by Mark Brown

ASoC: Samsung: Add quirk for internal DMA

Internal DMA is available only on some of Samsung platforms.
So added a quirk for the same and made it optional.
Signed-off-by: default avatarPadmavathi Venna <padma.v@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f114040e
...@@ -27,6 +27,7 @@ struct samsung_i2s { ...@@ -27,6 +27,7 @@ struct samsung_i2s {
#define QUIRK_NO_MUXPSR (1 << 2) #define QUIRK_NO_MUXPSR (1 << 2)
#define QUIRK_NEED_RSTCLR (1 << 3) #define QUIRK_NEED_RSTCLR (1 << 3)
#define QUIRK_SUPPORTS_TDM (1 << 4) #define QUIRK_SUPPORTS_TDM (1 << 4)
#define QUIRK_SUPPORTS_IDMA (1 << 5)
/* Quirks of the I2S controller */ /* Quirks of the I2S controller */
u32 quirks; u32 quirks;
dma_addr_t idma_addr; dma_addr_t idma_addr;
......
...@@ -987,7 +987,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) ...@@ -987,7 +987,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
if (i2s->quirks & QUIRK_NEED_RSTCLR) if (i2s->quirks & QUIRK_NEED_RSTCLR)
writel(CON_RSTCLR, i2s->addr + I2SCON); writel(CON_RSTCLR, i2s->addr + I2SCON);
if (i2s->quirks & QUIRK_SEC_DAI) if (i2s->quirks & QUIRK_SUPPORTS_IDMA)
idma_reg_addr_init(i2s->addr, idma_reg_addr_init(i2s->addr,
i2s->sec_dai->idma_playback.dma_addr); i2s->sec_dai->idma_playback.dma_addr);
...@@ -1199,10 +1199,9 @@ static int samsung_i2s_probe(struct platform_device *pdev) ...@@ -1199,10 +1199,9 @@ static int samsung_i2s_probe(struct platform_device *pdev)
quirks = i2s_dai_data->quirks; quirks = i2s_dai_data->quirks;
if (of_property_read_u32(np, "samsung,idma-addr", if (of_property_read_u32(np, "samsung,idma-addr",
&idma_addr)) { &idma_addr)) {
if (quirks & QUIRK_SEC_DAI) { if (quirks & QUIRK_SUPPORTS_IDMA) {
dev_err(&pdev->dev, "idma address is not"\ dev_info(&pdev->dev, "idma address is not"\
"specified"); "specified");
return -EINVAL;
} }
} }
} }
...@@ -1309,13 +1308,14 @@ static const struct samsung_i2s_dai_data i2sv3_dai_type = { ...@@ -1309,13 +1308,14 @@ static const struct samsung_i2s_dai_data i2sv3_dai_type = {
static const struct samsung_i2s_dai_data i2sv5_dai_type = { static const struct samsung_i2s_dai_data i2sv5_dai_type = {
.dai_type = TYPE_PRI, .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 = { static const struct samsung_i2s_dai_data i2sv6_dai_type = {
.dai_type = TYPE_PRI, .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_TDM, QUIRK_SUPPORTS_TDM | QUIRK_SUPPORTS_IDMA,
}; };
static const struct samsung_i2s_dai_data samsung_dai_type_pri = { static const struct samsung_i2s_dai_data samsung_dai_type_pri = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment