aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/amd/raven/acp3x-pcm-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/amd/raven/acp3x-pcm-dma.c')
-rw-r--r--sound/soc/amd/raven/acp3x-pcm-dma.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index e362f0bc9e46..d8f554f369a8 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -15,7 +15,7 @@
#include "acp3x.h"
-#define DRV_NAME "acp3x-i2s-audio"
+#define DRV_NAME "acp3x_rv_i2s_dma"
static const struct snd_pcm_hardware acp3x_pcm_hardware_playback = {
.info = SNDRV_PCM_INFO_INTERLEAVED |
@@ -241,14 +241,6 @@ static int acp3x_dma_open(struct snd_soc_component *component,
adata->i2ssp_play_stream && !adata->i2ssp_capture_stream)
rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- adata->play_stream = substream;
- adata->i2ssp_play_stream = substream;
- } else {
- adata->capture_stream = substream;
- adata->i2ssp_capture_stream = substream;
- }
-
i2s_data->acp3x_base = adata->acp3x_base;
runtime->private_data = i2s_data;
return ret;
@@ -263,23 +255,42 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *prtd;
struct snd_soc_card *card;
struct acp3x_platform_info *pinfo;
+ struct i2s_dev_data *adata;
u64 size;
prtd = substream->private_data;
card = prtd->card;
pinfo = snd_soc_card_get_drvdata(card);
+ adata = dev_get_drvdata(component->dev);
rtd = substream->runtime->private_data;
if (!rtd)
return -EINVAL;
- if (pinfo)
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (pinfo) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
rtd->i2s_instance = pinfo->play_i2s_instance;
- else
+ switch (rtd->i2s_instance) {
+ case I2S_BT_INSTANCE:
+ adata->play_stream = substream;
+ break;
+ case I2S_SP_INSTANCE:
+ default:
+ adata->i2ssp_play_stream = substream;
+ }
+ } else {
rtd->i2s_instance = pinfo->cap_i2s_instance;
- else
+ switch (rtd->i2s_instance) {
+ case I2S_BT_INSTANCE:
+ adata->capture_stream = substream;
+ break;
+ case I2S_SP_INSTANCE:
+ default:
+ adata->i2ssp_capture_stream = substream;
+ }
+ }
+ } else {
pr_err("pinfo failed\n");
-
+ }
size = params_buffer_bytes(params);
rtd->dma_addr = substream->dma_buffer.addr;
rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT);
@@ -292,7 +303,6 @@ static snd_pcm_uframes_t acp3x_dma_pointer(struct snd_soc_component *component,
{
struct snd_soc_pcm_runtime *prtd;
struct snd_soc_card *card;
- struct acp3x_platform_info *pinfo;
struct i2s_stream_instance *rtd;
u32 pos;
u32 buffersize;
@@ -301,13 +311,6 @@ static snd_pcm_uframes_t acp3x_dma_pointer(struct snd_soc_component *component,
prtd = substream->private_data;
card = prtd->card;
rtd = substream->runtime->private_data;
- pinfo = snd_soc_card_get_drvdata(card);
- if (pinfo) {
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- rtd->i2s_instance = pinfo->play_i2s_instance;
- else
- rtd->i2s_instance = pinfo->cap_i2s_instance;
- }
buffersize = frames_to_bytes(substream->runtime,
substream->runtime->buffer_size);
@@ -531,4 +534,4 @@ MODULE_AUTHOR("Maruthi.Bayyavarapu@amd.com");
MODULE_AUTHOR("Vijendar.Mukunda@amd.com");
MODULE_DESCRIPTION("AMD ACP 3.x PCM Driver");
MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:" DRV_NAME);
+MODULE_ALIAS("platform:"DRV_NAME);