diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 42f72c9b78ba..292f17f4fd7d 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2460,6 +2460,30 @@ out: return ret; } +#ifdef CONFIG_AUDIO_QGKI +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_component *component; + struct snd_soc_rtdcom_list *rtdcom; + + for_each_rtdcom(rtd, rtdcom) { + component = rtdcom->component; + + if (!component->driver->ops || + !component->driver->ops->compat_ioctl) + continue; + + /* FIXME: use 1st ioctl */ + return component->driver->ops->compat_ioctl( + substream, cmd, arg); + } + + return snd_pcm_lib_ioctl(substream, cmd, arg); +} +#endif + static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream) { struct snd_pcm_substream *substream = @@ -2924,6 +2948,9 @@ 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 = snd_soc_pcm_component_ioctl; +#ifdef CONFIG_AUDIO_QGKI + rtd->ops.compat_ioctl = soc_pcm_compat_ioctl; +#endif } else { rtd->ops.open = soc_pcm_open; rtd->ops.hw_params = soc_pcm_hw_params; @@ -2933,6 +2960,9 @@ 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 = snd_soc_pcm_component_ioctl; +#ifdef CONFIG_AUDIO_QGKI + rtd->ops.compat_ioctl = soc_pcm_compat_ioctl; +#endif } for_each_rtdcom(rtd, rtdcom) {