Skip to content

Commit

Permalink
msm: audio: qdsp5v2: Fix issues with LPA playback volume after call
Browse files Browse the repository at this point in the history
- LPA audio plays with higher volume after voice call.
- In LPA driver POPP gain is always set to unity. This should only
reset when switching from NON-HLB to HLB device.
- Add attribute to maintain the previous state to set POPP gain only
in case of device switch from NON-HLB to HLB.

Change-Id: Id125d8f81b5b423ffbfd6dee551e9061e13a500e
CRs-Fixed: 321780
Signed-off-by: Vinay Vaka <vvaka@codeaurora.org>
  • Loading branch information
Vinay Vaka authored and Kali- committed Jan 6, 2012
1 parent 0fd94d9 commit 4f63267
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion arch/arm/mach-msm/include/mach/qdsp5v2/codec_utils.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -109,6 +109,7 @@ struct audio {
uint32_t read_ptr_offset;
int16_t source;

int16_t prev_source;
#ifdef CONFIG_HAS_EARLYSUSPEND
struct audio_suspend_ctl suspend_ctl;
#endif
Expand Down
11 changes: 9 additions & 2 deletions arch/arm/mach-msm/qdsp5v2/audio_lpa.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Copyright (C) 2008 Google, Inc.
* Copyright (C) 2008 HTC Corporation
* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
Expand Down Expand Up @@ -193,6 +193,8 @@ static void lpa_listner(u32 evt_id, union auddev_evt_data *evt_payload,
AUDPP_CMD_CFG_DEV_MIXER_ID_4,
&audio->vol_pan,
COPP);
/* after applying on COPP */
if(audio->prev_source == AUDPP_MIXER_NONHLB) {
/*restore the POPP gain to 0x2000
this is needed to avoid use cases
where POPP volume is lowered during
Expand All @@ -205,9 +207,14 @@ static void lpa_listner(u32 evt_id, union auddev_evt_data *evt_payload,
audpp_dsp_set_vol_pan(
audio->dec_id,
&audio->vol_pan, POPP);
} else if (audio->source & AUDPP_MIXER_NONHLB)
audio->prev_source = AUDPP_MIXER_HLB;
}
} else if (audio->source & AUDPP_MIXER_NONHLB) {
/* after applying on POPP */
audio->prev_source = AUDPP_MIXER_NONHLB;
audpp_dsp_set_vol_pan(
audio->dec_id, &audio->vol_pan, POPP);
}
if (audio->device_switch == DEVICE_SWITCH_STATE_READY) {
audio->wflush = 1;
audio->device_switch =
Expand Down

0 comments on commit 4f63267

Please sign in to comment.