offsetof(struct sof_ipc_dai_acpdmic_params, pdm_ch)},
};
+/* ACPI2S */
+static const struct sof_topology_token acpi2s_tokens[] = {
+ {SOF_TKN_AMD_ACPI2S_RATE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+ offsetof(struct sof_ipc_dai_acp_params, fsync_rate)},
+ {SOF_TKN_AMD_ACPI2S_CH, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+ offsetof(struct sof_ipc_dai_acp_params, tdm_slots)},
+ {SOF_TKN_AMD_ACPI2S_TDM_MODE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
+ offsetof(struct sof_ipc_dai_acp_params, tdm_mode)},
+};
+
/* Core tokens */
static const struct sof_topology_token core_tokens[] = {
{SOF_TKN_COMP_CORE_ID, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32,
[SOF_SAI_TOKENS] = {"SAI tokens", sai_tokens, ARRAY_SIZE(sai_tokens)},
[SOF_AFE_TOKENS] = {"AFE tokens", afe_tokens, ARRAY_SIZE(afe_tokens)},
[SOF_ACPDMIC_TOKENS] = {"ACPDMIC tokens", acpdmic_tokens, ARRAY_SIZE(acpdmic_tokens)},
+ [SOF_ACPI2S_TOKENS] = {"ACPI2S tokens", acpi2s_tokens, ARRAY_SIZE(acpi2s_tokens)},
};
/**
struct snd_soc_tplg_hw_config *hw_config = slink->hw_configs;
struct sof_dai_private_data *private = dai->private;
u32 size = sizeof(*config);
+ int ret;
/* handle master/slave and inverted clocks */
sof_dai_set_format(hw_config, config);
memset(&config->acpsp, 0, sizeof(config->acpsp));
config->hdr.size = size;
- config->acpsp.fsync_rate = le32_to_cpu(hw_config->fsync_rate);
- config->acpsp.tdm_slots = le32_to_cpu(hw_config->tdm_slots);
+ ret = sof_update_ipc_object(scomp, &config->acpsp, SOF_ACPI2S_TOKENS, slink->tuples,
+ slink->num_tuples, size, slink->num_hw_configs);
+ if (ret < 0)
+ return ret;
- dev_info(scomp->dev, "ACP_SP config ACP%d channel %d rate %d\n",
+
+ dev_info(scomp->dev, "ACP_SP config ACP%d channel %d rate %d tdm_mode %d\n",
config->dai_index, config->acpsp.tdm_slots,
- config->acpsp.fsync_rate);
+ config->acpsp.fsync_rate, config->acpsp.tdm_mode);
dai->number_configs = 1;
dai->current_config = 0;
struct snd_soc_tplg_hw_config *hw_config = slink->hw_configs;
struct sof_dai_private_data *private = dai->private;
u32 size = sizeof(*config);
+ int ret;
/* Configures the DAI hardware format and inverted clocks */
sof_dai_set_format(hw_config, config);
memset(&config->acphs, 0, sizeof(config->acphs));
config->hdr.size = size;
- config->acphs.fsync_rate = le32_to_cpu(hw_config->fsync_rate);
- config->acphs.tdm_slots = le32_to_cpu(hw_config->tdm_slots);
+ ret = sof_update_ipc_object(scomp, &config->acphs, SOF_ACPI2S_TOKENS, slink->tuples,
+ slink->num_tuples, size, slink->num_hw_configs);
+ if (ret < 0)
+ return ret;
- dev_info(scomp->dev, "ACP_HS config ACP%d channel %d rate %d\n",
+ dev_info(scomp->dev, "ACP_HS config ACP%d channel %d rate %d tdm_mode %d\n",
config->dai_index, config->acphs.tdm_slots,
- config->acphs.fsync_rate);
+ config->acphs.fsync_rate, config->acphs.tdm_mode);
dai->number_configs = 1;
dai->current_config = 0;
ret = sof_link_acp_bt_load(scomp, slink, config, dai);
break;
case SOF_DAI_AMD_SP:
+ case SOF_DAI_AMD_SP_VIRTUAL:
ret = sof_link_acp_sp_load(scomp, slink, config, dai);
break;
case SOF_DAI_AMD_HS:
+ case SOF_DAI_AMD_HS_VIRTUAL:
ret = sof_link_acp_hs_load(scomp, slink, config, dai);
break;
case SOF_DAI_AMD_DMIC:
{"ACPDMIC", SOF_DAI_AMD_DMIC},
{"ACPHS", SOF_DAI_AMD_HS},
{"AFE", SOF_DAI_MEDIATEK_AFE},
+ {"ACPSP_VIRTUAL", SOF_DAI_AMD_SP_VIRTUAL},
+ {"ACPHS_VIRTUAL", SOF_DAI_AMD_HS_VIRTUAL},
+
};
static enum sof_ipc_dai_type find_dai(const char *name)
token_id = SOF_ACPDMIC_TOKENS;
num_tuples += token_list[SOF_ACPDMIC_TOKENS].count;
break;
+ case SOF_DAI_AMD_SP:
+ case SOF_DAI_AMD_HS:
+ case SOF_DAI_AMD_SP_VIRTUAL:
+ case SOF_DAI_AMD_HS_VIRTUAL:
+ token_id = SOF_ACPI2S_TOKENS;
+ num_tuples += token_list[SOF_ACPI2S_TOKENS].count;
+ break;
default:
break;
}