Commit 18aaab64 authored by Bard Liao's avatar Bard Liao Committed by Mark Brown

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: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-23-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 15bf1831
...@@ -88,6 +88,8 @@ struct sof_ipc_dai_ssp_params { ...@@ -88,6 +88,8 @@ struct sof_ipc_dai_ssp_params {
struct sof_ipc_dai_hda_params { struct sof_ipc_dai_hda_params {
struct sof_ipc_hdr hdr; struct sof_ipc_hdr hdr;
uint32_t link_dma_ch; uint32_t link_dma_ch;
uint32_t rate;
uint32_t channels;
} __packed; } __packed;
/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */ /* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* SOF ABI version major, minor and patch numbers */ /* SOF ABI version major, minor and patch numbers */
#define SOF_ABI_MAJOR 3 #define SOF_ABI_MAJOR 3
#define SOF_ABI_MINOR 15 #define SOF_ABI_MINOR 16
#define SOF_ABI_PATCH 0 #define SOF_ABI_PATCH 0
/* SOF ABI version number. Format within 32bit word is MMmmmppp */ /* SOF ABI version number. Format within 32bit word is MMmmmppp */
......
...@@ -130,4 +130,8 @@ ...@@ -130,4 +130,8 @@
#define SOF_TKN_INTEL_ALH_RATE 1400 #define SOF_TKN_INTEL_ALH_RATE 1400
#define SOF_TKN_INTEL_ALH_CH 1401 #define SOF_TKN_INTEL_ALH_CH 1401
/* HDA */
#define SOF_TKN_INTEL_HDA_RATE 1500
#define SOF_TKN_INTEL_HDA_CH 1501
#endif #endif
...@@ -753,6 +753,12 @@ static const struct sof_topology_token dmic_pdm_tokens[] = { ...@@ -753,6 +753,12 @@ static const struct sof_topology_token dmic_pdm_tokens[] = {
/* HDA */ /* HDA */
static const struct sof_topology_token hda_tokens[] = { 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 */ /* Leds */
...@@ -3083,6 +3089,9 @@ static int sof_link_hda_load(struct snd_soc_component *scomp, int index, ...@@ -3083,6 +3089,9 @@ static int sof_link_hda_load(struct snd_soc_component *scomp, int index,
return ret; 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); dai = snd_soc_find_dai(link->cpus);
if (!dai) { if (!dai) {
dev_err(scomp->dev, "error: failed to find dai %s in %s", dev_err(scomp->dev, "error: failed to find dai %s in %s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment