Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b40e968a authored by Sudheer Papothi's avatar Sudheer Papothi Committed by Banajit Goswami
Browse files

ALSA: core: Add support to handle compressed audio IOCTLs



This is needed to support the compressed audio till the
compressed core is done with development.

Change-Id: Ifbde76e3bd0f354063bf2677dcca2f922fc3aeb9
Signed-off-by: default avatarAsish Bhattacharya <asishb@codeaurora.org>
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 8428b71d
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include <linux/dma-mapping.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/compress_offload.h>
#include <sound/info.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -1089,6 +1090,19 @@ int snd_pcm_start(struct snd_pcm_substream *substream)
			      SNDRV_PCM_STATE_RUNNING);
}

static int snd_compressed_ioctl(struct snd_pcm_substream *substream,
				 unsigned int cmd, void __user *arg)
{
	struct snd_pcm_runtime *runtime;
	int err = 0;

	if (PCM_RUNTIME_CHECK(substream))
		return -ENXIO;
	runtime = substream->runtime;
	pr_debug("%s called with cmd = %d\n", __func__, cmd);
	err = substream->ops->ioctl(substream, cmd, arg);
	return err;
}
/*
 * stop callbacks
 */
@@ -2826,6 +2840,13 @@ static int snd_pcm_common_ioctl1(struct file *file,
		snd_pcm_stream_unlock_irq(substream);
		return res;
	}
	case SNDRV_COMPRESS_GET_CAPS:
	case SNDRV_COMPRESS_GET_CODEC_CAPS:
	case SNDRV_COMPRESS_SET_PARAMS:
	case SNDRV_COMPRESS_GET_PARAMS:
	case SNDRV_COMPRESS_TSTAMP:
	case SNDRV_COMPRESS_DRAIN:
		return snd_compressed_ioctl(substream, cmd, arg);
	}
	pcm_dbg(substream->pcm, "unknown ioctl = 0x%x\n", cmd);
	return -ENOTTY;
@@ -2998,7 +3019,7 @@ static long snd_pcm_playback_ioctl(struct file *file, unsigned int cmd,

	pcm_file = file->private_data;

	if (((cmd >> 8) & 0xff) != 'A')
	if ((((cmd >> 8) & 0xff) != 'A') && (((cmd >> 8) & 0xff) != 'C'))
		return -ENOTTY;

	return snd_pcm_playback_ioctl1(file, pcm_file->substream, cmd,