linux/sound/soc
Kuninori Morimoto fd69dfe678
ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition
I have been wondering why DPCM needs special flag (= dpcm_playback/capture)
to use it. Below is the history why it was added to ASoC.

(A) In beginning, there was no dpcm_xxx flag on ASoC.
    It checks channels_min for DPCM, same as current non-DPCM.
    Let's name it as "validation check" here.

	if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
		if (cpu_dai->driver->playback.channels_min)
			playback = 1;
		if (cpu_dai->driver->capture.channels_min)
			capture = 1;

(B) commit 1e9de42f43 ("ASoC: dpcm: Explicitly set BE DAI link supported
    stream directions") force to use dpcm_xxx flag on DPCM. According to
    this commit log, this is because "Some BE dummy DAI doesn't set
    channels_min for playback/capture". But we don't know which DAI is it,
    and not know why it can't/don't have channels_min. Let's name it as
    "no_chan_DAI" here. According to the code and git-log, it is used as
    DCPM-BE and is CPU DAI. I think the correct solution was set
    channels_min on "no_chan_DAI" side, not update ASoC framework side. But
    everything is under smoke today.

	if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
		playback = rtd->dai_link->dpcm_playback;
		capture  = rtd->dai_link->dpcm_capture;

(C) commit 9b5db05936 ("ASoC: soc-pcm: dpcm: Only allow playback/capture
    if supported") checks channels_min (= validation check) again. Because
    DPCM availability was handled by dpcm_xxx flag at that time, but some
    Sound Card set it even though it wasn't available. Clearly there's
    a contradiction here. I think correct solution was update Sound Card
    side instead of ASoC framework. Sound Card side will be updated to
    handle this issue later (commit 25612477d2 ("ASoC: soc-dai: set
    dai_link dpcm_ flags with a helper"))

	if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
		...
		playback = rtd->dai_link->dpcm_playback &&
			   snd_soc_dai_stream_valid(cpu_dai, ...);
		capture = rtd->dai_link->dpcm_capture &&
			   snd_soc_dai_stream_valid(cpu_dai, ...);

This (C) patch should have broken "no_chan_DAI" which doesn't have
channels_min, but there was no such report during this 4 years.
Possibilities case are as follows
	- No one is using "no_chan_DAI"
	- "no_chan_DAI" is no longer exist : was removed ?
	- "no_chan_DAI" is no longer exist : has channels_min ?

Because of these history, this dpcm_xxx is unneeded flag today. But because
we have been used it for 10 years since (B), it may have been used
differently. For example some DAI available both playback/capture, but it
set dpcm_playback flag only, in this case dpcm_xxx flag is used as
availability limitation. We can use playback_only flag instead in this
case, but it is very difficult to find such DAI today.

Let's add grace time to remove dpcm_playback/capture flag.

This patch don't use dpcm_xxx flag anymore, and indicates warning to use
xxx_only flag if both playback/capture were available but using only
one of dpcm_xxx flag, and not using xxx_only flag.

Link: https://lore.kernel.org/r/87edaym2cg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/87seuyaahn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-22 13:36:45 +01:00
..
adi ASoC: adi: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:12 +09:00
amd ASoC: Merge up fixes 2024-08-20 15:23:08 +01:00
apple ASoC: apple: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:14 +09:00
atmel ASoC: atmel: atmel-classd: Re-add dai_link->platform to fix card init 2024-06-06 14:04:00 +01:00
au1x ASoC: au1x: Use *-y instead of *-objs Makefile 2024-05-08 11:39:16 +09:00
bcm ASoC: bcm: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:16 +09:00
cirrus ASoC: cirrus: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:17 +09:00
codecs ASoC: tas2781: Remove unnecessary line feed for tasdevice_codec_remove 2024-08-21 14:38:02 +01:00
dwc
fsl ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() 2024-08-14 18:21:18 +01:00
generic ASoC: remove bespoke trigger support 2024-08-06 13:56:21 +01:00
google
hisilicon
img ASoC: img: Use snd_soc_substream_to_rtd() for accessing private_data 2024-05-06 23:59:52 +09:00
intel ALSA/ASoC/SoundWire: Intel: update maximum number 2024-08-19 19:58:04 +01:00
jz4740 ASoC: jz4740: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:21 +09:00
kirkwood ASoC: kirkwood: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:21 +09:00
loongson ASoC: loongson: Remove useless variable definitions 2024-08-14 22:19:19 +01:00
mediatek ASoC: Merge up fixes 2024-08-20 15:23:08 +01:00
meson ASoC: meson: axg-fifo: fix irq scheduling issue with PREEMPT_RT 2024-08-08 20:34:55 +01:00
mxs ASoC: mxs: add missing MODULE_DESCRIPTION() macro 2024-06-03 15:59:19 +01:00
pxa ASoC: pxa: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:26 +09:00
qcom ASoC: qcom: topology: Simplify with cleanup.h 2024-07-09 22:50:48 +01:00
rockchip ASoC: Merge up fixes 2024-06-21 13:17:21 +01:00
samsung ASoC: samsung: midas_wm1811: Fix error code in probe() 2024-06-11 17:14:00 +01:00
sdw_utils ASoC: intel/sdw_utils: refactor init_dai_link() and init_simple_dai_link() 2024-08-01 12:44:15 +01:00
sh ASoC: rsnd: use pcm_dmaengine code 2024-07-30 13:29:52 +01:00
sof ASoC: SOF: amd: remove unused variable from sof_amd_acp_desc structure 2024-08-21 14:38:03 +01:00
spear ASoC: spear: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:31 +09:00
sprd ASoC: sprd: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:32 +09:00
starfive
sti ASoC: sti: add missing probe entry for player and reader 2024-07-29 13:36:56 +01:00
stm ASoC: stm: use snd_pcm_direction_name() 2024-08-01 14:54:48 +01:00
sunxi ASoC: sunxi: Use snd_soc_substream_to_rtd() for accessing private_data 2024-05-06 23:59:56 +09:00
tegra ALSA/ASoC: use snd_pcm_direction_name() 2024-08-01 20:15:22 +01:00
ti Fixes for McASP and dmaengine_pcm 2024-06-12 18:26:15 +01:00
uniphier ASoC: uniphier: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:36 +09:00
ux500 ASoC: Add missing module descriptions 2024-05-09 08:37:35 +02:00
xilinx ASoC: Add missing module descriptions 2024-05-09 08:37:35 +02:00
xtensa ASoC: xtensa: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:39 +09:00
Kconfig ASoC: intel/sdw-utils: move soundwire machine driver soc ops 2024-08-01 12:43:57 +01:00
Makefile ASoC: intel/sdw-utils: move soundwire machine driver soc ops 2024-08-01 12:43:57 +01:00
soc-ac97.c
soc-acpi.c
soc-card-test.c ASoC: soc-card: soc-card-test: Fix some error handling in init() 2024-04-14 16:54:39 +09:00
soc-card.c ASoC: soc-card: Use snd_ctl_find_id_mixer() instead of open-coding 2024-04-02 15:54:48 +01:00
soc-component.c ASoC: soc-component: Add new snd_soc_component_get_kcontrol() helpers 2024-08-02 14:04:39 +01:00
soc-compress.c
soc-core.c ASoC: Use of_property_read_bool() 2024-08-01 12:51:45 +01:00
soc-dai.c ASoC: remove bespoke trigger support 2024-08-06 13:56:21 +01:00
soc-dapm.c ASoC: soc-dapm: use snd_pcm_direction_name() 2024-08-01 14:54:54 +01:00
soc-devres.c
soc-generic-dmaengine-pcm.c ALSA: dmaengine: Synchronize dma channel after drop() 2024-06-11 17:13:31 +01:00
soc-jack.c
soc-link.c
soc-ops.c ASoC: ops: Simplify with cleanup.h 2024-07-08 12:50:02 +01:00
soc-pcm.c ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition 2024-08-22 13:36:45 +01:00
soc-topology-test.c ASoC: topology-test: Add missing module description 2024-05-08 20:51:10 +09:00
soc-topology.c ASoC: topology: Unify code for creating standalone and widget enum control 2024-07-02 14:27:08 +01:00
soc-utils-test.c
soc-utils.c ASoC: soc-utils: allow sample rate up to 768kHz for the dummy dai 2024-06-28 13:39:29 +01:00