]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ASoC: SOF: topology: Get HDA rate and channels from topology
authorBard Liao <yung-chuan.liao@linux.intel.com>
Wed, 15 Apr 2020 20:28:14 +0000 (15:28 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 15 Apr 2020 23:23:17 +0000 (00:23 +0100)
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>
include/sound/sof/dai-intel.h
include/uapi/sound/sof/abi.h
include/uapi/sound/sof/tokens.h
sound/soc/sof/topology.c

index 4db906c4a534ab54f8e23da4972fbc8dd589d41e..896db2243d876ba61302b9aa7ef40334f26e6958 100644 (file)
@@ -88,6 +88,8 @@ struct sof_ipc_dai_ssp_params {
 struct sof_ipc_dai_hda_params {
        struct sof_ipc_hdr hdr;
        uint32_t link_dma_ch;
+       uint32_t rate;
+       uint32_t channels;
 } __packed;
 
 /* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */
index 6c802a2386efc2ebf168ed09d178a241cd1512b5..d54be303090fc3885ddbe66f422c560dbd705f8a 100644 (file)
@@ -26,7 +26,7 @@
 
 /* SOF ABI version major, minor and patch numbers */
 #define SOF_ABI_MAJOR 3
-#define SOF_ABI_MINOR 15
+#define SOF_ABI_MINOR 16
 #define SOF_ABI_PATCH 0
 
 /* SOF ABI version number. Format within 32bit word is MMmmmppp */
index b7ad1cd4526a346b61d430a38c4b79ec3e8cec30..5941e2eb1588a9d511051b1542617f69c7aa808c 100644 (file)
 #define SOF_TKN_INTEL_ALH_RATE                 1400
 #define SOF_TKN_INTEL_ALH_CH                   1401
 
+/* HDA */
+#define SOF_TKN_INTEL_HDA_RATE                 1500
+#define SOF_TKN_INTEL_HDA_CH                   1501
+
 #endif
index 51d19ffe35b3fa86116505e574fcdd35ee634f17..a1287924a12daaf2ff811e7e77ba61f8e49fb85b 100644 (file)
@@ -753,6 +753,12 @@ static const struct sof_topology_token dmic_pdm_tokens[] = {
 
 /* HDA */
 static const struct sof_topology_token hda_tokens[] = {
+       {SOF_TKN_INTEL_HDA_RATE,
+               SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+               offsetof(struct sof_ipc_dai_hda_params, rate), 0},
+       {SOF_TKN_INTEL_HDA_CH,
+               SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+               offsetof(struct sof_ipc_dai_hda_params, channels), 0},
 };
 
 /* Leds */
@@ -3083,6 +3089,9 @@ static int sof_link_hda_load(struct snd_soc_component *scomp, int index,
                return ret;
        }
 
+       dev_dbg(scomp->dev, "HDA config rate %d channels %d\n",
+               config->hda.rate, config->hda.channels);
+
        dai = snd_soc_find_dai(link->cpus);
        if (!dai) {
                dev_err(scomp->dev, "error: failed to find dai %s in %s",