diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-06-14 02:57:08 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-21 14:05:17 +0200 |
commit | 7766861d1f8d3afc35361ab599eee6851fcd4416 (patch) | |
tree | 0625291d2e79739a8f24bde8fef3954f27e02a80 /include/sound | |
parent | ASoC: soc-core: add snd_soc_daifmt_clock_provider_fliped() (diff) | |
download | linux-7766861d1f8d3afc35361ab599eee6851fcd4416.tar.xz linux-7766861d1f8d3afc35361ab599eee6851fcd4416.zip |
ASoC: soc-core: add snd_soc_daifmt_parse_format/clock_provider()
snd_soc_of_parse_daifmt() parses daifmt, but bitclock/frame provider
parsing part is one of headacke, because we are assuming below both cases.
A) node {
bitclock-master;
frame-master;
...
};
B) link {
bitclock-master = <&xxx>;
frame-master = <&xxx>;
...
};
The original was style A), and style B) was added later
by commit b3ca11ff59bc ("ASoC: simple-card: Move dai-link level
properties away from dai subnodes").
snd_soc_of_parse_daifmt() parses it as style A),
and user need to update it to style B) if needed.
To handle it more flexibile, this patch adds new functions
which separates snd_soc_of_parse_daifmt() helper function.
snd_soc_daifmt_parse_format() :for DAI format
snd_soc_daifmt_parse_clock_provider_as_flag() :for style A)
snd_soc_daifmt_parse_clock_provider_as_phandl() :for style B)
snd_soc_daifmt_parse_clock_provider_as_bitmap() :use with _from_bitmap
This means
snd_soc_of_parse_daifmt() ==
snd_soc_daifmt_parse_format() |
snd_soc_daifmt_parse_clock_provider_as_flag()
This patch also indicate relatesionship comment for
snd_soc_daifmt_clock_provider_from_bitmap().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877dixw9ej.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 45f3da277c5d..63194a8773cd 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1235,6 +1235,20 @@ int snd_soc_of_parse_aux_devs(struct snd_soc_card *card, const char *propname); unsigned int snd_soc_daifmt_clock_provider_fliped(unsigned int dai_fmt); unsigned int snd_soc_daifmt_clock_provider_from_bitmap(unsigned int bit_frame); + +unsigned int snd_soc_daifmt_parse_format(struct device_node *np, const char *prefix); +unsigned int snd_soc_daifmt_parse_clock_provider_raw(struct device_node *np, + const char *prefix, + struct device_node **bitclkmaster, + struct device_node **framemaster); +#define snd_soc_daifmt_parse_clock_provider_as_bitmap(np, prefix) \ + snd_soc_daifmt_parse_clock_provider_raw(np, prefix, NULL, NULL) +#define snd_soc_daifmt_parse_clock_provider_as_phandle \ + snd_soc_daifmt_parse_clock_provider_raw +#define snd_soc_daifmt_parse_clock_provider_as_flag(np, prefix) \ + snd_soc_daifmt_clock_provider_from_bitmap( \ + snd_soc_daifmt_parse_clock_provider_as_bitmap(np, prefix)) + unsigned int snd_soc_of_parse_daifmt(struct device_node *np, const char *prefix, struct device_node **bitclkmaster, |