ASoC: soc-core: add snd_soc_daifmt_parse_format/clock_provider()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 14 Jun 2021 00:57:08 +0000 (09:57 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 21 Jun 2021 12:05:17 +0000 (13:05 +0100)
commit7766861d1f8d3afc35361ab599eee6851fcd4416
tree0625291d2e79739a8f24bde8fef3954f27e02a80
parentb44a67f89366597364693e07e814660d5df8c66f
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>
include/sound/soc.h
sound/soc/soc-core.c