summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkcs <mcampbellsmith@gmail.com>2014-02-16 21:02:40 +1100
committermarkcs <mcampbellsmith@gmail.com>2014-02-17 22:08:29 +1100
commitf5cec67acd07b52653ad02a5ee2ea75551563fd0 (patch)
tree0f8f5053c57f3e75f8fc824b9ca7db17d06b8475
parentd1d7de8a8f56e23028e5805c722ce605ff4fa29d (diff)
downloaddevice_samsung_i9305-f5cec67acd07b52653ad02a5ee2ea75551563fd0.zip
device_samsung_i9305-f5cec67acd07b52653ad02a5ee2ea75551563fd0.tar.gz
device_samsung_i9305-f5cec67acd07b52653ad02a5ee2ea75551563fd0.tar.bz2
i9305: updates to audio HAL
Change-Id: Ib6ea62f97a328c1623388d27a4a7d3056eadd350
-rw-r--r--audio/audio_hw.c33
1 files 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);