linux/sound/soc/qcom
Pierre-Louis Bossart e8444560b4
ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire
The HDAudio ASoC support relies on the set_tdm_slots() helper to store
the HDaudio stream tag in the tx_mask. This only works because of the
pre-existing order in soc-pcm.c, where the hw_params() is handled for
codec_dais *before* cpu_dais. When the order is reversed, the
stream_tag is used as a mask in the codec fixup functions:

	/* fixup params based on TDM slot masks */
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
	    codec_dai->tx_mask)
		soc_pcm_codec_params_fixup(&codec_params,
					   codec_dai->tx_mask);

As a result of this confusion, the codec_params_fixup() ends-up
generating bad channel masks, depending on what stream_tag was
allocated.

We could add a flag to state that the tx_mask is really not a mask,
but it would be quite ugly to persist in overloading concepts.

Instead, this patch suggests a more generic get/set 'stream' API based
on the existing model for SoundWire. We can expand the concept to
store 'stream' opaque information that is specific to different DAI
types. In the case of HDAudio DAIs, we only need to store a stream tag
as an unsigned char pointer. The TDM rx_ and tx_masks should really
only be used to store masks.

Rename get_sdw_stream/set_sdw_stream callbacks and helpers as
get_stream/set_stream. No functionality change beyond the rename.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20211224021034.26635-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-24 14:06:47 +00:00
..
qdsp6 ASoC: qdsp6: fix a use after free bug in open() 2021-12-21 18:05:40 +00:00
apq8016_sbc.c ASoC: qcom: apq8016_sbc: Allow routing audio through QDSP6 2021-12-13 22:44:02 +00:00
apq8096.c ASoC: qcom: apq8096: Constify static snd_soc_ops 2021-10-01 19:35:05 +01:00
common.c ASoC: qcom: common: Parse "pin-switches" and "widgets" from DT 2021-12-23 18:34:26 +00:00
common.h ASoC: qcom: remove unused header files from common.h 2018-08-06 12:50:07 +01:00
Kconfig ASoC: qcom: Add support for ALC5682I-VS codec 2021-11-29 12:19:48 +00:00
lpass-apq8016.c ASoC: qcom: lpass: Fix i2s ctl register bit map 2021-02-05 17:16:40 +00:00
lpass-cpu.c ASoC: qcom: lpass-cpu: mark IRQ_CLEAR register as volatile and readable 2021-06-24 19:29:53 +01:00
lpass-hdmi.c ASoC: qcom: lpass-hdmi: remove useless return 2021-03-10 13:01:49 +00:00
lpass-hdmi.h ASoC: qcom: Add support for lpass hdmi driver 2020-10-08 20:27:34 +01:00
lpass-ipq806x.c ASoC: qcom: lpass-ipq806x: fix bitwidth regmap field 2021-01-20 16:46:47 +00:00
lpass-lpaif-reg.h ASoC: qcom: lpass-cpu: Remove bit clock state check 2021-01-28 17:11:30 +00:00
lpass-platform.c ASoC: qcom: lpass: Use managed buffer allocation 2021-08-04 08:09:23 +02:00
lpass-sc7180.c ASoC: qcom: Add four speaker support on MI2S secondary 2021-06-14 15:01:05 +01:00
lpass.h Merge series "ASoC: tlv320aic32x4: Add support for TAS2505" from Claudius Heine <ch@denx.de>: 2021-06-23 16:31:14 +01:00
Makefile ASoC: qcom: sc7180: Add machine driver for sound card registration 2020-10-27 14:05:46 +00:00
sc7180.c ASoC: qcom: Distinguish headset codec by codec_dai->name 2021-12-14 17:15:51 +00:00
sdm845.c ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire 2021-12-24 14:06:47 +00:00
sm8250.c ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire 2021-12-24 14:06:47 +00:00
storm.c ASoC: qcom: Set card->owner to avoid warnings 2020-08-21 16:12:10 +01:00