Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions sound/soc/codecs/max98373-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,16 @@ static int max98373_sdw_dai_hw_params(struct snd_pcm_substream *substream,
stream_config.bps = snd_pcm_format_width(params_format(params));
stream_config.direction = direction;

if (max98373->slot) {
if (max98373->slot && direction == SDW_DATA_DIR_RX) {
stream_config.ch_count = max98373->slot;
port_config.ch_mask = max98373->rx_mask;
} else {
stream_config.ch_count = params_channels(params);
/* only IV are supported by capture */
if (direction == SDW_DATA_DIR_TX)
stream_config.ch_count = 2;
else
stream_config.ch_count = params_channels(params);

port_config.ch_mask = GENMASK(stream_config.ch_count - 1, 0);
}

Expand Down Expand Up @@ -774,7 +779,8 @@ static int max98373_sdw_set_tdm_slot(struct snd_soc_dai *dai,
struct max98373_priv *max98373 =
snd_soc_component_get_drvdata(component);

if (!tx_mask && !rx_mask && !slots && !slot_width)
/* tx_mask is ignored since it's irrelevant for I/V feedback */
if (!rx_mask && !slots && !slot_width)
Copy link
Collaborator

Choose a reason for hiding this comment

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

would it not make sense to print a debug message if someone is trying to set tx_mask != 0?

Copy link
Member

Choose a reason for hiding this comment

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

good point @lyakh , for rt1308-sdw we used this:

int set_tdm_slot()
{
....
	if (tx_mask)
		return -EINVAL;
...
}

so maybe use the same solution for consistency?

@RanderWang maybe you can add this as a fixup! patch, i'd like to merge this to unlock the issue #2169. The additional check is does not add any functional value but is nice to have indeed, a really good candidate for a fixup.

Copy link
Author

Choose a reason for hiding this comment

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

done, please check #2202

max98373->tdm_mode = false;
else
max98373->tdm_mode = true;
Expand Down