Example #1
0
static int msm_voice_fens_put(struct snd_kcontrol *kcontrol,
			struct snd_ctl_elem_value *ucontrol)
{
	int fens_enable = ucontrol->value.integer.value[0];

	pr_debug("%s: fens enable=%d\n", __func__, fens_enable);

	voc_set_pp_enable(voc_get_session_id(VOICE_SESSION_NAME),
			  MODULE_ID_VOICE_MODULE_FENS, fens_enable);
	voc_set_pp_enable(voc_get_session_id(VOICE2_SESSION_NAME),
			  MODULE_ID_VOICE_MODULE_FENS, fens_enable);

	return 0;
}
static int msm_voice_tty_mode_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	int tty_mode = ucontrol->value.integer.value[0];

	pr_debug("%s: tty_mode=%d\n", __func__, tty_mode);

	voc_set_tty_mode(voc_get_session_id(VOICE_SESSION_NAME), tty_mode);
	voc_set_tty_mode(voc_get_session_id(VOICE2_SESSION_NAME), tty_mode);
	voc_set_tty_mode(voc_get_session_id(VOLTE_SESSION_NAME), tty_mode);
	voc_set_tty_mode(voc_get_session_id(VOWLAN_SESSION_NAME), tty_mode);

	return 0;
}
Example #3
0
static int msm_voice_slowtalk_put(struct snd_kcontrol *kcontrol,
			struct snd_ctl_elem_value *ucontrol)
{
	int st_enable = ucontrol->value.integer.value[0];

	pr_debug("%s: st enable=%d\n", __func__, st_enable);

	voc_set_pp_enable(voc_get_session_id(VOICE_SESSION_NAME),
			MODULE_ID_VOICE_MODULE_ST, st_enable);
	voc_set_pp_enable(voc_get_session_id(SGLTE_SESSION_NAME),
			MODULE_ID_VOICE_MODULE_ST, st_enable);

	return 0;
}
Example #4
0
static int msm_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
	int ret = 0;
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_voice *prtd = runtime->private_data;
	uint16_t session_id = 0;

	pr_debug("%s: cmd = %d\n", __func__, cmd);
	if (is_volte(prtd))
		session_id = voc_get_session_id(VOLTE_SESSION_NAME);
	else if (is_sglte(prtd))
		session_id = voc_get_session_id(SGLTE_SESSION_NAME);
	else
		session_id = voc_get_session_id(VOICE_SESSION_NAME);

	switch (cmd) {
	case SNDRV_PCM_TRIGGER_START:
	case SNDRV_PCM_TRIGGER_STOP:
		pr_debug("Start & Stop Voice call not handled in Trigger.\n");
	break;
	case SNDRV_PCM_TRIGGER_RESUME:
	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
		pr_debug("%s: resume call session_id = %d\n", __func__,
			 session_id);
		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
			ret = msm_pcm_playback_prepare(substream);
		else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
			ret = msm_pcm_capture_prepare(substream);
		if (prtd->playback_start && prtd->capture_start)
			voc_resume_voice_call(session_id);
	break;
	case SNDRV_PCM_TRIGGER_SUSPEND:
	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
		pr_debug("%s: pause call session_id=%d\n",
			 __func__, session_id);
		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
			if (prtd->playback_start)
				prtd->playback_start = 0;
		} else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
			if (prtd->capture_start)
				prtd->capture_start = 0;
		}
		voc_standby_voice_call(session_id);
	break;
	default:
		ret = -EINVAL;
	break;
	}
	return ret;
}
Example #5
0
static uint32_t get_session_id(struct msm_voice *pvoc)
{
	uint32_t session_id = 0;

	if (is_volte(pvoc))
		session_id = voc_get_session_id(VOLTE_SESSION_NAME);
	else if (is_voice2(pvoc))
		session_id = voc_get_session_id(VOICE2_SESSION_NAME);
	else if (is_qchat(pvoc))
		session_id = voc_get_session_id(QCHAT_SESSION_NAME);
	else
		session_id = voc_get_session_id(VOICE_SESSION_NAME);

	return session_id;
}
static void msm_voice_unmute_work (struct work_struct *work)
{
	pr_debug("%s: unmute by timeout\n", __func__);
	voc_set_device_mute_lge(voc_get_session_id(VOICE_SESSION_NAME),
							VSS_IVOLUME_DIRECTION_RX, 0, 500);
	return;
}
static int msm_sec_dha_put(struct snd_kcontrol *kcontrol,
			struct snd_ctl_elem_value *ucontrol)
{
	int i = 0;

	int dha_mode = ucontrol->value.integer.value[0];
	int dha_select = ucontrol->value.integer.value[1];
#if defined(CONFIG_AUDIO_DUAL_CP) || defined(CONFIG_MACH_KLTE_CTC) \
	|| defined(CONFIG_MACH_KLTE_CMCCDUOS) || defined(CONFIG_MACH_KLTE_CUDUOS) \
	|| defined(CONFIG_MACH_MEGA23GEUR_OPEN)  || defined(CONFIG_MACH_MS01_EUR_3G) \
	|| defined(CONFIG_MACH_MEGA2LTE_KTT) || defined(CONFIG_MACH_ATLANTIC3GEUR_OPEN) \
	|| defined(CONFIG_MACH_MS01_EUR_LTE) || defined(CONFIG_MACH_MS01_KOR_LTE) || defined(CONFIG_DSDA_VIA_UART)
	uint32_t session_id = ucontrol->value.integer.value[14];
#endif
	short dha_param[12] = {0,};
	for (i = 0; i < 12; i++) {
		dha_param[i] = (short)ucontrol->value.integer.value[2+i];
		pr_debug("msm_dha_put : param - %d\n", dha_param[i]);
	}

#if defined(CONFIG_AUDIO_DUAL_CP) || defined(CONFIG_MACH_KLTE_CTC) \
	|| defined(CONFIG_MACH_KLTE_CMCCDUOS) || defined(CONFIG_MACH_KLTE_CUDUOS) \
	|| defined(CONFIG_MACH_MEGA23GEUR_OPEN) || defined(CONFIG_MACH_MS01_EUR_3G) \
	|| defined(CONFIG_MACH_MEGA2LTE_KTT) || defined(CONFIG_MACH_ATLANTIC3GEUR_OPEN) \
	|| defined(CONFIG_MACH_MS01_EUR_LTE) || defined(CONFIG_MACH_MS01_KOR_LTE) || defined(CONFIG_DSDA_VIA_UART)
	pr_info("%s: session_id=%#x\n", __func__, session_id);
	return voice_sec_set_dha_data(session_id,
		dha_mode, dha_select, dha_param);
#else
	return voice_sec_set_dha_data(voc_get_session_id(VOICE_SESSION_NAME),
		dha_mode, dha_select, dha_param);
#endif
}
static int msm_voice_rx_mute_timeout_put(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	static struct delayed_work *unmute_work = NULL;
	int ret = 0;
	int mute = ucontrol->value.integer.value[0];
	uint32_t session_id = ucontrol->value.integer.value[1];
	int timeout = ucontrol->value.integer.value[2];

	if (unmute_work == NULL) {
		unmute_work = kzalloc(sizeof(struct delayed_work), GFP_KERNEL);
		INIT_DELAYED_WORK(unmute_work, msm_voice_unmute_work);
	}

	if ((mute != 1) || (timeout <= 0)) {
		pr_err(" %s Invalid arguments", __func__);

		ret = -EINVAL;
		goto done;
	}

	pr_debug("%s: mute=%d session_id=%#x timeout=%d\n", __func__,
		 mute, session_id, timeout);

	voc_set_device_mute_lge(voc_get_session_id(VOICE_SESSION_NAME),
							VSS_IVOLUME_DIRECTION_RX, 1, 500);

	if (unlikely(delayed_work_pending(unmute_work)))
		cancel_delayed_work_sync(unmute_work);
	schedule_delayed_work(unmute_work, msecs_to_jiffies(timeout));
done:
	return ret;
}
static int msm_voice_widevoice_get(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	ucontrol->value.integer.value[0] =
	       voc_get_widevoice_enable(voc_get_session_id(VOICE_SESSION_NAME));
	return 0;
}
static int msm_voice2_rx_device_mute_get(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	ucontrol->value.integer.value[0] =
		voc_get_rx_device_mute(voc_get_session_id(VOICE2_SESSION_NAME));
	return 0;
}
static int msm_voice_fens_get(struct snd_kcontrol *kcontrol,
			struct snd_ctl_elem_value *ucontrol)
{
	ucontrol->value.integer.value[0] =
		voc_get_pp_enable(voc_get_session_id(VOICE_SESSION_NAME),
				MODULE_ID_VOICE_MODULE_FENS);
	return 0;
}
Example #12
0
static int msm_volte_volume_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	int volume = ucontrol->value.integer.value[0];
	pr_debug("%s: volume: %d\n", __func__, volume);
	voc_set_rx_vol_index(voc_get_session_id(VOLTE_SESSION_NAME),
						RX_PATH, volume);
	return 0;
}
static int msm_voice2_rx_device_mute_put(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	int mute = ucontrol->value.integer.value[0];

	pr_debug("%s: mute=%d\n", __func__, mute);

	voc_set_rx_device_mute(voc_get_session_id(VOICE2_SESSION_NAME), mute);

	return 0;
}
static int msm_volte_topology_disable_put(struct snd_kcontrol *kcontrol,
					  struct snd_ctl_elem_value *ucontrol)
{
	int disable = ucontrol->value.integer.value[0];

