mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ASoC: soc-dai: add snd_soc_dai_{set/to}_priv()
DAI parameter will be capsuled soon, will be not enable to access from
each drivers. DAI priv has been mainly referred from SoundWire driver.
Let's add snd_soc_dai_{set/to}_priv() for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
Link: https://patch.msgid.link/87fqz7jpst.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
ee4f730ac8
commit
9ec8ccc97d
|
|
@ -566,6 +566,8 @@ struct list_head *snd_soc_dai_to_list(struct snd_soc_dai *dai);
|
|||
unsigned int snd_soc_dai_get_symmetric_rate(struct snd_soc_dai *dai);
|
||||
unsigned int snd_soc_dai_get_symmetric_channels(struct snd_soc_dai *dai);
|
||||
unsigned int snd_soc_dai_get_symmetric_sample_bits(struct snd_soc_dai *dai);
|
||||
void snd_soc_dai_set_priv(struct snd_soc_dai *dai, void *priv);
|
||||
void *snd_soc_dai_to_priv(struct snd_soc_dai *dai);
|
||||
|
||||
/* REMOVE ME */
|
||||
#define snd_soc_dai_get_pcm_stream snd_soc_dai_pcm_stream_get
|
||||
|
|
|
|||
|
|
@ -1507,7 +1507,7 @@ int sdca_asoc_set_constraints(struct device *dev, struct regmap *regmap,
|
|||
return ret;
|
||||
}
|
||||
|
||||
dai->priv = constraint;
|
||||
snd_soc_dai_set_priv(dai, constraint);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1523,7 +1523,7 @@ EXPORT_SYMBOL_NS(sdca_asoc_set_constraints, "SND_SOC_SDCA");
|
|||
void sdca_asoc_free_constraints(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_pcm_hw_constraint_list *constraint = dai->priv;
|
||||
struct snd_pcm_hw_constraint_list *constraint = snd_soc_dai_to_priv(dai);
|
||||
|
||||
kfree(constraint);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,18 @@ struct snd_soc_dai_driver *snd_soc_dai_to_driver(const struct snd_soc_dai *dai)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_dai_to_driver);
|
||||
|
||||
void snd_soc_dai_set_priv(struct snd_soc_dai *dai, void *priv)
|
||||
{
|
||||
dai->priv = priv;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_dai_set_priv);
|
||||
|
||||
void *snd_soc_dai_to_priv(struct snd_soc_dai *dai)
|
||||
{
|
||||
return dai->priv;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_dai_to_priv);
|
||||
|
||||
struct snd_soc_dai *snd_soc_dai_from_list(struct list_head *list)
|
||||
{
|
||||
return list_entry(list, struct snd_soc_dai, list);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user