mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
ASoC: pcm: Add support for compat mode
When kernel is compiled for 64 bit and userspace client is in 32 bit mode compat ioctl path will be taken. If platform driver supports compat mode asoc framework should call compat function pointers. Change adds support in asoc framework to support compat mode. Change-Id: I4929bc89c2ad467cdc83f5a00fe9d38e425c3ca2 Signed-off-by: Gopikrishnaiah Anand <agopik@codeaurora.org> Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org> Signed-off-by: Meng Wang <mwang@codeaurora.org>
This commit is contained in:
parent
567264c6cb
commit
f61bddd304
1 changed files with 30 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue