]> asedeno.scripts.mit.edu Git - linux.git/commit
ASoC: soc-core: allow no Platform on dai_link
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 19 Jun 2019 01:14:07 +0000 (10:14 +0900)
committerMark Brown <broonie@kernel.org>
Wed, 19 Jun 2019 11:47:03 +0000 (12:47 +0100)
commit1d76898928783d79bfd7c465e891b6cf957c839a
treeca72244bffafc8070454835be9804acfc8033dfa
parentdf9091e9d3f4500bc6fb15f5d2a1c2614f67004c
ASoC: soc-core: allow no Platform on dai_link

dai_link is used to selecting Component (= CPU/Codec/Platform) and
DAI (= CPU/Codec). And selected CPU/Codec/Platform components are
*listed* on Card.

Many drivers don't need special Platform component, but was
mandatory at legacy style ALSA SoC.
Thus, there is this kind of settings on many drivers.

dai_link->platform_of_node = dai_link->cpu_of_node;

In this case, soc_bind_dai_link() will pick-up "CPU component" as
"Platform component", and try to add it to snd_soc_pcm_runtime.
But it will be ignored, because it is already added when CPU bindings.

Historically, this kind of "CPU component" is used/selected as
"Platform" on many ALSA SoC drivers.
OTOH, Dummy Platform will be selected automatically by ALSA SoC if
driver doesn't have Platform settings.

These indicates that there are 2 type of Platforms exist at current
ALSA SoC if driver doesn't need special Platform.

1) use Dummy Platform as Platform component
2) use CPU component  as Platform component

ALSA SoC will call Dummy Platform callback function if it is using
Dummy Platform, but it is completely pointless. Because it is the
sound card which doesn't need special Platform.

Thus, the behavior we request to ALSA SoC is selecting 2) automatically
instead of 1) if sound card doesn't need special Platform.
And, 2) means "do nothing" as above explain.

These were needed at legacy style dai_link, but is no longer needed
at modern style dai_link anymore.

This patch allows "no Platform" settings on dai_link, and will do
nothing for it if there was no platform settings. This is same as 2).

By this patch, all drivers which is selecting "CPU component" as
"Platform" can remove such settings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h
sound/soc/soc-core.c