summaryrefslogtreecommitdiffstats
path: root/sound/soc/rockchip/rockchip_i2s.c
diff options
context:
space:
mode:
authorSugar Zhang <sugar.zhang@rock-chips.com>2021-09-28 09:35:57 +0800
committerMark Brown <broonie@kernel.org>2021-10-20 11:12:42 +0100
commit5ba8ecf2272d34de9cd2271a0ac12f5f615ef7aa (patch)
treec35da3b54598600df695c56bbdce79c59b2ba8ba /sound/soc/rockchip/rockchip_i2s.c
parent4ca239f33737198827c7f4ac68a1f6fc8a9d79ba (diff)
downloadlinux-stable-5ba8ecf2272d34de9cd2271a0ac12f5f615ef7aa.tar.gz
linux-stable-5ba8ecf2272d34de9cd2271a0ac12f5f615ef7aa.tar.bz2
linux-stable-5ba8ecf2272d34de9cd2271a0ac12f5f615ef7aa.zip
ASoC: rockchip: Use generic dmaengine code
This reverts commit 75b31192fe6ad20b42276b20ee3bdf1493216d63. The original purpose of customized pcm was to config prealloc buffer size flexibly. but, we can do the same thing by soc-generic-dmaengine-pcm. And the generic one can generated the better config by querying DMA capabilities from dmaengine driver rather than the Hard-Coded one. e.g. the customized one: static const struct snd_pcm_hardware snd_rockchip_hardware = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_INTERLEAVED, ... the generic one: ret = dma_get_slave_caps(chan, &dma_caps); if (ret == 0) { if (dma_caps.cmd_pause && dma_caps.cmd_resume) hw.info |= SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME; if (dma_caps.residue_granularity <= DMA_RESIDUE_GRANULARITY_SEGMENT) hw.info |= SNDRV_PCM_INFO_BATCH; ... So, let's revert back to use the generic dmaengine pcm. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Reviewed-by: John Keeping <john@metanate.com> Link: https://lore.kernel.org/r/1632792957-80428-1-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/rockchip/rockchip_i2s.c')
-rw-r--r--sound/soc/rockchip/rockchip_i2s.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 7e89f5b0c237..a6d7656c206e 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -20,7 +20,6 @@
#include <sound/dmaengine_pcm.h>
#include "rockchip_i2s.h"
-#include "rockchip_pcm.h"
#define DRV_NAME "rockchip-i2s"
@@ -756,7 +755,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
goto err_suspend;
}
- ret = rockchip_pcm_platform_register(&pdev->dev);
+ ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
if (ret) {
dev_err(&pdev->dev, "Could not register PCM\n");
goto err_suspend;