OSDN Git Service

ASoC: SOF: token: add tokens for PCM compatible with D0i3 substate
authorKeyon Jie <yang.jie@linux.intel.com>
Fri, 25 Oct 2019 22:41:04 +0000 (17:41 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 28 Oct 2019 14:42:07 +0000 (14:42 +0000)
Add stream token SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3 and
SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 to denote if the stream can be
opened at low power d0i3 status or not.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191025224122.7718-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/uapi/sound/sof/tokens.h
sound/soc/sof/topology.c

index d65406f..76883e6 100644 (file)
 /* ESAI */
 #define SOF_TKN_IMX_ESAI_MCLK_ID               1100
 
+/* Stream */
+#define SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3        1200
+#define SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 1201
+
 /* Led control for mute switches */
 #define SOF_TKN_MUTE_LED_USE                   1300
 #define SOF_TKN_MUTE_LED_DIRECTION             1301
index b3ab6f2..121e5d6 100644 (file)
@@ -567,6 +567,16 @@ static const struct sof_topology_token pcm_tokens[] = {
                offsetof(struct sof_ipc_comp_host, dmac_config), 0},
 };
 
+/* PCM */
+static const struct sof_topology_token stream_tokens[] = {
+       {SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3,
+               SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
+               offsetof(struct snd_sof_pcm, stream[0].d0i3_compatible), 0},
+       {SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3,
+               SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
+               offsetof(struct snd_sof_pcm, stream[1].d0i3_compatible), 0},
+};
+
 /* Generic components */
 static const struct sof_topology_token comp_tokens[] = {
        {SOF_TKN_COMP_PERIOD_SINK_COUNT,