Skip to content

Commit 18aaab6

Browse files
bardliaobroonie
authored andcommitted
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>
1 parent 15bf183 commit 18aaab6

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎include/sound/sof/dai-intel.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ struct sof_ipc_dai_ssp_params {
8888
struct sof_ipc_dai_hda_params {
8989
struct sof_ipc_hdr hdr;
9090
uint32_t link_dma_ch;
91+
uint32_t rate;
92+
uint32_t channels;
9193
} __packed;
9294

9395
/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */

‎include/uapi/sound/sof/abi.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/* SOF ABI version major, minor and patch numbers */
2828
#define SOF_ABI_MAJOR 3
29-
#define SOF_ABI_MINOR 15
29+
#define SOF_ABI_MINOR 16
3030
#define SOF_ABI_PATCH 0
3131

3232
/* SOF ABI version number. Format within 32bit word is MMmmmppp */

‎include/uapi/sound/sof/tokens.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,8 @@
130130
#define SOF_TKN_INTEL_ALH_RATE 1400
131131
#define SOF_TKN_INTEL_ALH_CH 1401
132132

133+
/* HDA */
134+
#define SOF_TKN_INTEL_HDA_RATE 1500
135+
#define SOF_TKN_INTEL_HDA_CH 1501
136+
133137
#endif

‎sound/soc/sof/topology.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,12 @@ static const struct sof_topology_token dmic_pdm_tokens[] = {
753753

754754
/* HDA */
755755
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},
756762
};
757763

758764
/* Leds */
@@ -3083,6 +3089,9 @@ static int sof_link_hda_load(struct snd_soc_component *scomp, int index,
30833089
return ret;
30843090
}
30853091

3092+
dev_dbg(scomp->dev, "HDA config rate %d channels %d\n",
3093+
config->hda.rate, config->hda.channels);
3094+
30863095
dai = snd_soc_find_dai(link->cpus);
30873096
if (!dai) {
30883097
dev_err(scomp->dev, "error: failed to find dai %s in %s",

0 commit comments

Comments
 (0)