hal: change voice call sequence on APQ targets
Send device disable command to external modem before voice call
mixer controls are disabled on APQ side. Enable device command
also should be sent only after enabling mixer controls on APQ side.
Change-Id: I2e4dc321b16f695564460771b3656cd2c4a089a9
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 352c4d8..1a53f32 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -640,7 +640,8 @@
struct platform_data *my_data = (struct platform_data *)platform;
int ret = 0;
- if (my_data->csd != NULL) {
+ if (my_data->csd != NULL &&
+ my_data->adev->mode == AUDIO_MODE_IN_CALL) {
/* This must be called before disabling mixer controls on APQ side */
ret = my_data->csd->disable_device();
if (ret < 0) {
@@ -657,14 +658,13 @@
{
struct platform_data *my_data = (struct platform_data *)platform;
int acdb_rx_id, acdb_tx_id;
- int ret = 0;
-
- acdb_rx_id = acdb_device_table[out_snd_device];
- acdb_tx_id = acdb_device_table[in_snd_device];
if (my_data->acdb_send_voice_cal == NULL) {
ALOGE("%s: dlsym error for acdb_send_voice_call", __func__);
} else {
+ acdb_rx_id = acdb_device_table[out_snd_device];
+ acdb_tx_id = acdb_device_table[in_snd_device];
+
if (acdb_rx_id > 0 && acdb_tx_id > 0)
my_data->acdb_send_voice_cal(acdb_rx_id, acdb_tx_id);
else
@@ -672,8 +672,22 @@
acdb_rx_id, acdb_tx_id);
}
+ return 0;
+}
+
+int platform_switch_voice_call_usecase_route_post(void *platform,
+ snd_device_t out_snd_device,
+ snd_device_t in_snd_device)
+{
+ struct platform_data *my_data = (struct platform_data *)platform;
+ int acdb_rx_id, acdb_tx_id;
+ int ret = 0;
+
+ acdb_rx_id = acdb_device_table[out_snd_device];
+ acdb_tx_id = acdb_device_table[in_snd_device];
+
if (my_data->csd != NULL) {
- if (acdb_rx_id > 0 || acdb_tx_id > 0) {
+ if (acdb_rx_id > 0 && acdb_tx_id > 0) {
ret = my_data->csd->enable_device(acdb_rx_id, acdb_tx_id,
my_data->adev->acdb_settings);
if (ret < 0) {