Skip to content

Conversation

@rfvirgil
Copy link

This series prepares for dissimilar aggregation of CS42L43 + CS35L56 speaker playback. The CS35L56 SoundWire DAI is split into separate DAIs for playback and capture so they can be routed and aggregated differently.

The cs_amp driver is also updated to enable different TX (capture) slots on each CS35L56 on a bus, so that the captures can be aggregated.

This patch splits the SoundWire capture DP into a separate DAI so that
it can be independently routed and/or aggregated. It also makes
corresponding changes to the SOF SoundWire machine driver.

The playback and capture over SoundWire are separate DPs so don't have to
route to the same place. They could also be aggregated differently - for
example the playback DP could be aggregated with a playback-only DAI on
a codec.

No production device currently uses the capture path and their topologies
do not connect it. So there is no need to change the machine driver match
table entries for these. They will simply drop the unused capture DAI.

There is one hookup used for a non-production development board that was
added by commit 05fe628 ("ASoC: Intel: soc-acpi-intel-mtl-match: add
acpi match table for cdb35l56-eight-c") This is the only hookup using a
topology that connects the SoundWire DP for capture, so this hookup has
been changed to include an aggregated endpoint for the capture DAI.

Signed-off-by: Richard Fitzgerald <[email protected]>
@rfvirgil rfvirgil marked this pull request as ready for review November 18, 2024 17:14
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one open.

…dec on a bus

Use snd_soc_dai_set_tdm_slot() on capture DAIs to prevent multiple
aggregated amps from trying to send data at the same time.

When the capture DAIs of multiple amps on a bus are aggregated they will
all be sharing the same bit slots for transmitted audio. This would lead
to bus errors if all channels on all amps were enabled, because multiple
amps would be trying to send data at the same time.

To prevent this, the available channels are divided between the amps on a
bus so that only one amp will be sending data for each channel position.

A CS35L56 has 4 TX channels, which must be split between all the amps on a
bus so that no two amps are using the same channel. This is done simply by
dividing by the number of amps on the bus, so that 1 amp can use all
4 channels, 2 amps can use 2 channels each, and 3 or 4 amps can only use
1 channel each.

The amps are usually aggregated across multiple SoundWire buses. In this
case there will be multiple cpu DAIs in the dailink. The channel mapping
is used to determine which amps are on each bus. The allocation of the
4 channels is done separately for each bus (only amps on the same bus can
interfere with each other).

Signed-off-by: Richard Fitzgerald <[email protected]>
@rfvirgil rfvirgil force-pushed the topic/cs35l56/dai-split branch from 6237f92 to a6d4158 Compare November 19, 2024 13:53
@rfvirgil
Copy link
Author

Second patch updated

@ranj063 ranj063 merged commit 74d4c78 into thesofproject:topic/sof-dev Nov 20, 2024
11 of 14 checks passed
@bardliao
Copy link
Collaborator

bardliao commented Dec 3, 2024

@rfvirgil Would you like to send the commits upstream? Or you prefer me to do this?

@rfvirgil
Copy link
Author

rfvirgil commented Dec 3, 2024

@bardliao I suggest you do it. I submitted it through your tree to avoid a conflict on the generic soc_sdw_utils code.
If you'd prefer me to upstream them separately I can do that.

@bardliao
Copy link
Collaborator

bardliao commented Dec 3, 2024

@bardliao I suggest you do it. I submitted it through your tree to avoid a conflict on the generic soc_sdw_utils code. If you'd prefer me to upstream them separately I can do that.

Sure, I will do it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants