From c8f47b317431f0f2353d44da6482212044a05371 Mon Sep 17 00:00:00 2001 From: "keunhui.park" Date: Mon, 13 Jul 2015 10:57:37 +0900 Subject: audio: set voice call volume step by property Bug: 22469108 Change-Id: I6999a2d0da1296deef252fdfb6a7c7e7df642dd9 --- hal/msm8974/platform.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c index 03aa5967..23a122aa 100644 --- a/hal/msm8974/platform.c +++ b/hal/msm8974/platform.c @@ -62,6 +62,9 @@ #define DEFAULT_APP_TYPE_RX_PATH 0x11130 +#define TOSTRING_(x) #x +#define TOSTRING(x) TOSTRING_(x) + struct audio_block_header { int reserved; @@ -104,6 +107,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] = { @@ -850,6 +854,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; @@ -1317,7 +1325,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); -- cgit v1.2.3