From f5cec67acd07b52653ad02a5ee2ea75551563fd0 Mon Sep 17 00:00:00 2001 From: markcs Date: Sun, 16 Feb 2014 21:02:40 +1100 Subject: i9305: updates to audio HAL Change-Id: Ib6ea62f97a328c1623388d27a4a7d3056eadd350 --- audio/audio_hw.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index ad8c620..355c8e4 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -366,7 +366,6 @@ static int set_route_by_array(struct mixer *mixer, struct route_setting *route, void select_devices(struct m0_audio_device *adev) { int i; - if (adev->active_out_device == adev->out_device && adev->active_in_device == adev->in_device) return; @@ -375,27 +374,31 @@ void select_devices(struct m0_audio_device *adev) /* Turn on new devices first so we don't glitch due to powerdown... */ for (i = 0; i < adev->num_dev_cfgs; i++) - if ((adev->out_device & adev->dev_cfgs[i].mask) && - !(adev->active_out_device & adev->dev_cfgs[i].mask)) + if (((adev->out_device & adev->dev_cfgs[i].mask) && + !(adev->active_out_device & adev->dev_cfgs[i].mask)) && + !(adev->dev_cfgs[i].mask & AUDIO_DEVICE_BIT_IN)) { set_route_by_array(adev->mixer, adev->dev_cfgs[i].on, adev->dev_cfgs[i].on_len); - +} for (i = 0; i < adev->num_dev_cfgs; i++) - if ((adev->in_device & adev->dev_cfgs[i].mask) && - !(adev->active_in_device & adev->dev_cfgs[i].mask)) + if (((adev->in_device & adev->dev_cfgs[i].mask) && + !(adev->active_in_device & adev->dev_cfgs[i].mask)) && + (adev->dev_cfgs[i].mask & AUDIO_DEVICE_BIT_IN)) set_route_by_array(adev->mixer, adev->dev_cfgs[i].on, adev->dev_cfgs[i].on_len); /* ...then disable old ones. */ for (i = 0; i < adev->num_dev_cfgs; i++) - if (!(adev->out_device & adev->dev_cfgs[i].mask) && - (adev->active_out_device & adev->dev_cfgs[i].mask)) + if ((!(adev->out_device & adev->dev_cfgs[i].mask) && + (adev->active_out_device & adev->dev_cfgs[i].mask)) && + !(adev->dev_cfgs[i].mask & AUDIO_DEVICE_BIT_IN)) set_route_by_array(adev->mixer, adev->dev_cfgs[i].off, adev->dev_cfgs[i].off_len); for (i = 0; i < adev->num_dev_cfgs; i++) - if (!(adev->in_device & adev->dev_cfgs[i].mask) && - (adev->active_in_device & adev->dev_cfgs[i].mask)) + if ((!(adev->in_device & adev->dev_cfgs[i].mask) && + (adev->active_in_device & adev->dev_cfgs[i].mask)) && + (adev->dev_cfgs[i].mask & AUDIO_DEVICE_BIT_IN)) set_route_by_array(adev->mixer, adev->dev_cfgs[i].off, adev->dev_cfgs[i].off_len); @@ -540,7 +543,7 @@ static void set_incall_device(struct m0_audio_device *adev) case AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET: case AUDIO_DEVICE_OUT_AUX_DIGITAL: rx_dev_id = DEVICE_SPEAKER_MONO_RX_ACDB_ID; - tx_dev_id = DEVICE_HANDSET_TX_ACDB_ID; + tx_dev_id = DEVICE_SPEAKER_TX_ACDB_ID; voice_index = 9; break; case AUDIO_DEVICE_OUT_WIRED_HEADSET: @@ -783,14 +786,6 @@ static void select_output_device(struct m0_audio_device *adev) set_bigroute_by_array(adev->mixer, default_input_disable, 1); } - if (speaker_on) { - ALOGD("%s: set voicecall route: speaker_output", __func__); - set_bigroute_by_array(adev->mixer, speaker_output, 1); - } else { - ALOGD("%s: set voicecall route: speaker_output_disable", __func__); - set_bigroute_by_array(adev->mixer, speaker_output_disable, 1); - } - if (headset_on) { ALOGD("%s: set voicecall route: headset_input", __func__); set_bigroute_by_array(adev->mixer, headset_input, 1); -- cgit v1.1