summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkeunhui.park <keunhui.park@lge.com>2015-07-30 16:37:15 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-30 16:37:15 +0000
commitc809543db27eb159ffaf2f80aea8d122d65ff784 (patch)
tree9d2db693baa9f4b31cc5a2fb3b27701a6ec04b38
parent49cb6c00948a74130db24987048e3ee98bf40e7f (diff)
parentc5aaa0e767b83fa8299861a739a4a1cb8e9bee0f (diff)
downloadhardware_qcom_audio-c809543db27eb159ffaf2f80aea8d122d65ff784.tar.gz
hardware_qcom_audio-c809543db27eb159ffaf2f80aea8d122d65ff784.tar.bz2
hardware_qcom_audio-c809543db27eb159ffaf2f80aea8d122d65ff784.zip
am c5aaa0e7: audio: set voice call volume step by property
* commit 'c5aaa0e767b83fa8299861a739a4a1cb8e9bee0f': audio: set voice call volume step by property
-rw-r--r--hal/msm8974/platform.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index bb028692..c697ed88 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -63,6 +63,9 @@
#define DEFAULT_APP_TYPE_RX_PATH 0x11130
+#define TOSTRING_(x) #x
+#define TOSTRING(x) TOSTRING_(x)
+
struct audio_block_header
{
int reserved;
@@ -105,6 +108,7 @@ struct platform_data {
char ec_ref_mixer_path[64];
char *snd_card_name;
+ int max_vol_index;
};
static int pcm_device_table[AUDIO_USECASE_MAX][2] = {
@@ -859,6 +863,10 @@ void *platform_init(struct audio_device *adev)
goto init_failed;
}
+ //set max volume step for voice call
+ property_get("ro.config.vc_call_vol_steps", value, TOSTRING(MAX_VOL_INDEX));
+ my_data->max_vol_index = atoi(value);
+
my_data->dualmic_config = DUALMIC_CONFIG_NONE;
my_data->fluence_in_spkr_mode = false;
my_data->fluence_in_voice_call = false;
@@ -1326,7 +1334,7 @@ int platform_set_voice_volume(void *platform, int volume)
// Voice volume levels are mapped to adsp volume levels as follows.
// 100 -> 5, 80 -> 4, 60 -> 3, 40 -> 2, 20 -> 1 0 -> 0
// But this values don't changed in kernel. So, below change is need.
- vol_index = (int)percent_to_index(volume, MIN_VOL_INDEX, MAX_VOL_INDEX);
+ vol_index = (int)percent_to_index(volume, MIN_VOL_INDEX, my_data->max_vol_index);
set_values[0] = vol_index;
ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);