Commit 60e3b52e authored by Keyon Jie's avatar Keyon Jie Committed by Mark Brown

ASoC: Intel: bytcr-rt5651: add quirk for IN3P which may also be used

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: default avatarKeyon Jie <yang.jie@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 56e49aa4
...@@ -39,6 +39,7 @@ enum { ...@@ -39,6 +39,7 @@ enum {
BYT_RT5651_IN1_MAP, BYT_RT5651_IN1_MAP,
BYT_RT5651_IN2_MAP, BYT_RT5651_IN2_MAP,
BYT_RT5651_IN1_IN2_MAP, BYT_RT5651_IN1_IN2_MAP,
BYT_RT5651_IN3_MAP,
}; };
#define BYT_RT5651_MAP(quirk) ((quirk) & GENMASK(7, 0)) #define BYT_RT5651_MAP(quirk) ((quirk) & GENMASK(7, 0))
...@@ -63,6 +64,8 @@ static void log_quirks(struct device *dev) ...@@ -63,6 +64,8 @@ static void log_quirks(struct device *dev)
dev_info(dev, "quirk IN1_MAP enabled"); dev_info(dev, "quirk IN1_MAP enabled");
if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN2_MAP) if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN2_MAP)
dev_info(dev, "quirk IN2_MAP enabled"); 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) if (byt_rt5651_quirk & BYT_RT5651_DMIC_EN)
dev_info(dev, "quirk DMIC enabled"); dev_info(dev, "quirk DMIC enabled");
if (byt_rt5651_quirk & BYT_RT5651_MCLK_EN) 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[] = { ...@@ -179,6 +182,12 @@ static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_in2_map[] = {
{"IN3P", NULL, "Headset Mic"}, {"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[] = { static const struct snd_kcontrol_new byt_rt5651_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone"), SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"), SOC_DAPM_PIN_SWITCH("Headset Mic"),
...@@ -255,8 +264,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { ...@@ -255,8 +264,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
DMI_MATCH(DMI_SYS_VENDOR, "Circuitco"), DMI_MATCH(DMI_SYS_VENDOR, "Circuitco"),
DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Max B3 PLATFORM"), DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Max B3 PLATFORM"),
}, },
.driver_data = (void *)(BYT_RT5651_DMIC_MAP | .driver_data = (void *)(BYT_RT5651_IN3_MAP),
BYT_RT5651_DMIC_EN),
}, },
{ {
.callback = byt_rt5651_quirk_cb, .callback = byt_rt5651_quirk_cb,
...@@ -294,6 +302,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime) ...@@ -294,6 +302,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
custom_map = byt_rt5651_intmic_in1_in2_map; custom_map = byt_rt5651_intmic_in1_in2_map;
num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_in2_map); num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_in2_map);
break; break;
case BYT_RT5651_IN3_MAP:
custom_map = byt_rt5651_intmic_in3_map;
num_routes = ARRAY_SIZE(byt_rt5651_intmic_in3_map);
break;
default: default:
custom_map = byt_rt5651_intmic_dmic_map; custom_map = byt_rt5651_intmic_dmic_map;
num_routes = ARRAY_SIZE(byt_rt5651_intmic_dmic_map); num_routes = ARRAY_SIZE(byt_rt5651_intmic_dmic_map);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment