ASoC: soc-pcm: call snd_soc_component_open/close() once

Current soc_pcm_open() calls snd_soc_component_open() under loop.
Thus, it needs to care about opened/not-yet-opened Component.

But, if soc-component.c is handling it, soc-pcm.c don't need to care
about it.
This patch adds opened flag to soc-component.h, and simplify soc-pcm.c.
This is one of prepare for cleanup soc-pcm-open()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/874kvzcey1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto
2020-02-12 23:51:36 +00:00
committed by Mark Brown
parent 514de1c935
commit dd03907bf1
3 changed files with 39 additions and 22 deletions
+5 -2
View File
@@ -147,8 +147,6 @@ struct snd_soc_component {
unsigned int active;
unsigned int suspended:1; /* is in suspend PM state */
struct list_head list;
struct list_head card_aux_list; /* for auxiliary bound components */
struct list_head card_list;
@@ -182,6 +180,11 @@ struct snd_soc_component {
struct dentry *debugfs_root;
const char *debugfs_prefix;
#endif
/* bit field */
unsigned int suspended:1; /* is in suspend PM state */
unsigned int opened:1;
unsigned int module:1;
};
#define for_each_component_dais(component, dai)\