ASoC: cpcap: Implement set_tdm_slot for voice call support
authorTony Lindgren <tony@atomide.com>
Tue, 12 Jan 2021 17:47:04 +0000 (18:47 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 19 Jan 2021 14:09:24 +0000 (14:09 +0000)
commit0dedbde5062dbc3cf71ab1ba40792c04a68008e9
tree222ab9e7d63738265dc35b81d1174030c1b921a7
parent7f1f7ae102ea082745e320b3c8c003f43c063edf
ASoC: cpcap: Implement set_tdm_slot for voice call support

ASoC: cpcap: Implement set_tdm_slot for voice call support

For using cpcap for voice calls, we need to route audio directly from
the modem to cpcap for TDM (Time Division Multiplexing). The voice call
is direct data between the modem and cpcap with no CPU involvment. In
this mode, the cpcap related audio mixer controls work for the speaker
selection and volume though.

To do this, we need to implement standard snd_soc_dai_set_tdm_slot()
for cpcap. Then the modem codec driver can use snd_soc_dai_set_sysclk(),
snd_soc_dai_set_fmt(), and snd_soc_dai_set_tdm_slot() to configure a
voice call.

Let's add cpcap_voice_set_tdm_slot() for this, and cpcap_voice_call()
helper to configure the additional registers needed for voice call.

Let's also clear CPCAP_REG_VAUDIOC on init in case we have the bit for
CPCAP_BIT_VAUDIO_MODE0 set on init.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Link: https://lore.kernel.org/r/20210112174704.GA13496@duo.ucw.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cpcap.c