Specify clock provider directly to CPU DAIs
authorMark Brown <broonie@kernel.org>
Thu, 9 Jun 2022 10:26:00 +0000 (11:26 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 9 Jun 2022 10:56:32 +0000 (11:56 +0100)
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Currently the 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. However, as things
are now broken down into components which can be connected as either
the CPU or CODEC side of a DAI link it simplifies things if each
side of the link is just told if it is provider or consumer of the
clocks. Making this change allows us to remove one of the last parts
of the ASoC core that needs to know if a driver is a CODEC driver,
where it flips the clock format specifier if a CODEC driver is used on
the CPU side of a DAI link, as well as just being conceptually more
consistent with componentisation.

The basic idea of this patch chain is to change the set_fmt callback
from specifying if the CODEC is provider/consumer into directly
specifying if the component is provider/consumer. To do this we add
some new defines, and then to preserve bisectability, the migration is
done by adding a new callback, converting over all existing CPU side
drivers, converting the core, and then finally reverting back to the
old callback.

Converting the platform drivers makes sense as the existing defines
are from the perspective of the CODEC and there are more CODEC drivers
than platform drivers.

Obviously a fair amount of this patch chain I was only able to build
test, so any testing that can be done would be greatly appreciated.

1  2 
sound/soc/fsl/fsl_mqs.c
sound/soc/fsl/fsl_sai.c
sound/soc/generic/simple-card-utils.c
sound/soc/intel/atom/sst-atom-controls.c
sound/soc/intel/boards/bytcr_rt5640.c
sound/soc/intel/boards/bytcr_rt5651.c
sound/soc/intel/boards/cht_bsw_rt5645.c
sound/soc/stm/stm32_sai_sub.c
sound/soc/ux500/ux500_msp_dai.c

Simple merge
Simple merge
index 0beda9739ebedbeb960dc8f5719fcc341b5ab883,50a98270893353d4aa1d7521e010796e6fdd18e3..7be84c7840cbb91e72b97982766df6c025ea47fa
@@@ -513,7 -513,12 +513,12 @@@ static int asoc_simple_init_dai(struct 
        return 0;
  }
  
 -static int asoc_simple_init_dai_link_params(struct snd_soc_pcm_runtime *rtd,
+ static inline int asoc_simple_component_is_codec(struct snd_soc_component *component)
+ {
+       return component->driver->endianness;
+ }
 +static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
                                            struct simple_dai_props *dai_props)
  {
        struct snd_soc_dai_link *dai_link = rtd->dai_link;
Simple merge
Simple merge
Simple merge
Simple merge