Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/sound/sof/dai-intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/sound/sof/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 4 additions & 0 deletions include/uapi/sound/sof/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,8 @@
#define SOF_TKN_INTEL_ALH_RATE 1400
#define SOF_TKN_INTEL_ALH_CH 1401

/* HDA */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in summary line: rate amd channels -> rate and channels

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether it makes sense to keep 2nd and 3rd patches separate. The first one doesn't really make much sense on its own. And I don't think it's worth having the same explanation again in this commit, on why this is done.

If you keep these separate, maybe something more useful to commit description than
"FW needs to know rate and channels."
Maybe just add "Added support for rate and channel tokens for HDA DAI. Added in topology interface 3.16."

#define SOF_TKN_INTEL_HDA_RATE 1500
#define SOF_TKN_INTEL_HDA_CH 1501

#endif
11 changes: 10 additions & 1 deletion sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -3101,7 +3107,7 @@ static int sof_link_hda_load(struct snd_soc_component *scomp, int index,
config->hdr.size = size;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao Can you add a mention in commit message that as "hda_tokens" array was empty, this error has been harmless.


/* get any bespoke DAI tokens */
ret = sof_parse_tokens(scomp, config, hda_tokens,
ret = sof_parse_tokens(scomp, &config->hda, hda_tokens,
ARRAY_SIZE(hda_tokens), private->array,
le32_to_cpu(private->size));
if (ret != 0) {
Expand All @@ -3110,6 +3116,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",
Expand Down