Unverified Commit 393648ce authored by Amadeusz Sławiński's avatar Amadeusz Sławiński Committed by Mark Brown
Browse files

ASoC: Intel: avs: Only create SSP%d snd_soc_dai_driver when requested



When using TDM configuration some other device may be using SSP%d, so
don't create snd_soc_dai_driver configuration for it unless requested
by TDM configuration.

While at it adjust tdf8532 board to explicitly describe TDM
configuration.

Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231012083514.492626-2-amadeuszx.slawinski@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 59825951
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ static struct snd_soc_acpi_mach avs_apl_i2s_machines[] = {
		.mach_params = {
			.i2s_link_mask = AVS_SSP_RANGE(0, 5),
		},
		.pdata = (unsigned long[]){ 0, 0, 0x14, 0, 0, 0 }, /* SSP2 TDMs */
		.pdata = (unsigned long[]){ 0x1, 0x1, 0x14, 0x1, 0x1, 0x1 }, /* SSP2 TDMs */
		.tplg_filename = "tdf8532-tplg.bin",
	},
	{
+17 −11
Original line number Diff line number Diff line
@@ -1238,7 +1238,11 @@ int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned l
	int i, j;

	ssp_count = adev->hw_cfg.i2s_caps.ctrl_count;
	cpu_count = hweight_long(port_mask);

	cpu_count = 0;
	for_each_set_bit(i, &port_mask, ssp_count)
		if (!tdms || test_bit(0, &tdms[i]))
			cpu_count++;
	if (tdms)
		for_each_set_bit(i, &port_mask, ssp_count)
			cpu_count += hweight_long(tdms[i]);
@@ -1249,6 +1253,7 @@ int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned l

	dai = cpus;
	for_each_set_bit(i, &port_mask, ssp_count) {
		if (!tdms || test_bit(0, &tdms[i])) {
			memcpy(dai, &i2s_dai_template, sizeof(*dai));

			dai->name =
@@ -1262,6 +1267,7 @@ int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned l
				return -ENOMEM;
			dai++;
		}
	}

	if (!tdms)
		goto plat_register;