Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: topology: Get ALH rate amd channels from topology

FW will need these params for synchronized playback over multiple
DAIs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Sławomir Błauciak <slawomir.blauciak@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Bard Liao and committed by
Mark Brown
c7fc96df 1f846505

+27
+4
include/uapi/sound/sof/tokens.h
··· 126 126 #define SOF_TKN_MUTE_LED_USE 1300 127 127 #define SOF_TKN_MUTE_LED_DIRECTION 1301 128 128 129 + /* ALH */ 130 + #define SOF_TKN_INTEL_ALH_RATE 1400 131 + #define SOF_TKN_INTEL_ALH_CH 1401 132 + 129 133 #endif
+23
sound/soc/sof/topology.c
··· 656 656 657 657 }; 658 658 659 + /* ALH */ 660 + static const struct sof_topology_token alh_tokens[] = { 661 + {SOF_TKN_INTEL_ALH_RATE, 662 + SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, 663 + offsetof(struct sof_ipc_dai_alh_params, rate), 0}, 664 + {SOF_TKN_INTEL_ALH_CH, 665 + SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, 666 + offsetof(struct sof_ipc_dai_alh_params, channels), 0}, 667 + }; 668 + 659 669 /* DMIC */ 660 670 static const struct sof_topology_token dmic_tokens[] = { 661 671 {SOF_TKN_INTEL_DMIC_DRIVER_VERSION, ··· 3105 3095 struct sof_ipc_dai_config *config) 3106 3096 { 3107 3097 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); 3098 + struct snd_soc_tplg_private *private = &cfg->priv; 3108 3099 struct sof_ipc_reply reply; 3109 3100 u32 size = sizeof(*config); 3110 3101 int ret; 3111 3102 3103 + ret = sof_parse_tokens(scomp, &config->alh, alh_tokens, 3104 + ARRAY_SIZE(alh_tokens), private->array, 3105 + le32_to_cpu(private->size)); 3106 + if (ret != 0) { 3107 + dev_err(scomp->dev, "error: parse alh tokens failed %d\n", 3108 + le32_to_cpu(private->size)); 3109 + return ret; 3110 + } 3111 + 3112 3112 /* init IPC */ 3113 3113 config->hdr.size = size; 3114 + 3115 + dev_dbg(scomp->dev, "ALH config rate %d channels %d\n", 3116 + config->alh.rate, config->alh.channels); 3114 3117 3115 3118 /* send message to DSP */ 3116 3119 ret = sof_ipc_tx_message(sdev->ipc,