ASoC: Intel: bytcr-rt5651: add quirk for IN3P which may also be used
authorKeyon Jie <yang.jie@linux.intel.com>
Fri, 5 Jan 2018 19:20:18 +0000 (13:20 -0600)
committerMark Brown <broonie@kernel.org>
Mon, 8 Jan 2018 16:01:43 +0000 (16:01 +0000)
On Minnowboard Max with Realtek rt5651 eval board, the IN3P is
connected to Headset Mic.

Here add and select it for Minnowboard Max.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bytcr_rt5651.c

index de064f0f7b08d0f114fb11a5ab3115c181f76d6a..a958ed37569fea836ceddcaa844c9ea466e71c17 100644 (file)
@@ -39,6 +39,7 @@ enum {
        BYT_RT5651_IN1_MAP,
        BYT_RT5651_IN2_MAP,
        BYT_RT5651_IN1_IN2_MAP,
+       BYT_RT5651_IN3_MAP,
 };
 
 #define BYT_RT5651_MAP(quirk)  ((quirk) & GENMASK(7, 0))
@@ -63,6 +64,8 @@ static void log_quirks(struct device *dev)
                dev_info(dev, "quirk IN1_MAP enabled");
        if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN2_MAP)
                dev_info(dev, "quirk IN2_MAP enabled");
+       if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN3_MAP)
+               dev_info(dev, "quirk IN3_MAP enabled");
        if (byt_rt5651_quirk & BYT_RT5651_DMIC_EN)
                dev_info(dev, "quirk DMIC enabled");
        if (byt_rt5651_quirk & BYT_RT5651_MCLK_EN)
@@ -179,6 +182,12 @@ static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_in2_map[] = {
        {"IN3P", NULL, "Headset Mic"},
 };
 
+static const struct snd_soc_dapm_route byt_rt5651_intmic_in3_map[] = {
+       {"Internal Mic", NULL, "micbias1"},
+       {"IN3P", NULL, "Headset Mic"},
+       {"IN1P", NULL, "Internal Mic"},
+};
+
 static const struct snd_kcontrol_new byt_rt5651_controls[] = {
        SOC_DAPM_PIN_SWITCH("Headphone"),
        SOC_DAPM_PIN_SWITCH("Headset Mic"),
@@ -255,8 +264,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
                        DMI_MATCH(DMI_SYS_VENDOR, "Circuitco"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Max B3 PLATFORM"),
                },
-               .driver_data = (void *)(BYT_RT5651_DMIC_MAP |
-                                       BYT_RT5651_DMIC_EN),
+               .driver_data = (void *)(BYT_RT5651_IN3_MAP),
        },
        {
                .callback = byt_rt5651_quirk_cb,
@@ -294,6 +302,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
                custom_map = byt_rt5651_intmic_in1_in2_map;
                num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_in2_map);
                break;
+       case BYT_RT5651_IN3_MAP:
+               custom_map = byt_rt5651_intmic_in3_map;
+               num_routes = ARRAY_SIZE(byt_rt5651_intmic_in3_map);
+               break;
        default:
                custom_map = byt_rt5651_intmic_dmic_map;
                num_routes = ARRAY_SIZE(byt_rt5651_intmic_dmic_map);