/** Fit for all user cases */
#define SND_TPLG_INDEX_ALL 0
+/** Flags for the snd_tplg_create */
+#define SND_TPLG_CREATE_VERBOSE (1<<0) /*!< Verbose output */
+#define SND_TPLG_CREATE_DAPM_NOSORT (1<<1) /*!< Do not sort DAPM objects by index */
+
/**
* \brief Create a new topology parser instance.
* \return New topology parser instance
*/
snd_tplg_t *snd_tplg_new(void);
+/**
+ * \brief Create a new topology parser instance.
+ * \return New topology parser instance
+ */
+snd_tplg_t *snd_tplg_create(int flags);
+
/**
* \brief Free a topology parser instance.
* \param tplg Topology parser instance
return NULL;
elem->index = index;
- tplg_elem_insert(elem, &tplg->route_list);
+ if (tplg->dapm_sort)
+ tplg_elem_insert(elem, &tplg->route_list);
+ else
+ list_add_tail(&elem->list, &tplg->route_list);
strcpy(elem->id, "line");
elem->type = SND_TPLG_TYPE_DAPM_GRAPH;
elem->size = sizeof(*line);
return false;
}
-snd_tplg_t *snd_tplg_new(void)
+snd_tplg_t *snd_tplg_create(int flags)
{
snd_tplg_t *tplg;
if (!tplg)
return NULL;
+ tplg->verbose = !!(flags & SND_TPLG_CREATE_VERBOSE);
+ tplg->dapm_sort = (flags & SND_TPLG_CREATE_DAPM_NOSORT) == 0;
+
tplg->manifest.size = sizeof(struct snd_soc_tplg_manifest);
INIT_LIST_HEAD(&tplg->tlv_list);
return tplg;
}
+snd_tplg_t *snd_tplg_new(void)
+{
+ return snd_tplg_create(0);
+}
+
void snd_tplg_free(snd_tplg_t *tplg)
{
free(tplg->bin);
size_t bin_size;
int verbose;
+ unsigned int dapm_sort: 1;
unsigned int version;
/* runtime state */