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

Commit be8e3143 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: core: Support for compress ioctls"

parents 35483e9c d5768539
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -68,6 +68,8 @@ struct snd_pcm_ops {
	int (*close)(struct snd_pcm_substream *substream);
	int (*close)(struct snd_pcm_substream *substream);
	int (*ioctl)(struct snd_pcm_substream * substream,
	int (*ioctl)(struct snd_pcm_substream * substream,
		     unsigned int cmd, void *arg);
		     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,
	int (*hw_params)(struct snd_pcm_substream *substream,
			 struct snd_pcm_hw_params *params);
			 struct snd_pcm_hw_params *params);
	int (*hw_free)(struct snd_pcm_substream *substream);
	int (*hw_free)(struct snd_pcm_substream *substream);
+22 −0
Original line number Original line Diff line number Diff line
@@ -649,6 +649,25 @@ enum {
#endif /* CONFIG_X86_X32 */
#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)
static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
{
{
	struct snd_pcm_file *pcm_file;
	struct snd_pcm_file *pcm_file;
@@ -726,6 +745,9 @@ static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned l
	case SNDRV_PCM_IOCTL_CHANNEL_INFO_X32:
	case SNDRV_PCM_IOCTL_CHANNEL_INFO_X32:
		return snd_pcm_ioctl_channel_info_x32(substream, argp);
		return snd_pcm_ioctl_channel_info_x32(substream, argp);
#endif /* CONFIG_X86_X32 */
#endif /* CONFIG_X86_X32 */
	default:
		if (_IOC_TYPE(cmd) == 'C')
			return snd_compressed_ioctl32(substream, cmd, argp);
	}
	}


	return -ENOIOCTLCMD;
	return -ENOIOCTLCMD;