summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-component.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-06-04 17:07:54 +0900
committerMark Brown <broonie@kernel.org>2020-06-15 18:21:25 +0100
commit257c4dac8b7877c865e734533b5f62769c64afb6 (patch)
treea517cd2382890624ce43fa118a1175a5a95c59a5 /sound/soc/soc-component.c
parent32fd120475c1b8a83d28bfedc2b95ec981fbb809 (diff)
ASoC: soc-component: add snd_soc_component_init()
we wantn't to directly access to component related parameter as much as possible to keep encapsulation. This patch adds snd_soc_component_init() for it. 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/87img7w8x2.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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 150b02be0219..7624ff5b67d3 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -46,6 +46,22 @@ int snd_soc_component_initialize(struct snd_soc_component *component,
return 0;
}
+void snd_soc_component_set_aux(struct snd_soc_component *component,
+ struct snd_soc_aux_dev *aux)
+{
+ component->init = (aux) ? aux->init : NULL;
+}
+
+int snd_soc_component_init(struct snd_soc_component *component)
+{
+ int ret = 0;
+
+ if (component->init)
+ ret = component->init(component);
+
+ return soc_component_ret(component, ret);
+}
+
/**
* snd_soc_component_set_sysclk - configure COMPONENT system or master clock.
* @component: COMPONENT