diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2022-05-19 17:42:23 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-06-06 13:33:25 +0200 |
commit | 905f3a04e184854555fc248ca4e692fdbf2f2547 (patch) | |
tree | 0e2a229e772e87d50e9512a8a223ad688d43ffca /sound/soc/soc-dai.c | |
parent | Merge existing fixes from asoc/for-5.19 into new branch (diff) | |
download | linux-905f3a04e184854555fc248ca4e692fdbf2f2547.tar.xz linux-905f3a04e184854555fc248ca4e692fdbf2f2547.zip |
ASoC: core: Add set_fmt_new callback that directly specifies provider
The original set_fmt callback always passes clock provider/consumer
with respect to the CODEC. This made sense when the framework was
directly broken down into platforms and CODECs. Now everything is
componentised it simplifies things if each side of the link is
just told if it is provider or consumer of the clocks. To start
this migration add a new callback that can be used to receive a
direct specification of clocking. As there are more CODEC drivers
than platform drivers, we make the new flags identical to the old
CODEC flags meaning CODEC drivers will not require an update.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220519154318.2153729-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dai.c')
-rw-r--r-- | sound/soc/soc-dai.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 6078afe335f8..996712f4d9bf 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -209,7 +209,10 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) int ret = -ENOTSUPP; if (dai->driver->ops && - dai->driver->ops->set_fmt) + dai->driver->ops->set_fmt_new) + ret = dai->driver->ops->set_fmt_new(dai, fmt); + else if (dai->driver->ops && + dai->driver->ops->set_fmt) ret = dai->driver->ops->set_fmt(dai, fmt); return soc_dai_ret(dai, ret); |