summaryrefslogtreecommitdiff
path: root/sound/soc/tegra/tegra_transport.c
diff options
context:
space:
mode:
authorRavindra Lokhande <rlokhande@nvidia.com>2010-12-08 18:54:09 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2010-12-20 16:31:56 -0800
commit1508f7aa5850b1ac02d9876eb5dac34356c86244 (patch)
tree87f37b92c645a3114e76dee5af952f82f1819fac /sound/soc/tegra/tegra_transport.c
parent75f8537e1c8c8a0dc5e694d6baf1a09ecdd15ffe (diff)
[tegra ALSA] set mode and i/o device.tegra-10.9.8
Set mode and input, output device for newly created device 1. Needed for bug 738770 Change-Id: I01ef4efb018a32cca8b1a0ff1e63f2a8de63dbfe Reviewed-on: http://git-master/r/12314 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> Tested-by: Ravindra Lokhande <rlokhande@nvidia.com>
Diffstat (limited to 'sound/soc/tegra/tegra_transport.c')
-rw-r--r--sound/soc/tegra/tegra_transport.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/soc/tegra/tegra_transport.c b/sound/soc/tegra/tegra_transport.c
index 038309ac27ef..f5b209641098 100644
--- a/sound/soc/tegra/tegra_transport.c
+++ b/sound/soc/tegra/tegra_transport.c
@@ -36,6 +36,7 @@
} \
wait_for_completion(&comp); \
+extern struct tegra_audio_state_t tegra_audio_state;
static AlsaTransport* atrans = 0;
@@ -548,7 +549,6 @@ int tegra_audiofx_init(struct tegra_audio_data* tegra_snd_cx)
tegra_snd_cx->mi2s1 = tegra_snd_cx->xrt_fxn.MixerCreateObject(
tegra_snd_cx->mixer_handle,
NvAudioFxI2s1Id);
- tegra_snd_cx->mi2s1_device_available = NvAudioFxIoDevice_Default;
tegra_snd_cx->i2s1_play_mix = tegra_snd_cx->xrt_fxn.MixerCreateObject(
tegra_snd_cx->mixer_handle,
@@ -689,8 +689,11 @@ static void tegra_audiofx_notifier_thread(void *arg)
NvAudioFxIoDeviceControlChangeMessage* iccm =
(NvAudioFxIoDeviceControlChangeMessage*)message;
- audio_context->mi2s1_device_available = iccm->IoDevice;
- tegra_audiofx_route(audio_context);
+ mutex_lock(&tegra_audio_state.mutex_lock);
+ tegra_audio_state.devices_available = iccm->IoDevice;
+ mutex_unlock(&tegra_audio_state.mutex_lock);
+ if (audio_context->device_id == I2S1)
+ tegra_audiofx_route(audio_context);
}
}
@@ -701,7 +704,8 @@ static void tegra_audiofx_notifier_thread(void *arg)
(NvAudioFxIoDeviceControlChangeMessage*)message;
audio_context->mspdif_device_available = iccm->IoDevice;
- tegra_audiofx_route(audio_context);
+ if (audio_context->device_id == I2S1)
+ tegra_audiofx_route(audio_context);
}
}
}
@@ -729,16 +733,16 @@ NvError tegra_audiofx_route(struct tegra_audio_data *audio_context)
audio_context->spdif_plugin) {
spdif_device_select = NvAudioFxIoDevice_Aux;
}
- else if(audio_context->mi2s1_device_available &
+ else if(tegra_audio_state.devices_available &
NvAudioFxIoDevice_HeadphoneOut) {
i2s1_device_select = NvAudioFxIoDevice_HeadphoneOut;
}
- else if(audio_context->mi2s1_device_available &
+ else if(tegra_audio_state.devices_available &
NvAudioFxIoDevice_BuiltInSpeaker) {
i2s1_device_select = NvAudioFxIoDevice_BuiltInSpeaker;
}
else {
- i2s1_device_select = audio_context->mi2s1_device_available;
+ i2s1_device_select = tegra_audio_state.devices_available;
}
e = audio_context->xrt_fxn.SetProperty(