From cd25a25d7a70ec8d45f24f4183e8b3f35a1b5411 Mon Sep 17 00:00:00 2001 From: Ravindra Lokhande Date: Tue, 30 Nov 2010 19:00:44 +0530 Subject: [tegra ALSA] separated i2s1 and i2s2 path In order to support concurrent playback/record from i2s1 and i2s2, separated i2s1 and i2s2 path. Change-Id: I2c19d76605d243e3e5375047ea0e799c4eb823b5 Reviewed-on: http://git-master/r/11677 Reviewed-by: Sumit Bhattacharya Reviewed-by: Ravindra Lokhande Tested-by: Ravindra Lokhande Reviewed-by: Bharat Nihalani Reviewed-by: Varun Colbert Tested-by: Varun Colbert --- sound/soc/tegra/tegra_pcm_rpc.c | 11 ++++++++--- sound/soc/tegra/tegra_transport.c | 16 ++++++++++++++-- sound/soc/tegra/tegra_transport.h | 5 ++++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/sound/soc/tegra/tegra_pcm_rpc.c b/sound/soc/tegra/tegra_pcm_rpc.c index fd1c8cb55ee3..f6cd0861a698 100644 --- a/sound/soc/tegra/tegra_pcm_rpc.c +++ b/sound/soc/tegra/tegra_pcm_rpc.c @@ -540,10 +540,11 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream) sema_init(&prtd->buf_done_sem, 0); sema_init(&prtd->stop_done_sem, 0); - if (pcm->device == I2S2) - hSource = ptscx->mi2s2; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK){ + hSource = ptscx->i2s1_play_mix; + if (pcm->device == I2S2) + hSource = ptscx->i2s2_play_mix; + prtd->mixer_buffer = ptscx->mixer_buffer[0]; prtd->stdoutpath = (StandardPath*)kzalloc(sizeof(StandardPath), GFP_KERNEL); @@ -594,6 +595,10 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream) goto fail; } } else { + hSource = ptscx->i2s1_rec_split; + if (pcm->device == I2S2) + hSource = ptscx->i2s2_rec_split; + prtd->mixer_buffer = ptscx->mixer_buffer[1]; prtd->stdinpath = (StandardPath*)kzalloc(sizeof(StandardPath), GFP_KERNEL); diff --git a/sound/soc/tegra/tegra_transport.c b/sound/soc/tegra/tegra_transport.c index cdf2de2cc3f1..038309ac27ef 100644 --- a/sound/soc/tegra/tegra_transport.c +++ b/sound/soc/tegra/tegra_transport.c @@ -550,9 +550,21 @@ int tegra_audiofx_init(struct tegra_audio_data* tegra_snd_cx) NvAudioFxI2s1Id); tegra_snd_cx->mi2s1_device_available = NvAudioFxIoDevice_Default; - tegra_snd_cx->mi2s2 = tegra_snd_cx->xrt_fxn.MixerCreateObject( + tegra_snd_cx->i2s1_play_mix = tegra_snd_cx->xrt_fxn.MixerCreateObject( tegra_snd_cx->mixer_handle, - NvAudioFxI2s2Id); + NvAudioFxI2s1PlaybackMixId); + + tegra_snd_cx->i2s2_play_mix = tegra_snd_cx->xrt_fxn.MixerCreateObject( + tegra_snd_cx->mixer_handle, + NvAudioFxI2s2PlaybackMixId); + + tegra_snd_cx->i2s1_rec_split = tegra_snd_cx->xrt_fxn.MixerCreateObject( + tegra_snd_cx->mixer_handle, + NvAudioFxI2s1RecordSplitId); + + tegra_snd_cx->i2s2_rec_split = tegra_snd_cx->xrt_fxn.MixerCreateObject( + tegra_snd_cx->mixer_handle, + NvAudioFxI2s2RecordSplitId); memset(&message, 0, sizeof(NvAudioFxMessage)); message.Event = NvAudioFxEventControlChange; diff --git a/sound/soc/tegra/tegra_transport.h b/sound/soc/tegra/tegra_transport.h index 49eee47b1373..7863efbee64d 100644 --- a/sound/soc/tegra/tegra_transport.h +++ b/sound/soc/tegra/tegra_transport.h @@ -415,7 +415,10 @@ struct tegra_audio_data { NvRmMemHandle mem_handle[2]; NvAudioFxObjectHandle mvolume; NvAudioFxObjectHandle mi2s1; - NvAudioFxObjectHandle mi2s2; + NvAudioFxObjectHandle i2s1_play_mix; + NvAudioFxObjectHandle i2s2_play_mix; + NvAudioFxObjectHandle i2s1_rec_split; + NvAudioFxObjectHandle i2s2_rec_split; NvAudioFxObjectHandle mroute; NvAudioFxIoDevice mi2s1_device_available; NvAudioFxIoDevice mspdif_device_available; -- cgit v1.2.3