Commit ac275ee5 authored by Hans de Goede's avatar Hans de Goede Committed by Mark Brown

ASoC: Intel: bytcr_rt5651: Add IN2 input mapping

During the recent cleanup series 3 of the 6 input mappings where removed
from the bytcr_rt5651 machine driver because testing showed that none of
them were used.

However some devices do actually have their internal mic on IN2 (and
only IN2, not IN1 and IN2), this did not show during previous tests
due to a bug in the userspace UCM input device switching code.

This commit re-adds the IN2 mapping for devices with the internal mic.
on IN2 and the headser mic on IN3 and enables this mapping on devices
with their internal mic on IN2.

This commit also changes the default internal mic input to IN2, because
all my 7 test devices have their mic there.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8627fb25
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
enum { enum {
BYT_RT5651_DMIC_MAP, BYT_RT5651_DMIC_MAP,
BYT_RT5651_IN1_MAP, BYT_RT5651_IN1_MAP,
BYT_RT5651_IN2_MAP,
BYT_RT5651_IN1_IN2_MAP, BYT_RT5651_IN1_IN2_MAP,
}; };
...@@ -93,9 +94,9 @@ struct byt_rt5651_private { ...@@ -93,9 +94,9 @@ struct byt_rt5651_private {
struct snd_soc_jack jack; struct snd_soc_jack jack;
}; };
/* Default: jack-detect on JD1_1, internal mic on in1, headsetmic on in3 */ /* Default: jack-detect on JD1_1, internal mic on in2, headsetmic on in3 */
static unsigned long byt_rt5651_quirk = BYT_RT5651_DEFAULT_QUIRKS | static unsigned long byt_rt5651_quirk = BYT_RT5651_DEFAULT_QUIRKS |
BYT_RT5651_IN1_MAP; BYT_RT5651_IN2_MAP;
static void log_quirks(struct device *dev) static void log_quirks(struct device *dev)
{ {
...@@ -103,6 +104,8 @@ static void log_quirks(struct device *dev) ...@@ -103,6 +104,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_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_IN2_MAP) if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_IN2_MAP)
dev_info(dev, "quirk IN1_IN2_MAP enabled"); dev_info(dev, "quirk IN1_IN2_MAP enabled");
if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) { if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) {
...@@ -270,6 +273,12 @@ static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = { ...@@ -270,6 +273,12 @@ static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = {
{"IN3P", NULL, "Headset Mic"}, {"IN3P", NULL, "Headset Mic"},
}; };
static const struct snd_soc_dapm_route byt_rt5651_intmic_in2_map[] = {
{"Internal Mic", NULL, "micbias1"},
{"IN2P", NULL, "Internal Mic"},
{"IN3P", NULL, "Headset Mic"},
};
static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_in2_map[] = { static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_in2_map[] = {
{"Internal Mic", NULL, "micbias1"}, {"Internal Mic", NULL, "micbias1"},
{"IN1P", NULL, "Internal Mic"}, {"IN1P", NULL, "Internal Mic"},
...@@ -364,7 +373,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { ...@@ -364,7 +373,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"), DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
}, },
.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
BYT_RT5651_IN1_MAP | BYT_RT5651_IN2_MAP |
BYT_RT5651_HP_LR_SWAPPED), BYT_RT5651_HP_LR_SWAPPED),
}, },
{ {
...@@ -375,7 +384,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = { ...@@ -375,7 +384,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "D2D3_Vi8A1"), DMI_MATCH(DMI_PRODUCT_NAME, "D2D3_Vi8A1"),
}, },
.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
BYT_RT5651_IN1_MAP | BYT_RT5651_IN2_MAP |
BYT_RT5651_HP_LR_SWAPPED), BYT_RT5651_HP_LR_SWAPPED),
}, },
{ {
...@@ -468,6 +477,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime) ...@@ -468,6 +477,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;
case BYT_RT5651_IN1_IN2_MAP: case BYT_RT5651_IN1_IN2_MAP:
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);
...@@ -825,7 +838,7 @@ struct acpi_chan_package { /* ACPICA seems to require 64 bit integers */ ...@@ -825,7 +838,7 @@ struct acpi_chan_package { /* ACPICA seems to require 64 bit integers */
static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
{ {
const char * const mic_name[] = { "dmic", "in1", "in12" }; const char * const mic_name[] = { "dmic", "in1", "in2", "in12" };
struct byt_rt5651_private *priv; struct byt_rt5651_private *priv;
struct snd_soc_acpi_mach *mach; struct snd_soc_acpi_mach *mach;
struct device *codec_dev; struct device *codec_dev;
......
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