diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2020-11-13 07:15:20 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-11-18 21:00:07 +0300 |
commit | a4e427c59a266dc3eb0eb5d52879b067a6f6e73b (patch) | |
tree | 94e93b140c6ae312b956b7b6937d2a6ce0327aba /sound/soc/soc-component.c | |
parent | 5268e0bf7123c422892fec362f5be2bcae9bbb95 (diff) | |
download | linux-a4e427c59a266dc3eb0eb5d52879b067a6f6e73b.tar.xz |
ASoC: soc-component: add snd_soc_component_compr_open()
component related function should be implemented at
soc-component.c.
This patch moves soc-compress soc_compr_components_open()
to soc-component as snd_soc_component_compr_open().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87ft5d7v7x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-component.c')
-rw-r--r-- | sound/soc/soc-component.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index 6d719c2db92e..a711bee11712 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -421,6 +421,29 @@ EXPORT_SYMBOL_GPL(snd_soc_component_exit_regmap); #endif +int snd_soc_component_compr_open(struct snd_compr_stream *cstream, + struct snd_soc_component **last) +{ + struct snd_soc_pcm_runtime *rtd = cstream->private_data; + struct snd_soc_component *component; + int i, ret; + + for_each_rtd_components(rtd, i, component) { + if (component->driver->compress_ops && + component->driver->compress_ops->open) { + ret = component->driver->compress_ops->open(component, cstream); + if (ret < 0) { + *last = component; + return soc_component_ret(component, ret); + } + } + } + + *last = NULL; + return 0; +} +EXPORT_SYMBOL_GPL(snd_soc_component_compr_open); + static unsigned int soc_component_read_no_lock( struct snd_soc_component *component, unsigned int reg) |