ASoC: Intel: bytcr_rt5640: change quirk position
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 4 Mar 2016 03:36:37 +0000 (21:36 -0600)
committerMark Brown <broonie@kernel.org>
Sat, 5 Mar 2016 04:05:18 +0000 (13:05 +0900)
No added functionality

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bytcr_rt5640.c

index 9a1752df45a9feacf7687fdd65d8a276c7c9d9ab..a06cd1f991907e6338b895ca4ff6604d42bf5e7f 100644 (file)
 #include "../atom/sst-atom-controls.h"
 #include "../common/sst-acpi.h"
 
+enum {
+       BYT_RT5640_DMIC1_MAP,
+       BYT_RT5640_DMIC2_MAP,
+       BYT_RT5640_IN1_MAP,
+};
+
+#define BYT_RT5640_MAP(quirk)  ((quirk) & 0xff)
+#define BYT_RT5640_DMIC_EN     BIT(16)
+
+static unsigned long byt_rt5640_quirk = BYT_RT5640_DMIC1_MAP |
+                                       BYT_RT5640_DMIC_EN;
+
 static const struct snd_soc_dapm_widget byt_rt5640_widgets[] = {
        SND_SOC_DAPM_HP("Headphone", NULL),
        SND_SOC_DAPM_MIC("Headset Mic", NULL),
@@ -70,18 +82,6 @@ static const struct snd_soc_dapm_route byt_rt5640_intmic_in1_map[] = {
        {"IN1P", NULL, "Internal Mic"},
 };
 
-enum {
-       BYT_RT5640_DMIC1_MAP,
-       BYT_RT5640_DMIC2_MAP,
-       BYT_RT5640_IN1_MAP,
-};
-
-#define BYT_RT5640_MAP(quirk)  ((quirk) & 0xff)
-#define BYT_RT5640_DMIC_EN     BIT(16)
-
-static unsigned long byt_rt5640_quirk = BYT_RT5640_DMIC1_MAP |
-                                       BYT_RT5640_DMIC_EN;
-
 static const struct snd_kcontrol_new byt_rt5640_controls[] = {
        SOC_DAPM_PIN_SWITCH("Headphone"),
        SOC_DAPM_PIN_SWITCH("Headset Mic"),
@@ -174,7 +174,6 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime)
                return ret;
        }
 
-       dmi_check_system(byt_rt5640_quirk_table);
        switch (BYT_RT5640_MAP(byt_rt5640_quirk)) {
        case BYT_RT5640_IN1_MAP:
                custom_map = byt_rt5640_intmic_in1_map;
@@ -351,6 +350,9 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
                 "%s%s%s", "i2c-", mach->id, ":00");
        byt_rt5640_dais[MERR_DPCM_COMPR+1].codec_name = byt_rt5640_codec_name;
 
+       /* check quirks before creating card */
+       dmi_check_system(byt_rt5640_quirk_table);
+
        ret_val = devm_snd_soc_register_card(&pdev->dev, &byt_rt5640_card);
 
        if (ret_val) {