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
5 changes: 4 additions & 1 deletion include/sound/soc-acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ struct snd_soc_acpi_link_adr {
* @mach: the pointer of the machine driver
* @prefix: the prefix of the topology file name. Typically, it is the path.
* @tplg_files: the pointer of the array of the topology file names.
* @best_effort: ignore non supported links and try to build the card in best effort
* with supported links
*/
/* Descriptor for SST ASoC machine driver */
struct snd_soc_acpi_mach {
Expand All @@ -224,7 +226,8 @@ struct snd_soc_acpi_mach {
const u32 tplg_quirk_mask;
int (*get_function_tplg_files)(struct snd_soc_card *card,
const struct snd_soc_acpi_mach *mach,
const char *prefix, const char ***tplg_files);
const char *prefix, const char ***tplg_files,
bool best_effort);
};

#define SND_SOC_ACPI_MAX_CODECS 3
Expand Down
49 changes: 0 additions & 49 deletions sound/soc/intel/common/soc-acpi-intel-nvl-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_nvl_machines[] = {
};
EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_nvl_machines);

/*
* Multi-function codecs with three endpoints created for
* headset, amp and dmic functions.
*/
static const struct snd_soc_acpi_endpoint rt_mf_endpoints[] = {
{
.num = 0,
.aggregated = 0,
.group_position = 0,
.group_id = 0,
},
{
.num = 1,
.aggregated = 0,
.group_position = 0,
.group_id = 0,
},
{
.num = 2,
.aggregated = 0,
.group_position = 0,
.group_id = 0,
},
};

static const struct snd_soc_acpi_adr_device rt722_3_single_adr[] = {
{
.adr = 0x000330025d072201ull,
.num_endpoints = ARRAY_SIZE(rt_mf_endpoints),
.endpoints = rt_mf_endpoints,
.name_prefix = "rt722"
}
};

static const struct snd_soc_acpi_link_adr nvl_rt722_l3[] = {
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt722_3_single_adr),
.adr_d = rt722_3_single_adr,
},
{}
};

/* this table is used when there is no I2S codec present */
struct snd_soc_acpi_mach snd_soc_acpi_intel_nvl_sdw_machines[] = {
/* mockup tests need to be first */
Expand All @@ -79,12 +36,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_nvl_sdw_machines[] = {
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-nvl-rt715-rt711-rt1308-mono.tplg",
},
{
.link_mask = BIT(3),
.links = nvl_rt722_l3,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-nvl-rt722.tplg",
},
{},
};
EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_nvl_sdw_machines);
5 changes: 4 additions & 1 deletion sound/soc/intel/common/sof-function-topology-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum tplg_device_id {
#define SOF_INTEL_PLATFORM_NAME_MAX 4

int sof_sdw_get_tplg_files(struct snd_soc_card *card, const struct snd_soc_acpi_mach *mach,
const char *prefix, const char ***tplg_files)
const char *prefix, const char ***tplg_files, bool best_effort)
{
struct snd_soc_acpi_mach_params mach_params = mach->mach_params;
struct snd_soc_dai_link *dai_link;
Expand Down Expand Up @@ -87,6 +87,9 @@ int sof_sdw_get_tplg_files(struct snd_soc_card *card, const struct snd_soc_acpi_
dev_dbg(card->dev,
"dai_link %s is not supported by separated tplg yet\n",
dai_link->name);
if (best_effort)
continue;

return 0;
}
if (tplg_mask & BIT(tplg_dev))
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/common/sof-function-topology-lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
#define _SND_SOC_ACPI_INTEL_GET_TPLG_H

int sof_sdw_get_tplg_files(struct snd_soc_card *card, const struct snd_soc_acpi_mach *mach,
const char *prefix, const char ***tplg_files);
const char *prefix, const char ***tplg_files, bool best_effort);

#endif
18 changes: 17 additions & 1 deletion sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -2506,12 +2506,28 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
if (!tplg_files)
return -ENOMEM;

/* Try to use function topologies if possible */
if (!sof_pdata->disable_function_topology && !disable_function_topology &&
sof_pdata->machine && sof_pdata->machine->get_function_tplg_files) {
/*
* When the topology name contains 'dummy' word, it means that
* there is no fallback option to monolithic topology in case
* any of the function topologies might be missing.
* In this case we should use best effort to form the card,
* ignoring functionalities that we are missing a fragment for.
*
* Note: monolithic topologies also ignore these possibly
* missing functions, so the functionality of the card would be
* identical to the case if there would be a fallback monolithic
* topology created for the configuration.
*/
bool no_fallback = strstr(file, "dummy");
Copy link
Collaborator

Choose a reason for hiding this comment

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

This bit would benefit from some hint (in code comment?) why "dummy" should change the behaviour. I think it's ok to have the longer story in commit message, but something in code would be helpful why this check is done.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I'll cook up something


tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,
sof_pdata->machine,
tplg_filename_prefix,
&tplg_files);
&tplg_files,
no_fallback);
if (tplg_cnt < 0) {
kfree(tplg_files);
return tplg_cnt;
Expand Down
Loading