diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-08-15 21:01:29 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-08-18 12:19:18 +0200 |
commit | 66201cacc33d740057bd64af6371ad846cff376f (patch) | |
tree | dbd358da5e2dae65d569cdd223fd3c84bf830291 /sound/soc/soc-pcm.c | |
parent | media: solo6x10: Convert to generic PCM copy ops (diff) | |
download | linux-66201cacc33d740057bd64af6371ad846cff376f.tar.xz linux-66201cacc33d740057bd64af6371ad846cff376f.zip |
ASoC: component: Add generic PCM copy ops
For following the ALSA PCM core change, a new PCM copy ops is added
toe ASoC component framework: snd_soc_component_driver receives the
copy ops, and snd_soc_pcm_component_copy() helper is provided.
This also fixes a long-standing potential bug where the ASoC driver
covers only copy_user PCM callback and misses the copy from kernel
pointers (such as OSS PCM layer), too.
As of this patch, the old copy_user is still kept, but it'll be
dropped later after all drivers are converted.
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230815190136.8987-19-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 8896227e4fb7..71403da28d37 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2973,7 +2973,9 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) rtd->ops.ioctl = snd_soc_pcm_component_ioctl; if (drv->sync_stop) rtd->ops.sync_stop = snd_soc_pcm_component_sync_stop; - if (drv->copy_user) + if (drv->copy) + rtd->ops.copy = snd_soc_pcm_component_copy; + else if (drv->copy_user) rtd->ops.copy_user = snd_soc_pcm_component_copy_user; if (drv->page) rtd->ops.page = snd_soc_pcm_component_page; |