	pr_debug("%s: disable = %d\n", __func__, disable);

	return voc_disable_topology(voc_get_session_id(VOLTE_SESSION_NAME),
					 disable);

}
Example #15
0
static int msm_sglte_mute_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	int mute = ucontrol->value.integer.value[0];

	pr_debug("%s: mute=%d\n", __func__, mute);

	voc_set_tx_mute(voc_get_session_id(SGLTE_SESSION_NAME), TX_PATH, mute);

	return 0;
}
static int msm_voice_widevoice_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	int wv_enable = ucontrol->value.integer.value[0];

	pr_debug("%s: wv enable=%d\n", __func__, wv_enable);

	voc_set_widevoice_enable(voc_get_session_id(VOICE_SESSION_NAME),
				 wv_enable);
	return 0;
}
static int msm_volte_volume_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	int volume = ucontrol->value.integer.value[0];
#if defined(CONFIG_SEC_DEVIDE_RINGTONE_GAIN)
    if(ringback_tone_state)
    	volume +=100;
#endif
	pr_debug("%s: volume: %d\n", __func__, volume);
	voc_set_rx_vol_index(voc_get_session_id(VOLTE_SESSION_NAME),
						RX_PATH, volume);
	return 0;
}
static int msm_sec_dha_put(struct snd_kcontrol *kcontrol,
			struct snd_ctl_elem_value *ucontrol)
{
	int i = 0;

	int dha_mode = ucontrol->value.integer.value[0];
	int dha_select = ucontrol->value.integer.value[1];
	short dha_param[12] = {0,};
	for (i = 0; i < 12; i++) {
		dha_param[i] = (short)ucontrol->value.integer.value[2+i];
		pr_debug("msm_dha_put : param - %d\n", dha_param[i]);
	}

