return tplg_build_base_object(tplg_pp, obj_cfg, parent, false);
}
+int tplg_build_text_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+ snd_config_t *parent)
+{
+ snd_config_t *cfg;
+ const char *name;
+ int ret;
+
+ cfg = tplg_object_get_instance_config(tplg_pp, obj_cfg);
+
+ name = tplg_object_get_name(tplg_pp, cfg);
+ if (!name)
+ return -EINVAL;
+
+ ret = tplg_build_object_from_template(tplg_pp, obj_cfg, &cfg, NULL, false);
+ if (ret < 0)
+ return ret;
+
+ return tplg_parent_update(tplg_pp, parent, "texts", name);
+}
+
int tplg_build_tlv_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
snd_config_t *parent)
{
return tplg_build_control(tplg_pp, obj_cfg, parent, "bytes");
}
+int tplg_build_enum_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+ snd_config_t *parent)
+{
+ return tplg_build_control(tplg_pp, obj_cfg, parent, "enum");
+}
+
/*
* Widget names for pipeline endpoints can be of the following type:
* "class.<constructor args separated by .> ex: pga.0.1, buffer.1.1 etc
return ret;
/* get section config */
- if (!strcmp(section_name, "tlv")) {
+ if (!strcmp(section_name, "tlv") || !strcmp(section_name, "texts")) {
/* set tlv name if config exists already */
ret = snd_config_search(cfg, section_name, &item_config);
if (ret < 0) {
.compound_config_ids = {"access"}
};
+const struct config_template_items enum_control_config = {
+ .int_config_ids = {"index"},
+ .compound_config_ids = {"access"}
+};
+
+const struct config_template_items text_config = {
+ .compound_config_ids = {"values"}
+};
+
const struct config_template_items scale_config = {
.int_config_ids = {"min", "step", "mute"},
};
{"Base", "ops", "ops" ,&tplg_build_ops_object, NULL, &ops_config},
{"Base", "extops", "extops" ,&tplg_build_ops_object, NULL, &ops_config},
{"Base", "channel", "channel", &tplg_build_channel_object, NULL, &channel_config},
+ {"Base", "text", "SectionText", &tplg_build_text_object, NULL, &text_config},
{"Base", "VendorToken", "SectionVendorTokens", &tplg_build_vendor_token_object,
NULL, NULL},
{"Base", "hw_config", "SectionHWConfig", &tplg_build_hw_cfg_object, NULL,
&mixer_control_config},
{"Control", "bytes", "SectionControlBytes", &tplg_build_bytes_control, NULL,
&bytes_control_config},
+ {"Control", "enum", "SectionControlEnum", &tplg_build_enum_control, NULL,
+ &enum_control_config},
{"Dai", "", "SectionBE", &tplg_build_generic_object, NULL, &be_dai_config},
{"PCM", "pcm", "SectionPCM", &tplg_build_generic_object, NULL, &pcm_config},
{"PCM", "pcm_caps", "SectionPCMCapabilities", &tplg_build_pcm_caps_object,
snd_config_t *parent);
int tplg_build_bytes_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
snd_config_t *parent);
+int tplg_build_enum_control(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+ snd_config_t *parent);
+int tplg_build_text_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
+ snd_config_t *parent);
int tplg_build_dapm_route_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
snd_config_t *parent);
int tplg_build_hw_cfg_object(struct tplg_pre_processor *tplg_pp,