static int msm_pcm_close(struct snd_pcm_substream *substream)
{

	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_voice *prtd = runtime->private_data;
	uint16_t session_id = 0;
	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");
		if (is_volte(prtd))
			session_id = voc_get_session_id(VOLTE_SESSION_NAME);
		else if (is_voice2(prtd))
			session_id = voc_get_session_id(VOICE2_SESSION_NAME);
		else
			session_id = voc_get_session_id(VOICE_SESSION_NAME);
		voc_end_voice_call(session_id);
	}
	mutex_unlock(&prtd->lock);

	return ret;
}
Exemple #2
0
static int msm_pcm_close(struct snd_pcm_substream *substream)
{
	int ret = 0;

	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);
	return ret;
}
Exemple #3
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;

    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();
    }
    mutex_unlock(&prtd->lock);

    return ret;
}