mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
Merge "ALSA: Compress - dont use lock for all ioctls"
This commit is contained in:
commit
78d870eaec
1 changed files with 51 additions and 1 deletions
|
|
@ -950,6 +950,48 @@ static int snd_compr_set_next_track_param(struct snd_compr_stream *stream,
|
|||
retval = stream->ops->set_next_track_param(stream, &codec_options);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int snd_compress_simple_ioctls(struct file *file,
|
||||
struct snd_compr_stream *stream,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int retval = -ENOTTY;
|
||||
|
||||
switch (_IOC_NR(cmd)) {
|
||||
case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):
|
||||
retval = put_user(SNDRV_COMPRESS_VERSION,
|
||||
(int __user *)arg) ? -EFAULT : 0;
|
||||
break;
|
||||
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):
|
||||
retval = snd_compr_get_caps(stream, arg);
|
||||
break;
|
||||
|
||||
#ifndef COMPR_CODEC_CAPS_OVERFLOW
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
|
||||
retval = snd_compr_get_codec_caps(stream, arg);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case _IOC_NR(SNDRV_COMPRESS_TSTAMP):
|
||||
retval = snd_compr_tstamp(stream, arg);
|
||||
break;
|
||||
|
||||
case _IOC_NR(SNDRV_COMPRESS_AVAIL):
|
||||
retval = snd_compr_ioctl_avail(stream, arg);
|
||||
break;
|
||||
|
||||
case _IOC_NR(SNDRV_COMPRESS_DRAIN):
|
||||
retval = snd_compr_drain(stream);
|
||||
break;
|
||||
|
||||
case _IOC_NR(SNDRV_COMPRESS_PARTIAL_DRAIN):
|
||||
retval = snd_compr_partial_drain(stream);
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
||||
|
|
@ -965,6 +1007,7 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
|||
|
||||
mutex_lock(&stream->device->lock);
|
||||
switch (_IOC_NR(cmd)) {
|
||||
#ifndef CONFIG_AUDIO_QGKI
|
||||
case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):
|
||||
retval = put_user(SNDRV_COMPRESS_VERSION,
|
||||
(int __user *)arg) ? -EFAULT : 0;
|
||||
|
|
@ -976,6 +1019,7 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
|||
case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
|
||||
retval = snd_compr_get_codec_caps(stream, arg);
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):
|
||||
retval = snd_compr_set_params(stream, arg);
|
||||
|
|
@ -989,12 +1033,14 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
|||
case _IOC_NR(SNDRV_COMPRESS_GET_METADATA):
|
||||
retval = snd_compr_get_metadata(stream, arg);
|
||||
break;
|
||||
#ifndef CONFIG_AUDIO_QGKI
|
||||
case _IOC_NR(SNDRV_COMPRESS_TSTAMP):
|
||||
retval = snd_compr_tstamp(stream, arg);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_AVAIL):
|
||||
retval = snd_compr_ioctl_avail(stream, arg);
|
||||
break;
|
||||
#endif
|
||||
case _IOC_NR(SNDRV_COMPRESS_PAUSE):
|
||||
retval = snd_compr_pause(stream);
|
||||
break;
|
||||
|
|
@ -1007,12 +1053,14 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
|||
case _IOC_NR(SNDRV_COMPRESS_STOP):
|
||||
retval = snd_compr_stop(stream);
|
||||
break;
|
||||
#ifndef CONFIG_AUDIO_QGKI
|
||||
case _IOC_NR(SNDRV_COMPRESS_DRAIN):
|
||||
retval = snd_compr_drain(stream);
|
||||
break;
|
||||
case _IOC_NR(SNDRV_COMPRESS_PARTIAL_DRAIN):
|
||||
retval = snd_compr_partial_drain(stream);
|
||||
break;
|
||||
#endif
|
||||
case _IOC_NR(SNDRV_COMPRESS_NEXT_TRACK):
|
||||
retval = snd_compr_next_track(stream);
|
||||
break;
|
||||
|
|
@ -1020,8 +1068,10 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
|||
case _IOC_NR(SNDRV_COMPRESS_SET_NEXT_TRACK_PARAM):
|
||||
retval = snd_compr_set_next_track_param(stream, arg);
|
||||
break;
|
||||
default:
|
||||
mutex_unlock(&stream->device->lock);
|
||||
return snd_compress_simple_ioctls(f, stream, cmd, arg);
|
||||
#endif
|
||||
|
||||
}
|
||||
mutex_unlock(&stream->device->lock);
|
||||
return retval;
|
||||
|
|
|
|||
Loading…
Reference in a new issue