diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2020-11-13 07:16:41 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-11-18 21:00:17 +0300 |
commit | bab78c238025c89df771631c54f6229f6c56fb26 (patch) | |
tree | d9881eed56fd59d57e532b308f618ca4a3b5c597 /sound/soc/soc-component.c | |
parent | 1b308fb138eba8dd57198b25235d8369a42af293 (diff) | |
download | linux-bab78c238025c89df771631c54f6229f6c56fb26.tar.xz |
ASoC: soc-component: add snd_soc_component_compr_get_metadata()
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_get_metadata().
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/87zh3l6gl8.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 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index ef2b97631748..5d3a8dcd8d49 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -656,6 +656,26 @@ int snd_soc_component_compr_set_metadata(struct snd_compr_stream *cstream, } EXPORT_SYMBOL_GPL(snd_soc_component_compr_set_metadata); +int snd_soc_component_compr_get_metadata(struct snd_compr_stream *cstream, + struct snd_compr_metadata *metadata) +{ + 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->get_metadata) { + ret = component->driver->compress_ops->get_metadata( + component, cstream, metadata); + return soc_component_ret(component, ret); + } + } + + return 0; +} +EXPORT_SYMBOL_GPL(snd_soc_component_compr_get_metadata); + static unsigned int soc_component_read_no_lock( struct snd_soc_component *component, unsigned int reg) |