	return voice_sec_set_dha_data(voc_get_session_id(VOICE_SESSION_NAME),
		dha_mode, dha_select, dha_param);
}
Example #19
0
static int msm_pcm_prepare(struct snd_pcm_substream *substream)
{
	int ret = 0;
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_voice *prtd = runtime->private_data;

	mutex_lock(&prtd->lock);

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		ret = msm_pcm_playback_prepare(substream);
	else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
		ret = msm_pcm_capture_prepare(substream);

	if (prtd->playback_start && prtd->capture_start)
		voc_start_voice_call(voc_get_session_id(VOICE_SESSION_NAME));

	mutex_unlock(&prtd->lock);

	return ret;
}
Example #20
0
static int msm_pcm_close(struct snd_pcm_substream *substream)
{

	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_voice *prtd = runtime->private_data;
	int ret = 0;

	mutex_lock(&prtd->lock);
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		ret = msm_pcm_playback_close(substream);
	else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
		ret = msm_pcm_capture_close(substream);

	prtd->instance--;
	if (!prtd->playback_start && !prtd->capture_start) {
		pr_debug("end voice call\n");
		voc_end_voice_call(voc_get_session_id(VOICE_SESSION_NAME));
	}
	mutex_unlock(&prtd->lock);

	return ret;
}
static int msm_phonememo_voice_mute_put(struct snd_kcontrol *kcontrol,
                    struct snd_ctl_elem_value *ucontrol)
{
    int ret = 0;
    int mute = ucontrol->value.integer.value[0];
    uint32_t session_id = ucontrol->value.integer.value[1];
    int ramp_duration = ucontrol->value.integer.value[2];

    if ((mute < 0) || (mute > 1) || (ramp_duration < 0)
        || (ramp_duration > MAX_RAMP_DURATION)) {
        pr_err(" %s Invalid arguments", __func__);

        ret = -EINVAL;
        goto done;
    }

    pr_debug("%s: mute=%d session_id=%#x ramp_duration=%d\n", __func__,
        mute, session_id, ramp_duration);
    voc_set_phonememo_tx_mute(voc_get_session_id(VOICE_SESSION_NAME), TX_PATH, mute);

