struct snd_soc_card;
struct snd_kcontrol_new;
struct snd_soc_dai_link;
+struct snd_soc_dai_driver;
+struct snd_soc_dai;
/* object scan be loaded and unloaded in groups with identfying indexes */
#define SND_SOC_TPLG_INDEX_ALL 0 /* ID that matches all FW objects */
struct snd_soc_tplg_ops {
/* external kcontrol init - used for any driver specific init */
- int (*control_load)(struct snd_soc_component *,
+ int (*control_load)(struct snd_soc_component *, int index,
struct snd_kcontrol_new *, struct snd_soc_tplg_ctl_hdr *);
int (*control_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);
/* external widget init - used for any driver specific init */
- int (*widget_load)(struct snd_soc_component *,
+ int (*widget_load)(struct snd_soc_component *, int index,
struct snd_soc_dapm_widget *,
struct snd_soc_tplg_dapm_widget *);
- int (*widget_ready)(struct snd_soc_component *,
+ int (*widget_ready)(struct snd_soc_component *, int index,
struct snd_soc_dapm_widget *,
struct snd_soc_tplg_dapm_widget *);
int (*widget_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);
/* FE DAI - used for any driver specific init */
- int (*dai_load)(struct snd_soc_component *,
- struct snd_soc_dai_driver *dai_drv);
+ int (*dai_load)(struct snd_soc_component *, int index,
+ struct snd_soc_dai_driver *dai_drv,
+ struct snd_soc_tplg_pcm *pcm, struct snd_soc_dai *dai);
+
int (*dai_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);
/* DAI link - used for any driver specific init */
- int (*link_load)(struct snd_soc_component *,
- struct snd_soc_dai_link *link);
+ int (*link_load)(struct snd_soc_component *, int index,
+ struct snd_soc_dai_link *link,
+ struct snd_soc_tplg_link_config *cfg);
int (*link_unload)(struct snd_soc_component *,
struct snd_soc_dobj *);
/* callback to handle vendor bespoke data */
- int (*vendor_load)(struct snd_soc_component *,
+ int (*vendor_load)(struct snd_soc_component *, int index,
struct snd_soc_tplg_hdr *);
int (*vendor_unload)(struct snd_soc_component *,
struct snd_soc_tplg_hdr *);
void (*complete)(struct snd_soc_component *);
/* manifest - optional to inform component of manifest */
- int (*manifest)(struct snd_soc_component *,
+ int (*manifest)(struct snd_soc_component *, int index,
struct snd_soc_tplg_manifest *);
/* vendor specific kcontrol handlers available for binding */
},
};
-int skl_dai_load(struct snd_soc_component *cmp,
- struct snd_soc_dai_driver *pcm_dai)
+int skl_dai_load(struct snd_soc_component *cmp, int index,
+ struct snd_soc_dai_driver *dai_drv,
+ struct snd_soc_tplg_pcm *pcm, struct snd_soc_dai *dai)
{
- pcm_dai->ops = &skl_pcm_dai_ops;
+ dai_drv->ops = &skl_pcm_dai_ops;
return 0;
}
* information to the driver about module and pipeline parameters which DSP
* FW expects like ids, resource values, formats etc
*/
-static int skl_tplg_widget_load(struct snd_soc_component *cmpnt,
+static int skl_tplg_widget_load(struct snd_soc_component *cmpnt, int index,
struct snd_soc_dapm_widget *w,
struct snd_soc_tplg_dapm_widget *tplg_w)
{
}
static int skl_tplg_control_load(struct snd_soc_component *cmpnt,
+ int index,
struct snd_kcontrol_new *kctl,
struct snd_soc_tplg_ctl_hdr *hdr)
{
return 0;
}
-static int skl_manifest_load(struct snd_soc_component *cmpnt,
+static int skl_manifest_load(struct snd_soc_component *cmpnt, int index,
struct snd_soc_tplg_manifest *manifest)
{
struct hdac_ext_bus *ebus = snd_soc_component_get_drvdata(cmpnt);
u16 inst_id;
};
-struct skl_uuid_inst_map {
- u16 inst_id;
- u16 reserved;
- uuid_le mod_uuid;
-} __packed;
-
struct skl_kpb_params {
u32 num_modules;
- union {
- struct skl_mod_inst_map map[0];
- struct skl_uuid_inst_map map_uuid[0];
- } u;
+ struct skl_mod_inst_map map[0];
};
struct skl_module_inst_id {
u32 caps_size, u32 node_id);
void skl_tplg_set_be_dmic_config(struct snd_soc_dai *dai,
struct skl_pipe_params *params, int stream);
-int skl_tplg_init(struct snd_soc_component *component,
+int skl_tplg_init(struct snd_soc_platform *platform,
struct hdac_ext_bus *ebus);
struct skl_module_cfg *skl_tplg_fe_get_cpr_module(
struct snd_soc_dai *dai, int stream);
int skl_pcm_link_dma_prepare(struct device *dev,
struct skl_pipe_params *params);
-int skl_dai_load(struct snd_soc_component *cmp,
- struct snd_soc_dai_driver *pcm_dai);
-void skl_tplg_add_moduleid_in_bind_params(struct skl *skl,
- struct snd_soc_dapm_widget *w);
+int skl_dai_load(struct snd_soc_component *, int index,
+ struct snd_soc_dai_driver *dai_drv,
+ struct snd_soc_tplg_pcm *pcm, struct snd_soc_dai *dai);
#endif
int ret = 0;
if (tplg->comp && tplg->ops && tplg->ops->vendor_load)
- ret = tplg->ops->vendor_load(tplg->comp, hdr);
+ ret = tplg->ops->vendor_load(tplg->comp, tplg->index, hdr);
else {
dev_err(tplg->dev, "ASoC: no vendor load callback for ID %d\n",
hdr->vendor_type);
struct snd_soc_dapm_widget *w, struct snd_soc_tplg_dapm_widget *tplg_w)
{
if (tplg->comp && tplg->ops && tplg->ops->widget_load)
- return tplg->ops->widget_load(tplg->comp, w, tplg_w);
+ return tplg->ops->widget_load(tplg->comp, tplg->index, w,
+ tplg_w);
return 0;
}
struct snd_soc_dapm_widget *w, struct snd_soc_tplg_dapm_widget *tplg_w)
{
if (tplg->comp && tplg->ops && tplg->ops->widget_ready)
- return tplg->ops->widget_ready(tplg->comp, w, tplg_w);
+ return tplg->ops->widget_ready(tplg->comp, tplg->index, w,
+ tplg_w);
return 0;
}
/* pass DAI configurations to component driver for extra initialization */
static int soc_tplg_dai_load(struct soc_tplg *tplg,
- struct snd_soc_dai_driver *dai_drv)
+ struct snd_soc_dai_driver *dai_drv,
+ struct snd_soc_tplg_pcm *pcm, struct snd_soc_dai *dai)
{
if (tplg->comp && tplg->ops && tplg->ops->dai_load)
- return tplg->ops->dai_load(tplg->comp, dai_drv);
+ return tplg->ops->dai_load(tplg->comp, tplg->index, dai_drv,
+ pcm, dai);
return 0;
}
/* pass link configurations to component driver for extra initialization */
static int soc_tplg_dai_link_load(struct soc_tplg *tplg,
- struct snd_soc_dai_link *link)
+ struct snd_soc_dai_link *link, struct snd_soc_tplg_link_config *cfg)
{
if (tplg->comp && tplg->ops && tplg->ops->link_load)
- return tplg->ops->link_load(tplg->comp, link);
+ return tplg->ops->link_load(tplg->comp, tplg->index, link, cfg);
return 0;
}
struct snd_kcontrol_new *k, struct snd_soc_tplg_ctl_hdr *hdr)
{
if (tplg->comp && tplg->ops && tplg->ops->control_load)
- return tplg->ops->control_load(tplg->comp, k, hdr);
+ return tplg->ops->control_load(tplg->comp, tplg->index, k,
+ hdr);
return 0;
}
}
/* pass control to component driver for optional further init */
- ret = soc_tplg_dai_load(tplg, dai_drv);
+ ret = soc_tplg_dai_load(tplg, dai_drv, pcm, NULL);
if (ret < 0) {
dev_err(tplg->comp->dev, "ASoC: DAI loading failed\n");
kfree(dai_drv);
set_link_flags(link, pcm->flag_mask, pcm->flags);
/* pass control to component driver for optional further init */
- ret = soc_tplg_dai_link_load(tplg, link);
+ ret = soc_tplg_dai_link_load(tplg, link, NULL);
if (ret < 0) {
dev_err(tplg->comp->dev, "ASoC: FE link loading failed\n");
kfree(link);
set_link_flags(link, cfg->flag_mask, cfg->flags);
/* pass control to component driver for optional further init */
- ret = soc_tplg_dai_link_load(tplg, link);
+ ret = soc_tplg_dai_link_load(tplg, link, cfg);
if (ret < 0) {
dev_err(tplg->dev, "ASoC: physical link loading failed\n");
return ret;
set_dai_flags(dai_drv, d->flag_mask, d->flags);
/* pass control to component driver for optional further init */
- ret = soc_tplg_dai_load(tplg, dai_drv);
+ ret = soc_tplg_dai_load(tplg, dai_drv, NULL, dai);
if (ret < 0) {
dev_err(tplg->comp->dev, "ASoC: DAI loading failed\n");
return ret;
/* pass control to component driver for optional further init */
if (tplg->comp && tplg->ops && tplg->ops->manifest)
- return tplg->ops->manifest(tplg->comp, _manifest);
+ return tplg->ops->manifest(tplg->comp, tplg->index, _manifest);
if (!abi_match) /* free the duplicated one */
kfree(_manifest);