static int msm_voice_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { #if defined(CONFIG_SEC_DEVIDE_RINGTONE_GAIN) int ret = 0; int volume = ucontrol->value.integer.value[0]; uint32_t session_id = ucontrol->value.integer.value[1]; int ramp_duration = ucontrol->value.integer.value[2]; bool is_ringback = false; if ((volume < 0) || (ramp_duration < 0) || (ramp_duration > MAX_RAMP_DURATION)) { pr_err(" %s Invalid arguments", __func__); ret = -EINVAL; goto done; } if (volume & 0x200) { pr_debug("%s: ringback tone volume ctrl\n", __func__); volume -= 0x200; is_ringback = true; } pr_debug("%s: volume: %d session_id: %#x ramp_duration: %d\n", __func__, volume, session_id, ramp_duration); voc_set_rx_vol_step(session_id, RX_PATH, (is_ringback ? (volume+100) : volume), ramp_duration); #else int ret = 0; int volume = ucontrol->value.integer.value[0]; uint32_t session_id = ucontrol->value.integer.value[1]; int ramp_duration = ucontrol->value.integer.value[2]; if ((volume < 0) || (ramp_duration < 0) || (ramp_duration > MAX_RAMP_DURATION)) { pr_err(" %s Invalid arguments", __func__); ret = -EINVAL; goto done; } pr_debug("%s: volume: %d session_id: %#x ramp_duration: %d\n", __func__, volume, session_id, ramp_duration); voc_set_rx_vol_step(session_id, RX_PATH, volume, ramp_duration); #endif #ifdef CONFIG_SND_SOC_ES705 #if !defined(CONFIG_MACH_KLTE_KOR) es705_put_veq_block(volume); #endif #endif #if defined(CONFIG_SND_SOC_ES325) || defined (CONFIG_SND_SOC_ES325_ATLANTIC) && !defined(CONFIG_SEC_LOCALE_KOR_H) && !defined(CONFIG_SEC_LOCALE_KOR_FRESCO) && !defined(CONFIG_SEC_JACTIVE_PROJECT) es325_set_VEQ_max_gain(volume); #endif done: return ret; }
static int msm_voice_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int ret = 0; int volume = ucontrol->value.integer.value[0]; uint32_t session_id = ucontrol->value.integer.value[1]; int ramp_duration = ucontrol->value.integer.value[2]; if ((volume < 0) || (ramp_duration < 0) || (ramp_duration > MAX_RAMP_DURATION)) { pr_err(" %s Invalid arguments", __func__); ret = -EINVAL; goto done; } pr_debug("%s: volume: %d session_id: %#x ramp_duration: %d\n", __func__, volume, session_id, ramp_duration); voc_set_rx_vol_step(session_id, RX_PATH, volume, ramp_duration); #if defined(CONFIG_SND_SOC_ES705) && defined(CONFIG_SND_SOC_VEQ_SUPPORT) #if defined(CONFIG_MACH_TRLTE_EUR) && defined(CONFIG_SND_DSPG_DBMD2) if (system_rev < 15) #endif es705_put_veq_block(volume); #endif done: return ret; }
static int msm_voice_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int ret = 0; int volume = ucontrol->value.integer.value[0]; uint32_t session_id = ucontrol->value.integer.value[1]; int ramp_duration = ucontrol->value.integer.value[2]; if ((volume < 0) || (ramp_duration < 0) || (ramp_duration > MAX_RAMP_DURATION)) { pr_err(" %s Invalid arguments", __func__); ret = -EINVAL; goto done; } pr_debug("%s: volume: %d session_id: %#x ramp_duration: %d\n", __func__, volume, session_id, ramp_duration); voc_set_rx_vol_step(session_id, RX_PATH, volume, ramp_duration); done: return ret; }