    done:
    return 0;
}
static long sky_direct_adsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
    unsigned long flags;
    void __user *argp = (void __user *)arg;

  	int ret = 0;
	int32_t media_type = 0;
	uint32_t rate_type = 0;
    uint32_t evrc_min_rate_type = 0;
	uint32_t evrc_max_rate_type = 0;

 	SKY_DIRECT_ADSP_DBG_HIGH("sky_direct_adsp_ioctl cmd:%d, arg:%ld ", cmd, arg);

    mutex_lock(&voip_info.lock);

    if(_IOC_TYPE(cmd) != IOCTL_SKY_DIRECT_ADSP_MAGIC)
    {
        SKY_DIRECT_ADSP_ERR("[%s] invalid Magic Char [%c]\n", __func__, _IOC_TYPE(cmd));
        mutex_unlock(&voip_info.lock);
        return -EINVAL;
    }
    
    if(_IOC_NR(cmd) >= IOCTL_SKY_DIRECT_ADSP_MAXNR)
    {
        SKY_DIRECT_ADSP_ERR("[%s] invalid Magic Char [%c]\n", __func__, _IOC_TYPE(cmd));
        mutex_unlock(&voip_info.lock);
        return -EINVAL;
    }

    switch(cmd)
    {
        case IOCTL_SKY_DIRECT_ADSP_START:
            SKY_DIRECT_ADSP_DBG_LOW("sky_direct_adsp_ioctl(), start SKY Direct ADSP!!");
            bUseSKYDirectADSP = true;
            break;
        case IOCTL_SKY_DIRECT_ADSP_STOP:
            SKY_DIRECT_ADSP_DBG_LOW("sky_direct_adsp_ioctl(), stop SKY Direct ADSP!!");
            bUseSKYDirectADSP = false;            
            break;
        case IOCTL_SKY_DIRECT_ADSP_PCM_WB_MODE_SET:
            SKY_DIRECT_ADSP_DBG_LOW("sky_direct_adsp_ioctl(), set ADSP mode PCM-WB");
            MVS_MODE = MODE_PCM;
            if(voip_info.play_samp_rate != 16000 || voip_info.cap_samp_rate != 16000)
            {
       			voip_info.state = VOIP_STOPPED;
        		voc_end_voice_call(
        				voc_get_session_id(VOIP_SESSION_NAME));
        		
                voip_info.play_samp_rate = 16000;
                voip_info.pcm_size = snd_pcm_lib_buffer_bytes(voip_info.playback_substream);
                voip_info.pcm_count = snd_pcm_lib_period_bytes(voip_info.playback_substream);
                voip_info.pcm_playback_irq_pos = 0;
                voip_info.pcm_playback_buf_pos = 0;

                voip_info.cap_samp_rate = 16000;
                voip_info.pcm_capture_size  = snd_pcm_lib_buffer_bytes(voip_info.capture_substream);
                voip_info.pcm_capture_count = snd_pcm_lib_period_bytes(voip_info.capture_substream);
                voip_info.pcm_capture_irq_pos = 0;
                voip_info.pcm_capture_buf_pos = 0;
                    
        		ret = voip_get_rate_type(voip_info.mode,
        					voip_info.rate,
        					&rate_type);
                
        		if (ret < 0) {
        			SKY_DIRECT_ADSP_DBG_HIGH("fail at getting rate_type, set ADSP to default WB 23.85k rate\n");
                    voip_info.rate = 23850;
                    rate_type = AMR_RATE_23850 - AMR_RATE_6600;
        		}

        		voip_info.rate_type = rate_type;
            	ret = voip_get_media_type(voip_info.mode,
            					voip_info.play_samp_rate,
                				&media_type);
                
            	if (ret < 0) {
            		SKY_DIRECT_ADSP_DBG_HIGH("fail at getting media_type\n");
            		ret = -EINVAL;
            	}
                
            	pr_debug(" media_type=%d, rate_type=%d\n", media_type,
            		rate_type);
                
            	if ((voip_info.play_samp_rate == 16000) &&
            				(voip_info.cap_samp_rate == 16000))
                    voc_config_vocoder(media_type, rate_type,
                            VSS_NETWORK_ID_VOIP_WB,
                            voip_info.dtx_mode,
                            evrc_min_rate_type,
                            evrc_max_rate_type);
            	else {
            		SKY_DIRECT_ADSP_DBG_HIGH("%s: Invalid rate playback %d, capture %d\n",
            			 __func__, voip_info.play_samp_rate,
            			 voip_info.cap_samp_rate);
            		ret = -EINVAL;
            	}
                
            	voc_start_voice_call(voc_get_session_id(VOIP_SESSION_NAME));

            	voip_info.state = VOIP_STARTED;
            }
            break;
        case IOCTL_SKY_DIRECT_ADSP_PCM_NB_MODE_SET:
            SKY_DIRECT_ADSP_DBG_LOW("sky_direct_adsp_ioctl(), set ADSP mode PCM-NB");
            MVS_MODE = MODE_PCM;
            if(voip_info.play_samp_rate != 8000 || voip_info.cap_samp_rate != 8000)
            {
       			voip_info.state = VOIP_STOPPED;
        		voc_end_voice_call(
        				voc_get_session_id(VOIP_SESSION_NAME));

                voip_info.play_samp_rate = 8000;
                voip_info.pcm_size = snd_pcm_lib_buffer_bytes(voip_info.playback_substream);
                voip_info.pcm_count = snd_pcm_lib_period_bytes(voip_info.playback_substream);
                voip_info.pcm_playback_irq_pos = 0;
                voip_info.pcm_playback_buf_pos = 0;

                voip_info.cap_samp_rate = 8000;
                voip_info.pcm_capture_size  = snd_pcm_lib_buffer_bytes(voip_info.capture_substream);
                voip_info.pcm_capture_count = snd_pcm_lib_period_bytes(voip_info.capture_substream);
                voip_info.pcm_capture_irq_pos = 0;
                voip_info.pcm_capture_buf_pos = 0;
                    
        		ret = voip_get_rate_type(voip_info.mode,
        					voip_info.rate,
        					&rate_type);
                
        		if (ret < 0) {
        			SKY_DIRECT_ADSP_DBG_HIGH("fail at getting rate_type, set ADSP to default WB 23.85k rate\n");
                    voip_info.rate = 23850;
                    rate_type = AMR_RATE_23850 - AMR_RATE_6600;
        		}

        		voip_info.rate_type = rate_type;
            	ret = voip_get_media_type(voip_info.mode,
            					voip_info.play_samp_rate,
                				&media_type);
                
            	if (ret < 0) {
            		SKY_DIRECT_ADSP_DBG_HIGH("fail at getting media_type\n");
            		ret = -EINVAL;
            	}
                
            	pr_debug(" media_type=%d, rate_type=%d\n", media_type,
            		rate_type);
                
            	if ((voip_info.play_samp_rate == 8000) &&
            				(voip_info.cap_samp_rate == 8000))
                    voc_config_vocoder(media_type, rate_type,
                            VSS_NETWORK_ID_VOIP_NB,
                            voip_info.dtx_mode,
                            evrc_min_rate_type,
                            evrc_max_rate_type);
            	else {
            		SKY_DIRECT_ADSP_DBG_HIGH("%s: Invalid rate playback %d, capture %d\n",
            			 __func__, voip_info.play_samp_rate,
            			 voip_info.cap_samp_rate);
            		ret = -EINVAL;
            	}
                
            	voc_start_voice_call(voc_get_session_id(VOIP_SESSION_NAME));

            	voip_info.state = VOIP_STARTED;
            }
            break;
        case IOCTL_SKY_DIRECT_ADSP_AMR_WB_MODE_SET:
            SKY_DIRECT_ADSP_DBG_HIGH("sky_direct_adsp_ioctl(), set ADSP mode AMR-WB");
            MVS_MODE = MODE_AMR_WB;

            if(copy_from_user(&flags, argp, sizeof(flags)))
            {
                mutex_unlock(&voip_info.lock);
                return -EFAULT;
            }
            else
            {
                voip_info.rate = (uint32_t)flags;
            }

            if(MVS_MODE != voip_info.mode)
            {
                // TODO:  implement restart ADSP routine with new AMR-WB mode setting
                if(voip_info.state == VOIP_STARTED)
                {
                    //stop ADSP
           			voip_info.state = VOIP_STOPPED;
            		voc_end_voice_call(
            				voc_get_session_id(VOIP_SESSION_NAME));
            		//voc_register_mvs_cb(NULL, NULL, voip_info);

                    //restart ASDP
                    voip_info.mode = MODE_AMR_WB;

            		ret = voip_get_rate_type(voip_info.mode,
            					voip_info.rate,
            					&rate_type);
                    
            		if (ret < 0) {
            			pr_err("fail at getting rate_type, set ADSP to default WB 23.85k rate\n");
                        voip_info.rate = 23850;
                        rate_type = AMR_RATE_23850 - AMR_RATE_6600;
            		}

            		voip_info.rate_type = rate_type;
                	ret = voip_get_media_type(voip_info.mode,
                					voip_info.play_samp_rate,
                					&media_type);
                    
                	if (ret < 0) {
                		pr_err("fail at getting media_type\n");
                		ret = -EINVAL;
                	}
                    
                	pr_debug(" media_type=%d, rate_type=%d\n", media_type,
                		rate_type);
                    
                	if ((voip_info.play_samp_rate == 16000) &&
                				(voip_info.cap_samp_rate == 16000))
                        voc_config_vocoder(media_type, rate_type,
                                VSS_NETWORK_ID_VOIP_WB,
                                voip_info.dtx_mode,
                                evrc_min_rate_type,
                                evrc_max_rate_type);
                	else {
                		pr_debug("%s: Invalid rate playback %d, capture %d\n",
                			 __func__, voip_info.play_samp_rate,
                			 voip_info.cap_samp_rate);
                		ret = -EINVAL;
                	}
//                	voc_register_mvs_cb(voip_process_ul_pkt,
//                				voip_process_dl_pkt, voip_info);
                	voc_start_voice_call(voc_get_session_id(VOIP_SESSION_NAME));

                	voip_info.state = VOIP_STARTED;
                }
                else
                {
                    SKY_DIRECT_ADSP_ERR("sky_direct_adsp_ioctl() failed, voip_info.state : %d",voip_info.state);        
                }
            }
            break;
        case IOCTL_SKY_DIRECT_ADSP_AMR_NB_MODE_SET:
            SKY_DIRECT_ADSP_DBG_HIGH("sky_direct_adsp_ioctl(), set ADSP mode AMR-NB");
            MVS_MODE = MODE_AMR;
            
            if(copy_from_user(&flags, argp, sizeof(flags)))
            {
                mutex_unlock(&voip_info.lock);
                return -EFAULT;
            }
            else
            {
                voip_info.rate = (uint32_t)flags;
            }

            if(MVS_MODE != voip_info.mode)
            {
                // TODO:  implement restart ADSP routine with new AMR-NB mode setting
                if(voip_info.state == VOIP_STARTED)
                {
                    //stop ADSP
           			voip_info.state = VOIP_STOPPED;
            		voc_end_voice_call(
            				voc_get_session_id(VOIP_SESSION_NAME));
            		//voc_register_mvs_cb(NULL, NULL, voip_info);

                    //restart ASDP
                    voip_info.mode = MODE_AMR;

            		ret = voip_get_rate_type(voip_info.mode,
            					voip_info.rate,
            					&rate_type);
                    
            		if (ret < 0) {
            			pr_err("fail at getting rate_type, set ADSP to default NB 12.2k rate\n");
                        voip_info.rate = 12200;
                        rate_type = AMR_RATE_12200;
            		}
                    
               		voip_info.rate_type = rate_type;
                	ret = voip_get_media_type(voip_info.mode,
                					voip_info.play_samp_rate,
                					&media_type);
                    
                	if (ret < 0) {
                		pr_err("fail at getting media_type\n");
                		ret = -EINVAL;
                	}
                    
                	pr_debug(" media_type=%d, rate_type=%d\n", media_type,
                		rate_type);
                    
                	if ((voip_info.play_samp_rate == 8000) &&
                				(voip_info.cap_samp_rate == 8000))
                        voc_config_vocoder(media_type, rate_type,
                                VSS_NETWORK_ID_VOIP_NB,
                                voip_info.dtx_mode,
                                evrc_min_rate_type,
                                evrc_max_rate_type);
                	else {
                		pr_debug("%s: Invalid rate playback %d, capture %d\n",
                			 __func__, voip_info.play_samp_rate,
                			 voip_info.cap_samp_rate);
                		ret = -EINVAL;
                	}
//                	voc_register_mvs_cb(voip_process_ul_pkt,
//                				voip_process_dl_pkt, voip_info);
                	voc_start_voice_call(voc_get_session_id(VOIP_SESSION_NAME));

                	voip_info.state = VOIP_STARTED;
                }
                else
                {
                    SKY_DIRECT_ADSP_ERR("sky_direct_adsp_ioctl() failed, voip_info.state : %d",voip_info.state);        
                }
            }
            break;
        default:
            SKY_DIRECT_ADSP_DBG_HIGH("sky_direct_adsp_ioctl(), set ADSP mode PCM");
            MVS_MODE = MODE_PCM;
            break;
    }

    mutex_unlock(&voip_info.lock);

    return ret;
}