Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus
authorMark Brown <broonie@kernel.org>
Fri, 10 Nov 2017 21:30:41 +0000 (21:30 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 10 Nov 2017 21:30:41 +0000 (21:30 +0000)
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
sound/soc/intel/skylake/skl-messages.c
sound/soc/intel/skylake/skl-nhlt.c
sound/soc/intel/skylake/skl-pcm.c
sound/soc/intel/skylake/skl-sst-utils.c
sound/soc/intel/skylake/skl-topology.h

index 9cd0769ccd347c66c4fd65ea0f2d1e1b14df2a55..69ab559564921c4a5670bb519a4c9d80058d418b 100644 (file)
@@ -605,7 +605,7 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
        list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
                codec = pcm->codec_dai->codec;
                snprintf(jack_name, sizeof(jack_name),
-                       "HDMI/DP, pcm=%d Jack", pcm->device);
+                       "HDMI/DP,pcm=%d Jack", pcm->device);
                err = snd_soc_card_jack_new(card, jack_name,
                                SND_JACK_AVOUT, &ctx->kabylake_hdmi[i],
                                NULL, 0);
index 89f70133c8e4e344ea5f8365dd257a0ef47de56e..b9c205c8bb735e6311f53515bf038d3b1f9630f9 100644 (file)
@@ -702,18 +702,11 @@ static void skl_set_updown_mixer_format(struct skl_sst *ctx,
        struct skl_module *module = mconfig->module;
        struct skl_module_iface *iface = &module->formats[mconfig->fmt_idx];
        struct skl_module_fmt *fmt = &iface->outputs[0].fmt;
-       int i = 0;
 
        skl_set_base_module_format(ctx, mconfig,
                (struct skl_base_cfg *)mixer_mconfig);
        mixer_mconfig->out_ch_cfg = fmt->ch_cfg;
-
-       /* Select F/W default coefficient */
-       mixer_mconfig->coeff_sel = 0x0;
-
-       /* User coeff, don't care since we are selecting F/W defaults */
-       for (i = 0; i < UP_DOWN_MIXER_MAX_COEFF; i++)
-               mixer_mconfig->coeff[i] = 0xDEADBEEF;
+       mixer_mconfig->ch_map = fmt->ch_map;
 }
 
 /*
index e7d766d56c8e7dc60d12b39172f63c3a54f27b49..d14c50a602894c4ad8aa76f2259839552aff2f6a 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/pci.h>
 #include "skl.h"
 
+#define NHLT_ACPI_HEADER_SIG   "NHLT"
+
 /* Unique identification for getting NHLT blobs */
 static guid_t osc_guid =
        GUID_INIT(0xA69F886E, 0x6CEB, 0x4594,
@@ -45,6 +47,13 @@ struct nhlt_acpi_table *skl_nhlt_init(struct device *dev)
                                memremap(nhlt_ptr->min_addr, nhlt_ptr->length,
                                MEMREMAP_WB);
                ACPI_FREE(obj);
+               if (nhlt_table && (strncmp(nhlt_table->header.signature,
+                                       NHLT_ACPI_HEADER_SIG,
+                                       strlen(NHLT_ACPI_HEADER_SIG)) != 0)) {
+                       memunmap(nhlt_table);
+                       dev_err(dev, "NHLT ACPI header signature incorrect\n");
+                       return NULL;
+               }
                return nhlt_table;
        }
 
index 2b1e513b1680e4c73130710c318e8fe50855c59c..a3cb204e9640fa36052bb2caf685ac465e051262 100644 (file)
@@ -355,7 +355,8 @@ static void skl_pcm_close(struct snd_pcm_substream *substream,
        }
 
        mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream);
-       skl_tplg_d0i3_put(skl, mconfig->d0i3_caps);
+       if (mconfig)
+               skl_tplg_d0i3_put(skl, mconfig->d0i3_caps);
 
        kfree(dma_params);
 }
index 369ef7ce981c799b8fab344ab4f3bfdfa34ed829..8ff89280d9fd44f11e34121f1dddd7647004c688 100644 (file)
@@ -251,6 +251,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
        struct uuid_module *module;
        struct firmware stripped_fw;
        unsigned int safe_file;
+       int ret = 0;
 
        /* Get the FW pointer to derive ADSP header */
        stripped_fw.data = fw->data;
@@ -299,8 +300,10 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
 
        for (i = 0; i < num_entry; i++, mod_entry++) {
                module = kzalloc(sizeof(*module), GFP_KERNEL);
-               if (!module)
-                       return -ENOMEM;
+               if (!module) {
+                       ret = -ENOMEM;
+                       goto free_uuid_list;
+               }
 
                uuid_bin = (uuid_le *)mod_entry->uuid.id;
                memcpy(&module->uuid, uuid_bin, sizeof(module->uuid));
@@ -311,8 +314,8 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
                size = sizeof(int) * mod_entry->instance_max_count;
                module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL);
                if (!module->instance_id) {
-                       kfree(module);
-                       return -ENOMEM;
+                       ret = -ENOMEM;
+                       goto free_uuid_list;
                }
 
                list_add_tail(&module->list, &skl->uuid_list);
@@ -323,6 +326,10 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
        }
 
        return 0;
+
+free_uuid_list:
+       skl_freeup_uuid_list(skl);
+       return ret;
 }
 
 void skl_freeup_uuid_list(struct skl_sst *ctx)
index 2717db92036b4cc58ac7148904b41d00d16d4805..bc3c29161ed0062b55a83598de4159c2de499fd2 100644 (file)
@@ -34,7 +34,7 @@
 #define MAX_FIXED_DMIC_PARAMS_SIZE 727
 
 /* Maximum number of coefficients up down mixer module */
-#define UP_DOWN_MIXER_MAX_COEFF                6
+#define UP_DOWN_MIXER_MAX_COEFF                8
 
 #define MODULE_MAX_IN_PINS     8
 #define MODULE_MAX_OUT_PINS    8
@@ -161,6 +161,7 @@ struct skl_up_down_mixer_cfg {
        u32 coeff_sel;
        /* Pass the user coeff in this array */
        s32 coeff[UP_DOWN_MIXER_MAX_COEFF];
+       u32 ch_map;
 } __packed;
 
 struct skl_algo_cfg {