ASoC: qcom: common: Use snd_soc_dai_link_set_capabilities()
authorStephan Gerhold <stephan@gerhold.net>
Thu, 23 Jul 2020 18:38:59 +0000 (20:38 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 24 Jul 2020 14:01:16 +0000 (15:01 +0100)
commit627ab55d745b2a413e0a2856f2ad2e422a697971
tree40ee4d57916ff03c300bdd0ed31187b7b94a990a
parented3b53e7ffe91c32a1277de435e3fcb3ad5e852a
ASoC: qcom: common: Use snd_soc_dai_link_set_capabilities()

Commit a2120089251f ("ASoC: qcom: common: set correct directions for dailinks")
introduced a call to q6afe_is_rx_port() to set the dpcm_playback/capture
parameters correctly. This is necessary because those parameters are now
validated to match the capabilities of the DAIs. [1]

The disadvantage of introducing the call to q6afe_is_rx_port() is that
it makes the qcom_snd_parse_of() helper dependent on the QDSP6 driver.
When the ADSP is bypassed (e.g. in apq8016-sbc) QDSP6 is not used.

There is a generic solution for this now: The correct direction for the links
is already defined by the DAI capabilities (e.g. rx ports only support playback).

Commit 25612477d20b ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper")
introduced the snd_soc_dai_link_set_capabilities() function that we can use
to set dpcm_playback/dpcm_capture according to the capabilities of the DAIs.

Use that for both FE/BE DAI links to avoid the dependency on the QDSP6 driver.

[1]: https://lore.kernel.org/alsa-devel/20200616085409.GA110999@gerhold.net/

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200723183904.321040-3-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/common.c