Unverified Commit fc34ece4 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Refactor non_legacy_dai_naming flag

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Historically, the legacy DAI naming scheme was applied to platform
drivers and the newer scheme to CODEC drivers. During componentisation
the core lost the knowledge of if a driver was a CODEC or platform, they
were all now components. To continue to support the legacy naming on
older platform drivers a flag was added to the snd_soc_component_driver
structure, non_legacy_dai_naming, to indicate to use the new scheme and
this was applied to all CODECs as part of the migration.

However, a slight issue appears to be developing with respect to this
flag being opt in for the non-legacy scheme, which presumably we want to
be the primary scheme used. Many codec drivers appear to forget to
include this flag:

  grep -l -r "snd_soc_component_driver" sound/soc/codecs/*.c |
  xargs grep -L "non_legacy_dai_naming" | wc
     48      48    556

Whilst in many cases the configuration of the DAIs themselves will cause
the core to apply the new scheme anyway, it would seem more sensible to
change the flag to legacy_dai_naming making the new scheme opt out. This
patch series migrates across to such a scheme.
parents 7ed18664 01936221
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1969,6 +1969,7 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data,

static const struct snd_soc_component_driver vc4_hdmi_audio_cpu_dai_comp = {
	.name = "vc4-hdmi-cpu-dai-component",
	.legacy_dai_naming = 1,
};

static int vc4_hdmi_audio_cpu_dai_probe(struct snd_soc_dai *dai)
+0 −1
Original line number Diff line number Diff line
@@ -2517,7 +2517,6 @@ static struct snd_soc_component_driver tda1997x_codec_driver = {
	.idle_bias_on		= 1,
	.use_pmdown_time	= 1,
	.endianness		= 1,
	.non_legacy_dai_naming	= 1,
};

static int tda1997x_probe(struct i2c_client *client,
+3 −2
Original line number Diff line number Diff line
@@ -1098,7 +1098,8 @@ static const struct snd_soc_dai_ops intel_pcm_dai_ops = {

static const struct snd_soc_component_driver dai_component = {
	.name			= "soundwire",
	.suspend	= intel_component_dais_suspend
	.suspend		= intel_component_dais_suspend,
	.legacy_dai_naming	= 1,
};

static int intel_create_dai(struct sdw_cdns *cdns,
+1 −1
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ struct snd_soc_component_driver {
	 * analogue).
	 */
	unsigned int endianness:1;
	unsigned int non_legacy_dai_naming:1;
	unsigned int legacy_dai_naming:1;

	/* this component uses topology and ignore machine driver FEs */
	const char *ignore_machine;
+1 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ static struct snd_soc_dai_driver axi_i2s_dai = {

static const struct snd_soc_component_driver axi_i2s_component = {
	.name = "axi-i2s",
	.legacy_dai_naming = 1,
};

static const struct regmap_config axi_i2s_regmap_config = {
Loading