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

ASoC: SOF: topology: Get HDA rate and channels from topology

FW interface for HDA DAI parameters was extended with information on
sampling rate and channel count in version 3.16. Align kernel header
with the FW change. This change is backwards compatible. Old firmware
will ignore the values.

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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Bard Liao and committed by
Mark Brown
18aaab64 15bf1831

+16 -1
+2
include/sound/sof/dai-intel.h
··· 88 88 struct sof_ipc_dai_hda_params { 89 89 struct sof_ipc_hdr hdr; 90 90 uint32_t link_dma_ch; 91 + uint32_t rate; 92 + uint32_t channels; 91 93 } __packed; 92 94 93 95 /* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */
+1 -1
include/uapi/sound/sof/abi.h
··· 26 26 27 27 /* SOF ABI version major, minor and patch numbers */ 28 28 #define SOF_ABI_MAJOR 3 29 - #define SOF_ABI_MINOR 15 29 + #define SOF_ABI_MINOR 16 30 30 #define SOF_ABI_PATCH 0 31 31 32 32 /* SOF ABI version number. Format within 32bit word is MMmmmppp */
+4
include/uapi/sound/sof/tokens.h
··· 130 130 #define SOF_TKN_INTEL_ALH_RATE 1400 131 131 #define SOF_TKN_INTEL_ALH_CH 1401 132 132 133 + /* HDA */ 134 + #define SOF_TKN_INTEL_HDA_RATE 1500 135 + #define SOF_TKN_INTEL_HDA_CH 1501 136 + 133 137 #endif
+9
sound/soc/sof/topology.c
··· 753 753 754 754 /* HDA */ 755 755 static const struct sof_topology_token hda_tokens[] = { 756 + {SOF_TKN_INTEL_HDA_RATE, 757 + SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, 758 + offsetof(struct sof_ipc_dai_hda_params, rate), 0}, 759 + {SOF_TKN_INTEL_HDA_CH, 760 + SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, 761 + offsetof(struct sof_ipc_dai_hda_params, channels), 0}, 756 762 }; 757 763 758 764 /* Leds */ ··· 3088 3082 le32_to_cpu(private->size)); 3089 3083 return ret; 3090 3084 } 3085 + 3086 + dev_dbg(scomp->dev, "HDA config rate %d channels %d\n", 3087 + config->hda.rate, config->hda.channels); 3091 3088 3092 3089 dai = snd_soc_find_dai(link->cpus); 3093 3090 if (!dai) {