Merge branch 'topic/drm_audio_component' of https://git.kernel.org/pub/scm/linux...
[sfrench/cifs-2.6.git] / sound / soc / intel / skylake / skl-topology.c
index 2c5129782959730e471eae741528b9814f7e2068..2620d77729c52edf06dd4d347825b9872b9070da 100644 (file)
@@ -108,6 +108,9 @@ static int is_skl_dsp_widget_type(struct snd_soc_dapm_widget *w,
        case snd_soc_dapm_aif_out:
        case snd_soc_dapm_dai_out:
        case snd_soc_dapm_switch:
+       case snd_soc_dapm_output:
+       case snd_soc_dapm_mux:
+
                return false;
        default:
                return true;
@@ -934,7 +937,7 @@ static int skl_tplg_find_moduleid_from_uuid(struct skl *skl,
        struct soc_bytes_ext *sb = (void *) k->private_value;
        struct skl_algo_data *bc = (struct skl_algo_data *)sb->dobj.private;
        struct skl_kpb_params *uuid_params, *params;
-       struct hdac_bus *bus = ebus_to_hbus(skl_to_ebus(skl));
+       struct hdac_bus *bus = skl_to_bus(skl);
        int i, size, module_id;
 
        if (bc->set_params == SKL_PARAM_BIND && bc->max) {
@@ -2428,8 +2431,10 @@ static int skl_tplg_get_token(struct device *dev,
 
        case SKL_TKN_U8_DYN_IN_PIN:
                if (!mconfig->m_in_pin)
-                       mconfig->m_in_pin = devm_kzalloc(dev, MAX_IN_QUEUE *
-                                       sizeof(*mconfig->m_in_pin), GFP_KERNEL);
+                       mconfig->m_in_pin =
+                               devm_kcalloc(dev, MAX_IN_QUEUE,
+                                            sizeof(*mconfig->m_in_pin),
+                                            GFP_KERNEL);
                if (!mconfig->m_in_pin)
                        return -ENOMEM;
 
@@ -2439,8 +2444,10 @@ static int skl_tplg_get_token(struct device *dev,
 
        case SKL_TKN_U8_DYN_OUT_PIN:
                if (!mconfig->m_out_pin)
-                       mconfig->m_out_pin = devm_kzalloc(dev, MAX_IN_QUEUE *
-                                       sizeof(*mconfig->m_in_pin), GFP_KERNEL);
+                       mconfig->m_out_pin =
+                               devm_kcalloc(dev, MAX_IN_QUEUE,
+                                            sizeof(*mconfig->m_in_pin),
+                                            GFP_KERNEL);
                if (!mconfig->m_out_pin)
                        return -ENOMEM;
 
@@ -2852,14 +2859,14 @@ static int skl_tplg_get_pvt_data_v4(struct snd_soc_tplg_dapm_widget *tplg_w,
        mconfig->time_slot = dfw->time_slot;
        mconfig->formats_config.caps_size = dfw->caps.caps_size;
 
-       mconfig->m_in_pin = devm_kzalloc(dev,
-                               MAX_IN_QUEUE * sizeof(*mconfig->m_in_pin),
+       mconfig->m_in_pin = devm_kcalloc(dev,
+                               MAX_IN_QUEUE, sizeof(*mconfig->m_in_pin),
                                GFP_KERNEL);
        if (!mconfig->m_in_pin)
                return -ENOMEM;
 
-       mconfig->m_out_pin = devm_kzalloc(dev,
-                               MAX_OUT_QUEUE * sizeof(*mconfig->m_out_pin),
+       mconfig->m_out_pin = devm_kcalloc(dev,
+                               MAX_OUT_QUEUE, sizeof(*mconfig->m_out_pin),
                                GFP_KERNEL);
        if (!mconfig->m_out_pin)
                return -ENOMEM;
@@ -3020,14 +3027,13 @@ void skl_cleanup_resources(struct skl *skl)
  * 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)
 {
        int ret;
-       struct hdac_ext_bus *ebus = snd_soc_component_get_drvdata(cmpnt);
-       struct skl *skl = ebus_to_skl(ebus);
-       struct hdac_bus *bus = ebus_to_hbus(ebus);
+       struct hdac_bus *bus = snd_soc_component_get_drvdata(cmpnt);
+       struct skl *skl = bus_to_skl(bus);
        struct skl_module_cfg *mconfig;
 
        if (!tplg_w->priv.size)
@@ -3127,14 +3133,14 @@ static int skl_init_enum_data(struct device *dev, struct soc_enum *se,
 }
 
 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)
 {
        struct soc_bytes_ext *sb;
        struct snd_soc_tplg_bytes_control *tplg_bc;
        struct snd_soc_tplg_enum_control *tplg_ec;
-       struct hdac_ext_bus *ebus  = snd_soc_component_get_drvdata(cmpnt);
-       struct hdac_bus *bus = ebus_to_hbus(ebus);
+       struct hdac_bus *bus  = snd_soc_component_get_drvdata(cmpnt);
        struct soc_enum *se;
 
        switch (hdr->ops.info) {
@@ -3615,12 +3621,11 @@ static int skl_tplg_get_manifest_data(struct snd_soc_tplg_manifest *manifest,
        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);
-       struct hdac_bus *bus = ebus_to_hbus(ebus);
-       struct skl *skl = ebus_to_skl(ebus);
+       struct hdac_bus *bus = snd_soc_component_get_drvdata(cmpnt);
+       struct skl *skl = bus_to_skl(bus);
 
        /* proceed only if we have private data defined */
        if (manifest->priv.size == 0)
@@ -3709,12 +3714,11 @@ static void skl_tplg_set_pipe_type(struct skl *skl, struct skl_pipe *pipe)
 /*
  * SKL topology init routine
  */
-int skl_tplg_init(struct snd_soc_component *component, struct hdac_ext_bus *ebus)
+int skl_tplg_init(struct snd_soc_component *component, struct hdac_bus *bus)
 {
        int ret;
        const struct firmware *fw;
-       struct hdac_bus *bus = ebus_to_hbus(ebus);
-       struct skl *skl = ebus_to_skl(ebus);
+       struct skl *skl = bus_to_skl(bus);
        struct skl_pipeline *ppl;
 
        ret = request_firmware(&fw, skl->tplg_name, bus->dev);