Merge "ASoC: msm: qdsp6v2: Change device switch handling"

This commit is contained in:
Linux Build Service Account 2016-09-29 11:20:00 -07:00 committed by Gerrit - the friendly Code Review server
commit c5de06bf5c

View file

@ -395,6 +395,30 @@ static int msm_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
return ret;
}
static int msm_pcm_ioctl(struct snd_pcm_substream *substream,
unsigned int cmd, void *arg)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct msm_audio *prtd = runtime->private_data;
int dir = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 0 : 1;
struct audio_buffer *buf;
switch (cmd) {
case SNDRV_PCM_IOCTL1_RESET:
pr_debug("%s: %s SNDRV_PCM_IOCTL1_RESET\n", __func__,
dir == 0 ? "P" : "C");
buf = q6asm_shared_io_buf(prtd->audio_client, dir);
if (buf && buf->data)
memset(buf->data, 0, buf->actual_size);
break;
default:
break;
}
return snd_pcm_lib_ioctl(substream, cmd, arg);
}
static snd_pcm_uframes_t msm_pcm_pointer(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
@ -728,7 +752,7 @@ static struct snd_pcm_ops msm_pcm_ops = {
.prepare = msm_pcm_prepare,
.copy = msm_pcm_copy,
.hw_params = msm_pcm_hw_params,
.ioctl = snd_pcm_lib_ioctl,
.ioctl = msm_pcm_ioctl,
.trigger = msm_pcm_trigger,
.pointer = msm_pcm_pointer,
.mmap = msm_pcm_mmap,