+static int rt1316_sdw_set_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask,
unsigned int rx_mask,
int slots, int slot_width)
+{
- struct snd_soc_component *component = dai->component;
- struct rt1316_sdw_priv *rt1316 =
snd_soc_component_get_drvdata(component);
- if (tx_mask)
return -EINVAL;
- if (slots > 2)
return -EINVAL;
- rt1316->rx_mask = rx_mask;
- rt1316->slots = slots;
- /* slot_width is not used since it's irrelevant for SoundWire */
I wouldn't expect to see any TDM stuff at all for SoundWire? I do see some crept through though :/
We only use the mask information to let codecs/amplifiers know which channels they need to pick in a stream. This is useful e.g. when we have two (or more) amplifiers on the same link, and you want to tell amplifierA to use ch0 and amplifierB to use ch1.
IIRC there was a similar concept in AC97, there was a mask information to tell devices which channel(s) they were supposed to work on. There are really not a lot of new concepts in SoundWire, the main change is the ability to share the same link to transport different data types/widths. It remains a serial multi-drop link and shares a lot of attributes with previous solutions. That's what lead us to use the same API, even if the slot_width is undefined/irrelevant.
In most cases though all amplifiers on Intel-based solutions extract the same information, and the output will be dynamically selected based on kcontrol information. This is easier to use for e.g. orientation and posture changes.