diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-06-14 09:58:22 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-21 13:05:21 +0100 |
commit | 2c7fd9de8956ea1d8ea18b11d33fcf2fde9da81e (patch) | |
tree | f4394f5b19f449a95c0682755c27a425b3950f60 /sound/soc/generic | |
parent | 0c4c7a9667daf52c88cfc7fe44201ff653eab8f9 (diff) | |
download | linux-2c7fd9de8956ea1d8ea18b11d33fcf2fde9da81e.tar.bz2 |
ASoC: simple-card-utils: switch to use snd_soc_daifmt_parse_format/clock_provider()
This patch switch to use snd_soc_daifmt_parse_format/clock_provider() from
snd_soc_of_parse_daifmt().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871r95w9ch.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/simple-card-utils.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index fa1247f0dda1..677f7da93b4b 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -61,10 +61,9 @@ int asoc_simple_parse_daifmt(struct device *dev, struct device_node *framemaster = NULL; unsigned int daifmt; - daifmt = snd_soc_of_parse_daifmt(node, prefix, - &bitclkmaster, &framemaster); - daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK; + daifmt = snd_soc_daifmt_parse_format(node, prefix); + snd_soc_daifmt_parse_clock_provider_as_phandle(node, prefix, &bitclkmaster, &framemaster); if (!bitclkmaster && !framemaster) { /* * No dai-link level and master setting was not found from @@ -73,15 +72,10 @@ int asoc_simple_parse_daifmt(struct device *dev, */ dev_dbg(dev, "Revert to legacy daifmt parsing\n"); - daifmt = snd_soc_of_parse_daifmt(codec, NULL, NULL, NULL) | - (daifmt & ~SND_SOC_DAIFMT_CLOCK_MASK); + daifmt |= snd_soc_daifmt_parse_clock_provider_as_flag(codec, NULL); } else { - if (codec == bitclkmaster) - daifmt |= (codec == framemaster) ? - SND_SOC_DAIFMT_CBM_CFM : SND_SOC_DAIFMT_CBM_CFS; - else - daifmt |= (codec == framemaster) ? - SND_SOC_DAIFMT_CBS_CFM : SND_SOC_DAIFMT_CBS_CFS; + daifmt |= snd_soc_daifmt_clock_provider_from_bitmap( + ((codec == bitclkmaster) << 4) | (codec == framemaster)); } of_node_put(bitclkmaster); |