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

Commit 2cedc609 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes I4929bc89,If7223ace into msm-next

* changes:
  ASoC: pcm: Add support for compat mode
  ASoC: core: Support for compress ioctls
parents e0bbf839 b5d4dbcb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ struct snd_pcm_ops {
	int (*close)(struct snd_pcm_substream *substream);
	int (*ioctl)(struct snd_pcm_substream * substream,
		     unsigned int cmd, void *arg);
	int (*compat_ioctl)(struct snd_pcm_substream *substream,
		     unsigned int cmd, void *arg);
	int (*hw_params)(struct snd_pcm_substream *substream,
			 struct snd_pcm_hw_params *params);
	int (*hw_free)(struct snd_pcm_substream *substream);
+22 −0
Original line number Diff line number Diff line
@@ -651,6 +651,25 @@ enum {
#endif /* CONFIG_X86_X32 */
};

static int snd_compressed_ioctl32(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;
	if (substream->ops->compat_ioctl) {
		err = substream->ops->compat_ioctl(substream, cmd, arg);
	} else {
		err = -ENOIOCTLCMD;
		pr_err("%s failed cmd = %d\n", __func__, cmd);
	}
	pr_debug("%s called with cmd = %d\n", __func__, cmd);
	return err;
}

static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
{
	struct snd_pcm_file *pcm_file;
@@ -728,6 +747,9 @@ static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned l
	case SNDRV_PCM_IOCTL_CHANNEL_INFO_X32:
		return snd_pcm_ioctl_channel_info_x32(substream, argp);
#endif /* CONFIG_X86_X32 */
	default:
		if (_IOC_TYPE(cmd) == 'C')
			return snd_compressed_ioctl32(substream, cmd, argp);
	}

	return -ENOIOCTLCMD;
+14 −0
Original line number Diff line number Diff line
@@ -2350,6 +2350,18 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
	return ret;
}

static int soc_pcm_compat_ioctl(struct snd_pcm_substream *substream,
		     unsigned int cmd, void *arg)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_platform *platform = rtd->platform;

	if (platform->driver->ops->compat_ioctl)
		return platform->driver->ops->compat_ioctl(substream,
			cmd, arg);
	return snd_pcm_lib_ioctl(substream, cmd, arg);
}

static int soc_pcm_ioctl(struct snd_pcm_substream *substream,
		     unsigned int cmd, void *arg)
{
@@ -2808,6 +2820,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
		rtd->ops.close		= dpcm_fe_dai_close;
		rtd->ops.pointer	= soc_pcm_pointer;
		rtd->ops.ioctl		= soc_pcm_ioctl;
		rtd->ops.compat_ioctl   = soc_pcm_compat_ioctl;
	} else {
		rtd->ops.open		= soc_pcm_open;
		rtd->ops.hw_params	= soc_pcm_hw_params;
@@ -2817,6 +2830,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
		rtd->ops.close		= soc_pcm_close;
		rtd->ops.pointer	= soc_pcm_pointer;
		rtd->ops.ioctl		= soc_pcm_ioctl;
		rtd->ops.compat_ioctl   = soc_pcm_compat_ioctl;
	}

	if (platform->driver->ops) {