SoC: intel: byt: Introduce new custom IN2 map

Introduce a new custom dapm routes map to quirk platforms with the
internal mic connected to IN2P.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Carlo Caione 2017-10-18 17:49:57 +01:00 committed by Mark Brown
parent 271ef65b58
commit 39712db878
1 changed files with 15 additions and 1 deletions

View File

@ -37,6 +37,7 @@
enum { enum {
BYT_RT5651_DMIC_MAP, BYT_RT5651_DMIC_MAP,
BYT_RT5651_IN1_MAP, BYT_RT5651_IN1_MAP,
BYT_RT5651_IN2_MAP,
}; };
#define BYT_RT5651_MAP(quirk) ((quirk) & GENMASK(7, 0)) #define BYT_RT5651_MAP(quirk) ((quirk) & GENMASK(7, 0))
@ -58,6 +59,8 @@ static void log_quirks(struct device *dev)
dev_info(dev, "quirk DMIC_MAP enabled"); dev_info(dev, "quirk DMIC_MAP enabled");
if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_MAP) if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_MAP)
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)
dev_info(dev, "quirk IN2_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)
@ -143,7 +146,6 @@ static const struct snd_soc_dapm_route byt_rt5651_audio_map[] = {
{"ssp2 Rx", NULL, "AIF1 Capture"}, {"ssp2 Rx", NULL, "AIF1 Capture"},
{"Headset Mic", NULL, "micbias1"}, /* lowercase for rt5651 */ {"Headset Mic", NULL, "micbias1"}, /* lowercase for rt5651 */
{"IN2P", NULL, "Headset Mic"},
{"Headphone", NULL, "HPOL"}, {"Headphone", NULL, "HPOL"},
{"Headphone", NULL, "HPOR"}, {"Headphone", NULL, "HPOR"},
{"Speaker", NULL, "LOUTL"}, {"Speaker", NULL, "LOUTL"},
@ -151,15 +153,23 @@ static const struct snd_soc_dapm_route byt_rt5651_audio_map[] = {
}; };
static const struct snd_soc_dapm_route byt_rt5651_intmic_dmic_map[] = { static const struct snd_soc_dapm_route byt_rt5651_intmic_dmic_map[] = {
{"IN2P", NULL, "Headset Mic"},
{"DMIC L1", NULL, "Internal Mic"}, {"DMIC L1", NULL, "Internal Mic"},
{"DMIC R1", NULL, "Internal Mic"}, {"DMIC R1", NULL, "Internal Mic"},
}; };
static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = { static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = {
{"Internal Mic", NULL, "micbias1"}, {"Internal Mic", NULL, "micbias1"},
{"IN2P", NULL, "Headset Mic"},
{"IN1P", NULL, "Internal Mic"}, {"IN1P", NULL, "Internal Mic"},
}; };
static const struct snd_soc_dapm_route byt_rt5651_intmic_in2_map[] = {
{"Internal Mic", NULL, "micbias1"},
{"IN1P", NULL, "Headset Mic"},
{"IN2P", 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"),
@ -246,6 +256,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
custom_map = byt_rt5651_intmic_in1_map; custom_map = byt_rt5651_intmic_in1_map;
num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_map); num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_map);
break; break;
case BYT_RT5651_IN2_MAP:
custom_map = byt_rt5651_intmic_in2_map;
num_routes = ARRAY_SIZE(byt_rt5651_intmic_in2_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);