Commit 8f1a1681 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-utils: add snd_soc_component_is_dummy()

There is snd_soc_dai_is_dummy(), but not for component.
This patch adds it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zgxzxa2t.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ee39d77e
...@@ -338,6 +338,7 @@ static inline int snd_soc_component_cache_sync( ...@@ -338,6 +338,7 @@ static inline int snd_soc_component_cache_sync(
void snd_soc_component_set_aux(struct snd_soc_component *component, void snd_soc_component_set_aux(struct snd_soc_component *component,
struct snd_soc_aux_dev *aux); struct snd_soc_aux_dev *aux);
int snd_soc_component_init(struct snd_soc_component *component); int snd_soc_component_init(struct snd_soc_component *component);
int snd_soc_component_is_dummy(struct snd_soc_component *component);
/* component IO */ /* component IO */
unsigned int snd_soc_component_read(struct snd_soc_component *component, unsigned int snd_soc_component_read(struct snd_soc_component *component,
......
...@@ -1169,7 +1169,7 @@ static int soc_probe_component(struct snd_soc_card *card, ...@@ -1169,7 +1169,7 @@ static int soc_probe_component(struct snd_soc_card *card,
int probed = 0; int probed = 0;
int ret; int ret;
if (!strcmp(component->name, "snd-soc-dummy")) if (snd_soc_component_is_dummy(component))
return 0; return 0;
if (component->card) { if (component->card) {
......
...@@ -131,6 +131,12 @@ int snd_soc_dai_is_dummy(struct snd_soc_dai *dai) ...@@ -131,6 +131,12 @@ int snd_soc_dai_is_dummy(struct snd_soc_dai *dai)
return 0; return 0;
} }
int snd_soc_component_is_dummy(struct snd_soc_component *component)
{
return ((component->driver == &dummy_platform) ||
(component->driver == &dummy_codec));
}
static int snd_soc_dummy_probe(struct platform_device *pdev) static int snd_soc_dummy_probe(struct platform_device *pdev)
{ {
int ret; int ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment