mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 06:23:02 +02:00
ASoC: soc-component: add snd_soc_component_{set/to}_priv()
struct snd_soc_component will be capsuled soon, its member will not be
able to access from non soc-component.c.
Basically, each drivers are using dev_{set/get}_drvdata() to set own data,
but it is not enough. Let's add .priv.
Add snd_soc_component_{set/to}_priv() to access priv.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/87qzkurz7o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f6cfdd246c
commit
d99690513a
|
|
@ -253,6 +253,9 @@ struct snd_soc_component {
|
|||
void *mark_pm;
|
||||
|
||||
struct dentry *debugfs_root;
|
||||
|
||||
/* Component private data */
|
||||
void *priv;
|
||||
};
|
||||
|
||||
#define for_each_component_dais(component, dai)\
|
||||
|
|
@ -288,6 +291,9 @@ struct snd_soc_component *snd_soc_component_alloc(struct device *dev);
|
|||
void snd_soc_component_set_name(struct snd_soc_component *component, const char *name);
|
||||
const char *snd_soc_component_name(struct snd_soc_component *component);
|
||||
|
||||
void snd_soc_component_set_priv(struct snd_soc_component *component, void *priv);
|
||||
void *snd_soc_component_to_priv(struct snd_soc_component *component);
|
||||
|
||||
void snd_soc_component_set_aux(struct snd_soc_component *component,
|
||||
struct snd_soc_aux_dev *aux);
|
||||
int snd_soc_component_init(struct snd_soc_component *component);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,18 @@ const char *snd_soc_component_name(struct snd_soc_component *component)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_name);
|
||||
|
||||
void snd_soc_component_set_priv(struct snd_soc_component *component, void *priv)
|
||||
{
|
||||
component->priv = priv;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_set_priv);
|
||||
|
||||
void *snd_soc_component_to_priv(struct snd_soc_component *component)
|
||||
{
|
||||
return component->priv;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_to_priv);
|
||||
|
||||
/*
|
||||
* We might want to check substream by using list.
|
||||
* In such case, we can update these macros.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user