All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] ASoC: rt5645: Analog microphone fixes
@ 2018-01-02 18:53 Hans de Goede
  2018-01-02 18:53 ` [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply Hans de Goede
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Hans de Goede @ 2018-01-02 18:53 UTC (permalink / raw)
  To: Mark Brown, Bard Liao, Oder Chiou; +Cc: Hans de Goede, alsa-devel, Takashi Iwai

Hi All,

Here is a patch-series primarily fixing analog microphone inputs on
Cherry Trail devices with a rt5645 codec.

The first 2 patches are from Bard Liao, he has already submitted the
first one himself a couple of days ago. I've included this because
his second patch depends on it and he has not yet submitted that one
himself I believe. My version of his 2nd patch fixes 2 compiler warnings
by removing 2 unused variable declarations.

Patches 3-5 makes some changes to platform data necessary to make
everything work correctly on my cht + rt5645 devices. The 6th patch
adds an "Int Analog Mic" DAPM widget which is used by updated ucm files
for these devices to get the micbias supplies enabled without which
the micrphones on these devices will not work.

Regards,

Hans

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
  2018-01-02 18:53 [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
@ 2018-01-02 18:53 ` Hans de Goede
  2018-01-03 10:50   ` Mark Brown
  2018-01-02 18:53 ` [PATCH 2/6] ASoC: rt5645: add micbias power control select Hans de Goede
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2018-01-02 18:53 UTC (permalink / raw)
  To: Mark Brown, Bard Liao, Oder Chiou; +Cc: Hans de Goede, alsa-devel, Takashi Iwai

From: Bard Liao <bardliao@realtek.com>

Register "micbias1" and "micbias2" to supply widegts as modern drivers do.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 sound/soc/codecs/rt5645.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 5e34e24c01ab..b69c57709d8b 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -1980,10 +1980,10 @@ static const struct snd_soc_dapm_widget rt5645_dapm_widgets[] = {
 
 	/* Input Side */
 	/* micbias */
-	SND_SOC_DAPM_MICBIAS("micbias1", RT5645_PWR_ANLG2,
-			RT5645_PWR_MB1_BIT, 0),
-	SND_SOC_DAPM_MICBIAS("micbias2", RT5645_PWR_ANLG2,
-			RT5645_PWR_MB2_BIT, 0),
+	SND_SOC_DAPM_SUPPLY("micbias1", RT5645_PWR_ANLG2,
+			RT5645_PWR_MB1_BIT, 0, NULL, 0),
+	SND_SOC_DAPM_SUPPLY("micbias2", RT5645_PWR_ANLG2,
+			RT5645_PWR_MB2_BIT, 0, NULL, 0),
 	/* Input Lines */
 	SND_SOC_DAPM_INPUT("DMIC L1"),
 	SND_SOC_DAPM_INPUT("DMIC R1"),
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/6] ASoC: rt5645: add micbias power control select.
  2018-01-02 18:53 [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
  2018-01-02 18:53 ` [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply Hans de Goede
@ 2018-01-02 18:53 ` Hans de Goede
  2018-01-04 12:37   ` Applied "ASoC: rt5645: add micbias power control select." to the asoc tree Mark Brown
  2018-01-02 18:53 ` [PATCH 3/6] ASoC: rt5645: set in2_diff flag for GPD win and pocket devices Hans de Goede
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2018-01-02 18:53 UTC (permalink / raw)
  To: Mark Brown, Bard Liao, Oder Chiou; +Cc: Hans de Goede, alsa-devel, Takashi Iwai

From: Bard Liao <bardliao@realtek.com>

We need to set a corresponding control bit before powering micbias up.

Signed-off-by: Bard Liao <bardliao@realtek.com>
[hdegoede@redhat.com: Remove 2 unused variable declarations]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 sound/soc/codecs/rt5645.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--
 sound/soc/codecs/rt5645.h |  6 +++++
 2 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index b69c57709d8b..2e495d61b55e 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -1943,6 +1943,56 @@ static int rt5650_hp_event(struct snd_soc_dapm_widget *w,
 	return 0;
 }
 
+static int rt5645_set_micbias1_event(struct snd_soc_dapm_widget *w,
+		struct snd_kcontrol *k, int  event)
+{
+	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+			RT5645_MICBIAS1_POW_CTRL_SEL_MASK,
+			RT5645_MICBIAS1_POW_CTRL_SEL_M);
+		break;
+
+	case SND_SOC_DAPM_POST_PMD:
+		snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+			RT5645_MICBIAS1_POW_CTRL_SEL_MASK,
+			RT5645_MICBIAS1_POW_CTRL_SEL_A);
+		break;
+
+	default:
+		return 0;
+	}
+
+	return 0;
+}
+
+static int rt5645_set_micbias2_event(struct snd_soc_dapm_widget *w,
+		struct snd_kcontrol *k, int  event)
+{
+	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+			RT5645_MICBIAS2_POW_CTRL_SEL_MASK,
+			RT5645_MICBIAS2_POW_CTRL_SEL_M);
+		break;
+
+	case SND_SOC_DAPM_POST_PMD:
+		snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+			RT5645_MICBIAS2_POW_CTRL_SEL_MASK,
+			RT5645_MICBIAS2_POW_CTRL_SEL_A);
+		break;
+
+	default:
+		return 0;
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_dapm_widget rt5645_dapm_widgets[] = {
 	SND_SOC_DAPM_SUPPLY("LDO2", RT5645_PWR_MIXER,
 		RT5645_PWR_LDO2_BIT, 0, NULL, 0),
@@ -1981,9 +2031,11 @@ static const struct snd_soc_dapm_widget rt5645_dapm_widgets[] = {
 	/* Input Side */
 	/* micbias */
 	SND_SOC_DAPM_SUPPLY("micbias1", RT5645_PWR_ANLG2,
-			RT5645_PWR_MB1_BIT, 0, NULL, 0),
+			RT5645_PWR_MB1_BIT, 0, rt5645_set_micbias1_event,
+			SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
 	SND_SOC_DAPM_SUPPLY("micbias2", RT5645_PWR_ANLG2,
-			RT5645_PWR_MB2_BIT, 0, NULL, 0),
+			RT5645_PWR_MB2_BIT, 0, rt5645_set_micbias2_event,
+			SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
 	/* Input Lines */
 	SND_SOC_DAPM_INPUT("DMIC L1"),
 	SND_SOC_DAPM_INPUT("DMIC R1"),
diff --git a/sound/soc/codecs/rt5645.h b/sound/soc/codecs/rt5645.h
index cfc5f97549eb..940325b28c29 100644
--- a/sound/soc/codecs/rt5645.h
+++ b/sound/soc/codecs/rt5645.h
@@ -2117,6 +2117,12 @@ enum {
 #define RT5645_RXDC_SRC_STO			(0x0 << 7)
 #define RT5645_RXDC_SRC_MONO			(0x1 << 7)
 #define RT5645_RXDC_SRC_SFT			(7)
+#define RT5645_MICBIAS1_POW_CTRL_SEL_MASK	(0x1 << 5)
+#define RT5645_MICBIAS1_POW_CTRL_SEL_A		(0x0 << 5)
+#define RT5645_MICBIAS1_POW_CTRL_SEL_M		(0x1 << 5)
+#define RT5645_MICBIAS2_POW_CTRL_SEL_MASK	(0x1 << 4)
+#define RT5645_MICBIAS2_POW_CTRL_SEL_A		(0x0 << 4)
+#define RT5645_MICBIAS2_POW_CTRL_SEL_M		(0x1 << 4)
 #define RT5645_RXDP2_SEL_MASK			(0x1 << 3)
 #define RT5645_RXDP2_SEL_IF2			(0x0 << 3)
 #define RT5645_RXDP2_SEL_ADC			(0x1 << 3)
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/6] ASoC: rt5645: set in2_diff flag for GPD win and pocket devices
  2018-01-02 18:53 [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
  2018-01-02 18:53 ` [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply Hans de Goede
  2018-01-02 18:53 ` [PATCH 2/6] ASoC: rt5645: add micbias power control select Hans de Goede
@ 2018-01-02 18:53 ` Hans de Goede
  2018-01-03 12:13   ` Applied "ASoC: rt5645: set in2_diff flag for GPD win and pocket devices" to the asoc tree Mark Brown
  2018-01-02 18:53 ` [PATCH 4/6] ASoC: rt5645: cleanup DMI matching code Hans de Goede
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2018-01-02 18:53 UTC (permalink / raw)
  To: Mark Brown, Bard Liao, Oder Chiou; +Cc: Hans de Goede, alsa-devel, Takashi Iwai

The GPD pocket has a differential signal microphone and needs in2_diff
to be set to avoid getting a very noisy signal.

Since the GPD pocket and win use the same DMI strings, they share their
platform data-definition, so enabling in2_diff on the pocket also sets
it on the GPD win. The GPD win has a normal microphone, but setting
in2_diff there does not negatively impact the sound from the microphone.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 sound/soc/codecs/rt5645.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 2e495d61b55e..6c134f4d881b 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3680,6 +3680,8 @@ static const struct rt5645_platform_data gpd_win_platform_data = {
 	.jd_mode = 3,
 	.inv_jd1_1 = true,
 	.long_name = "gpd-win-pocket-rt5645",
+	/* The GPD pocket has a diff. mic, for the win this does not matter. */
+	.in2_diff = true,
 };
 
 static const struct dmi_system_id dmi_platform_gpd_win[] = {
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/6] ASoC: rt5645: cleanup DMI matching code
  2018-01-02 18:53 [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
                   ` (2 preceding siblings ...)
  2018-01-02 18:53 ` [PATCH 3/6] ASoC: rt5645: set in2_diff flag for GPD win and pocket devices Hans de Goede
@ 2018-01-02 18:53 ` Hans de Goede
  2018-01-03 12:12   ` Applied "ASoC: rt5645: cleanup DMI matching code" to the asoc tree Mark Brown
  2018-01-02 18:53 ` [PATCH 5/6] ASoC: rt5645: add platform data for the Teclast X80 Pro tablet Hans de Goede
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2018-01-02 18:53 UTC (permalink / raw)
  To: Mark Brown, Bard Liao, Oder Chiou; +Cc: Hans de Goede, alsa-devel, Takashi Iwai

Rather then doing a dmi_check_system() per possible system use an array
with all known systems, with dmi_system_id.driver_data pointing to the
platform-data for the matching system.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 sound/soc/codecs/rt5645.c | 124 +++++++++++++++++++---------------------------
 1 file changed, 51 insertions(+), 73 deletions(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 6c134f4d881b..cadfc8871bb9 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3625,66 +3625,74 @@ static const struct acpi_device_id rt5645_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, rt5645_acpi_match);
 #endif
 
-static const struct rt5645_platform_data general_platform_data = {
+static const struct rt5645_platform_data intel_braswell_platform_data = {
 	.dmic1_data_pin = RT5645_DMIC1_DISABLE,
 	.dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
 	.jd_mode = 3,
 };
 
-static const struct dmi_system_id dmi_platform_intel_braswell[] = {
+static const struct rt5645_platform_data buddy_platform_data = {
+	.dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
+	.dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
+	.jd_mode = 3,
+	.level_trigger_irq = true,
+};
+
+static const struct rt5645_platform_data gpd_win_platform_data = {
+	.jd_mode = 3,
+	.inv_jd1_1 = true,
+	.long_name = "gpd-win-pocket-rt5645",
+	/* The GPD pocket has a diff. mic, for the win this does not matter. */
+	.in2_diff = true,
+};
+
+static const struct rt5645_platform_data asus_t100ha_platform_data = {
+	.dmic1_data_pin = RT5645_DMIC_DATA_IN2N,
+	.dmic2_data_pin = RT5645_DMIC2_DISABLE,
+	.jd_mode = 3,
+	.inv_jd1_1 = true,
+};
+
+static const struct rt5645_platform_data jd_mode3_platform_data = {
+	.jd_mode = 3,
+};
+
+static const struct dmi_system_id dmi_platform_data[] = {
+	{
+		.ident = "Chrome Buddy",
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "Buddy"),
+		},
+		.driver_data = (void *)&buddy_platform_data,
+	},
 	{
 		.ident = "Intel Strago",
 		.matches = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Strago"),
 		},
+		.driver_data = (void *)&intel_braswell_platform_data,
 	},
 	{
 		.ident = "Google Chrome",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
 		},
+		.driver_data = (void *)&intel_braswell_platform_data,
 	},
 	{
 		.ident = "Google Setzer",
 		.matches = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"),
 		},
+		.driver_data = (void *)&intel_braswell_platform_data,
 	},
 	{
 		.ident = "Microsoft Surface 3",
 		.matches = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
 		},
+		.driver_data = (void *)&intel_braswell_platform_data,
 	},
-	{ }
-};
-
-static const struct rt5645_platform_data buddy_platform_data = {
-	.dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
-	.dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
-	.jd_mode = 3,
-	.level_trigger_irq = true,
-};
-
-static const struct dmi_system_id dmi_platform_intel_broadwell[] = {
-	{
-		.ident = "Chrome Buddy",
-		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "Buddy"),
-		},
-	},
-	{ }
-};
-
-static const struct rt5645_platform_data gpd_win_platform_data = {
-	.jd_mode = 3,
-	.inv_jd1_1 = true,
-	.long_name = "gpd-win-pocket-rt5645",
-	/* The GPD pocket has a diff. mic, for the win this does not matter. */
-	.in2_diff = true,
-};
-
-static const struct dmi_system_id dmi_platform_gpd_win[] = {
 	{
 		/*
 		 * Match for the GPDwin which unfortunately uses somewhat
@@ -3695,61 +3703,34 @@ static const struct dmi_system_id dmi_platform_gpd_win[] = {
 		 * the same default product_name. Also the GPDwin is the
 		 * only device to have both board_ and product_name not set.
 		 */
-		.ident = "GPD Win",
+		.ident = "GPD Win / Pocket",
 		.matches = {
 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
 			DMI_MATCH(DMI_BOARD_NAME, "Default string"),
 			DMI_MATCH(DMI_BOARD_SERIAL, "Default string"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
 		},
+		.driver_data = (void *)&gpd_win_platform_data,
 	},
-	{}
-};
-
-static const struct rt5645_platform_data general_platform_data2 = {
-	.dmic1_data_pin = RT5645_DMIC_DATA_IN2N,
-	.dmic2_data_pin = RT5645_DMIC2_DISABLE,
-	.jd_mode = 3,
-	.inv_jd1_1 = true,
-};
-
-static const struct dmi_system_id dmi_platform_asus_t100ha[] = {
 	{
 		.ident = "ASUS T100HAN",
 		.matches = {
 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
 			DMI_MATCH(DMI_PRODUCT_NAME, "T100HAN"),
 		},
+		.driver_data = (void *)&asus_t100ha_platform_data,
 	},
-	{ }
-};
-
-static const struct rt5645_platform_data minix_z83_4_platform_data = {
-	.jd_mode = 3,
-};
-
-static const struct dmi_system_id dmi_platform_minix_z83_4[] = {
 	{
 		.ident = "MINIX Z83-4",
 		.matches = {
 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "MINIX"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
 		},
+		.driver_data = (void *)&jd_mode3_platform_data,
 	},
 	{ }
 };
 
-static bool rt5645_check_dp(struct device *dev)
-{
-	if (device_property_present(dev, "realtek,in2-differential") ||
-		device_property_present(dev, "realtek,dmic1-data-pin") ||
-		device_property_present(dev, "realtek,dmic2-data-pin") ||
-		device_property_present(dev, "realtek,jd-mode"))
-		return true;
-
-	return false;
-}
-
 static int rt5645_parse_dt(struct rt5645_priv *rt5645, struct device *dev)
 {
 	rt5645->pdata.in2_diff = device_property_read_bool(dev,
@@ -3768,6 +3749,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
 		    const struct i2c_device_id *id)
 {
 	struct rt5645_platform_data *pdata = dev_get_platdata(&i2c->dev);
+	const struct dmi_system_id *dmi_data;
 	struct rt5645_priv *rt5645;
 	int ret, i;
 	unsigned int val;
@@ -3781,20 +3763,16 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
 	rt5645->i2c = i2c;
 	i2c_set_clientdata(i2c, rt5645);
 
+	dmi_data = dmi_first_match(dmi_platform_data);
+	if (dmi_data) {
+		dev_info(&i2c->dev, "Detected %s platform\n", dmi_data->ident);
+		pdata = dmi_data->driver_data;
+	}
+
 	if (pdata)
 		rt5645->pdata = *pdata;
-	else if (dmi_check_system(dmi_platform_intel_broadwell))
-		rt5645->pdata = buddy_platform_data;
-	else if (rt5645_check_dp(&i2c->dev))
+	else
 		rt5645_parse_dt(rt5645, &i2c->dev);
-	else if (dmi_check_system(dmi_platform_intel_braswell))
-		rt5645->pdata = general_platform_data;
-	else if (dmi_check_system(dmi_platform_gpd_win))
-		rt5645->pdata = gpd_win_platform_data;
-	else if (dmi_check_system(dmi_platform_asus_t100ha))
-		rt5645->pdata = general_platform_data2;
-	else if (dmi_check_system(dmi_platform_minix_z83_4))
-		rt5645->pdata = minix_z83_4_platform_data;
 
 	if (quirk != -1) {
 		rt5645->pdata.in2_diff = QUIRK_IN2_DIFF(quirk);
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/6] ASoC: rt5645: add platform data for the Teclast X80 Pro tablet
  2018-01-02 18:53 [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
                   ` (3 preceding siblings ...)
  2018-01-02 18:53 ` [PATCH 4/6] ASoC: rt5645: cleanup DMI matching code Hans de Goede
@ 2018-01-02 18:53 ` Hans de Goede
  2018-01-03 12:12   ` Applied "ASoC: rt5645: add platform data for the Teclast X80 Pro tablet" to the asoc tree Mark Brown
  2018-01-02 18:53 ` [PATCH 6/6] ASoC: Intel: cht_bsw_rt5645: Analog Mic support Hans de Goede
  2018-01-02 18:56 ` [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
  6 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2018-01-02 18:53 UTC (permalink / raw)
  To: Mark Brown, Bard Liao, Oder Chiou; +Cc: Hans de Goede, alsa-devel, Takashi Iwai

The Teclast X80 Pro tablet needs jd_mode = 3 for headset jack detection.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 sound/soc/codecs/rt5645.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index cadfc8871bb9..33546bc356c7 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3728,6 +3728,14 @@ static const struct dmi_system_id dmi_platform_data[] = {
 		},
 		.driver_data = (void *)&jd_mode3_platform_data,
 	},
+	{
+		.ident = "Teclast X80 Pro",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "X80 Pro"),
+		},
+		.driver_data = (void *)&jd_mode3_platform_data,
+	},
 	{ }
 };
 
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/6] ASoC: Intel: cht_bsw_rt5645: Analog Mic support
  2018-01-02 18:53 [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
                   ` (4 preceding siblings ...)
  2018-01-02 18:53 ` [PATCH 5/6] ASoC: rt5645: add platform data for the Teclast X80 Pro tablet Hans de Goede
@ 2018-01-02 18:53 ` Hans de Goede
  2018-01-03 12:12   ` Applied "ASoC: Intel: cht_bsw_rt5645: Analog Mic support" to the asoc tree Mark Brown
  2018-01-02 18:56 ` [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
  6 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2018-01-02 18:53 UTC (permalink / raw)
  To: Mark Brown, Bard Liao, Oder Chiou; +Cc: Hans de Goede, alsa-devel, Takashi Iwai

Various Cherry Trail boards with a rt5645 codec have an analog mic
connected to IN2P + IN2N. The mic on this boards also needs micbias to
be enabled, on some boards micbias1 is used and on others micbias2, so
we enable both.

This commit adds a new "Int Analog Mic" DAPM widget for this, so that we
do not end up enabling micbias on boards with a digital mic which uses
the already present "Int Mic" widget. Some existing UCM files already
refer to "Int Mic" for their "Internal Analog Microphones" SectionDevice,
but these don't work anyways since they enable the RECMIX BST1 Switch
instead of the BST2 switch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 sound/soc/intel/boards/cht_bsw_rt5645.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 18d129caa974..f898ee140cdc 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -118,6 +118,7 @@ static const struct snd_soc_dapm_widget cht_dapm_widgets[] = {
 	SND_SOC_DAPM_HP("Headphone", NULL),
 	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 	SND_SOC_DAPM_MIC("Int Mic", NULL),
+	SND_SOC_DAPM_MIC("Int Analog Mic", NULL),
 	SND_SOC_DAPM_SPK("Ext Spk", NULL),
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
 			platform_clock_control, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
@@ -128,6 +129,8 @@ static const struct snd_soc_dapm_route cht_rt5645_audio_map[] = {
 	{"IN1N", NULL, "Headset Mic"},
 	{"DMIC L1", NULL, "Int Mic"},
 	{"DMIC R1", NULL, "Int Mic"},
+	{"IN2P", NULL, "Int Analog Mic"},
+	{"IN2N", NULL, "Int Analog Mic"},
 	{"Headphone", NULL, "HPOL"},
 	{"Headphone", NULL, "HPOR"},
 	{"Ext Spk", NULL, "SPOL"},
@@ -135,6 +138,9 @@ static const struct snd_soc_dapm_route cht_rt5645_audio_map[] = {
 	{"Headphone", NULL, "Platform Clock"},
 	{"Headset Mic", NULL, "Platform Clock"},
 	{"Int Mic", NULL, "Platform Clock"},
+	{"Int Analog Mic", NULL, "Platform Clock"},
+	{"Int Analog Mic", NULL, "micbias1"},
+	{"Int Analog Mic", NULL, "micbias2"},
 	{"Ext Spk", NULL, "Platform Clock"},
 };
 
@@ -189,6 +195,7 @@ static const struct snd_kcontrol_new cht_mc_controls[] = {
 	SOC_DAPM_PIN_SWITCH("Headphone"),
 	SOC_DAPM_PIN_SWITCH("Headset Mic"),
 	SOC_DAPM_PIN_SWITCH("Int Mic"),
+	SOC_DAPM_PIN_SWITCH("Int Analog Mic"),
 	SOC_DAPM_PIN_SWITCH("Ext Spk"),
 };
 
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 0/6] ASoC: rt5645: Analog microphone fixes
  2018-01-02 18:53 [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
                   ` (5 preceding siblings ...)
  2018-01-02 18:53 ` [PATCH 6/6] ASoC: Intel: cht_bsw_rt5645: Analog Mic support Hans de Goede
@ 2018-01-02 18:56 ` Hans de Goede
  6 siblings, 0 replies; 22+ messages in thread
From: Hans de Goede @ 2018-01-02 18:56 UTC (permalink / raw)
  To: Mark Brown, Bard Liao, Oder Chiou; +Cc: alsa-devel, Takashi Iwai

Hi,

On 02-01-18 19:53, Hans de Goede wrote:
> Hi All,
> 
> Here is a patch-series primarily fixing analog microphone inputs on
> Cherry Trail devices with a rt5645 codec.
> 
> The first 2 patches are from Bard Liao, he has already submitted the
> first one himself a couple of days ago. I've included this because
> his second patch depends on it and he has not yet submitted that one
> himself I believe. My version of his 2nd patch fixes 2 compiler warnings
> by removing 2 unused variable declarations.
> 
> Patches 3-5 makes some changes to platform data necessary to make
> everything work correctly on my cht + rt5645 devices. The 6th patch
> adds an "Int Analog Mic" DAPM widget which is used by updated ucm files
> for these devices to get the micbias supplies enabled without which
> the micrphones on these devices will not work.

I forgot to mention this has been tested on the following devices:

GPD win
GPD pocket
Teclast X80 Pro

Regards,

Hans

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
  2018-01-02 18:53 ` [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply Hans de Goede
@ 2018-01-03 10:50   ` Mark Brown
  2018-01-03 11:01     ` Hans de Goede
                       ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Mark Brown @ 2018-01-03 10:50 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Oder Chiou, Bard Liao, alsa-devel, Takashi Iwai


[-- Attachment #1.1: Type: text/plain, Size: 722 bytes --]

On Tue, Jan 02, 2018 at 07:53:09PM +0100, Hans de Goede wrote:

> Register "micbias1" and "micbias2" to supply widegts as modern drivers do.

> -	SND_SOC_DAPM_MICBIAS("micbias1", RT5645_PWR_ANLG2,
> -			RT5645_PWR_MB1_BIT, 0),
> -	SND_SOC_DAPM_MICBIAS("micbias2", RT5645_PWR_ANLG2,
> -			RT5645_PWR_MB2_BIT, 0),
> +	SND_SOC_DAPM_SUPPLY("micbias1", RT5645_PWR_ANLG2,
> +			RT5645_PWR_MB1_BIT, 0, NULL, 0),
> +	SND_SOC_DAPM_SUPPLY("micbias2", RT5645_PWR_ANLG2,
> +			RT5645_PWR_MB2_BIT, 0, NULL, 0),

This is a good change to make but we have machines with the rt5645, are
we sure none of them use microphones?  The two widget types work
differently so it needs some checking and possibly machine driver
updates to convert.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
  2018-01-03 10:50   ` Mark Brown
@ 2018-01-03 11:01     ` Hans de Goede
  2018-01-03 11:28       ` Mark Brown
  2018-01-03 12:45     ` Bard Liao
       [not found]     ` <ABFD875FF5FB574BA706497D987D48D702756F3C@RTITMBSV02.realtek.com.tw>
  2 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2018-01-03 11:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Oder Chiou, Bard Liao, alsa-devel, Takashi Iwai

Hi,

On 03-01-18 11:50, Mark Brown wrote:
> On Tue, Jan 02, 2018 at 07:53:09PM +0100, Hans de Goede wrote:
> 
>> Register "micbias1" and "micbias2" to supply widegts as modern drivers do.
> 
>> -	SND_SOC_DAPM_MICBIAS("micbias1", RT5645_PWR_ANLG2,
>> -			RT5645_PWR_MB1_BIT, 0),
>> -	SND_SOC_DAPM_MICBIAS("micbias2", RT5645_PWR_ANLG2,
>> -			RT5645_PWR_MB2_BIT, 0),
>> +	SND_SOC_DAPM_SUPPLY("micbias1", RT5645_PWR_ANLG2,
>> +			RT5645_PWR_MB1_BIT, 0, NULL, 0),
>> +	SND_SOC_DAPM_SUPPLY("micbias2", RT5645_PWR_ANLG2,
>> +			RT5645_PWR_MB2_BIT, 0, NULL, 0),
> 
> This is a good change to make but we have machines with the rt5645, are
> we sure none of them use microphones?  The two widget types work
> differently so it needs some checking and possibly machine driver
> updates to convert.

Right, we have existing machines with a rt5645 and an internal
analog mic, but those have been broken sofar (I can confirm
this for Cherry Trail based devices, I assume it applies
elsewhere) because without the next patch in this series we
were never actually enabling micbias. So this change should be
fine as analog mic support has been broken sofar anyways AFAIK.

Regards,

Hans

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
  2018-01-03 11:01     ` Hans de Goede
@ 2018-01-03 11:28       ` Mark Brown
  2018-01-03 11:32         ` Hans de Goede
  0 siblings, 1 reply; 22+ messages in thread
From: Mark Brown @ 2018-01-03 11:28 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Oder Chiou, Bard Liao, alsa-devel, Takashi Iwai


[-- Attachment #1.1: Type: text/plain, Size: 542 bytes --]

On Wed, Jan 03, 2018 at 12:01:38PM +0100, Hans de Goede wrote:

> Right, we have existing machines with a rt5645 and an internal
> analog mic, but those have been broken sofar (I can confirm
> this for Cherry Trail based devices, I assume it applies
> elsewhere) because without the next patch in this series we
> were never actually enabling micbias. So this change should be
> fine as analog mic support has been broken sofar anyways AFAIK.

Are you sure this also applies to non-x86 platforms?  This analysis
needs to be in the changelog.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
  2018-01-03 11:28       ` Mark Brown
@ 2018-01-03 11:32         ` Hans de Goede
  2018-01-03 11:36           ` Mark Brown
  0 siblings, 1 reply; 22+ messages in thread
From: Hans de Goede @ 2018-01-03 11:32 UTC (permalink / raw)
  To: Mark Brown; +Cc: Oder Chiou, Bard Liao, alsa-devel, Takashi Iwai

Hi,

On 03-01-18 12:28, Mark Brown wrote:
> On Wed, Jan 03, 2018 at 12:01:38PM +0100, Hans de Goede wrote:
> 
>> Right, we have existing machines with a rt5645 and an internal
>> analog mic, but those have been broken sofar (I can confirm
>> this for Cherry Trail based devices, I assume it applies
>> elsewhere) because without the next patch in this series we
>> were never actually enabling micbias. So this change should be
>> fine as analog mic support has been broken sofar anyways AFAIK.
> 
> Are you sure this also applies to non-x86 platforms?

I believe so, yes.

Bard, you've a rt5645 test board which does not use a x86 processor,
right? Can you confirm that the analog microphone input there does
not work with current kernels and needs your
"ASoC: rt5645: add micbias power control select." patch to work?

> This analysis
> needs to be in the changelog.

Ok I will send a v2 with the changelog ammended any comments for
the rest of the series?

Regards,

Hans

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
  2018-01-03 11:32         ` Hans de Goede
@ 2018-01-03 11:36           ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2018-01-03 11:36 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Oder Chiou, Bard Liao, alsa-devel, Takashi Iwai


[-- Attachment #1.1: Type: text/plain, Size: 241 bytes --]

On Wed, Jan 03, 2018 at 12:32:51PM +0100, Hans de Goede wrote:

> > This analysis
> > needs to be in the changelog.

> Ok I will send a v2 with the changelog ammended any comments for
> the rest of the series?

Please allow a few minutes...

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Applied "ASoC: Intel: cht_bsw_rt5645: Analog Mic support" to the asoc tree
  2018-01-02 18:53 ` [PATCH 6/6] ASoC: Intel: cht_bsw_rt5645: Analog Mic support Hans de Goede
@ 2018-01-03 12:12   ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2018-01-03 12:12 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Oder Chiou, Bard Liao, alsa-devel, Mark Brown, Takashi Iwai

The patch

   ASoC: Intel: cht_bsw_rt5645: Analog Mic support

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From b70b309950418437bbd2a30afd169c4f09dee3e5 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 2 Jan 2018 19:53:14 +0100
Subject: [PATCH] ASoC: Intel: cht_bsw_rt5645: Analog Mic support

Various Cherry Trail boards with a rt5645 codec have an analog mic
connected to IN2P + IN2N. The mic on this boards also needs micbias to
be enabled, on some boards micbias1 is used and on others micbias2, so
we enable both.

This commit adds a new "Int Analog Mic" DAPM widget for this, so that we
do not end up enabling micbias on boards with a digital mic which uses
the already present "Int Mic" widget. Some existing UCM files already
refer to "Int Mic" for their "Internal Analog Microphones" SectionDevice,
but these don't work anyways since they enable the RECMIX BST1 Switch
instead of the BST2 switch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/cht_bsw_rt5645.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 18d129caa974..f898ee140cdc 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -118,6 +118,7 @@ static const struct snd_soc_dapm_widget cht_dapm_widgets[] = {
 	SND_SOC_DAPM_HP("Headphone", NULL),
 	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 	SND_SOC_DAPM_MIC("Int Mic", NULL),
+	SND_SOC_DAPM_MIC("Int Analog Mic", NULL),
 	SND_SOC_DAPM_SPK("Ext Spk", NULL),
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
 			platform_clock_control, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
@@ -128,6 +129,8 @@ static const struct snd_soc_dapm_route cht_rt5645_audio_map[] = {
 	{"IN1N", NULL, "Headset Mic"},
 	{"DMIC L1", NULL, "Int Mic"},
 	{"DMIC R1", NULL, "Int Mic"},
+	{"IN2P", NULL, "Int Analog Mic"},
+	{"IN2N", NULL, "Int Analog Mic"},
 	{"Headphone", NULL, "HPOL"},
 	{"Headphone", NULL, "HPOR"},
 	{"Ext Spk", NULL, "SPOL"},
@@ -135,6 +138,9 @@ static const struct snd_soc_dapm_route cht_rt5645_audio_map[] = {
 	{"Headphone", NULL, "Platform Clock"},
 	{"Headset Mic", NULL, "Platform Clock"},
 	{"Int Mic", NULL, "Platform Clock"},
+	{"Int Analog Mic", NULL, "Platform Clock"},
+	{"Int Analog Mic", NULL, "micbias1"},
+	{"Int Analog Mic", NULL, "micbias2"},
 	{"Ext Spk", NULL, "Platform Clock"},
 };
 
@@ -189,6 +195,7 @@ static const struct snd_kcontrol_new cht_mc_controls[] = {
 	SOC_DAPM_PIN_SWITCH("Headphone"),
 	SOC_DAPM_PIN_SWITCH("Headset Mic"),
 	SOC_DAPM_PIN_SWITCH("Int Mic"),
+	SOC_DAPM_PIN_SWITCH("Int Analog Mic"),
 	SOC_DAPM_PIN_SWITCH("Ext Spk"),
 };
 
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "ASoC: rt5645: add platform data for the Teclast X80 Pro tablet" to the asoc tree
  2018-01-02 18:53 ` [PATCH 5/6] ASoC: rt5645: add platform data for the Teclast X80 Pro tablet Hans de Goede
@ 2018-01-03 12:12   ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2018-01-03 12:12 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Oder Chiou, Bard Liao, alsa-devel, Mark Brown, Takashi Iwai

The patch

   ASoC: rt5645: add platform data for the Teclast X80 Pro tablet

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From a249a95667f4f814b9b15f4b59049ffe68b5677f Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 2 Jan 2018 19:53:13 +0100
Subject: [PATCH] ASoC: rt5645: add platform data for the Teclast X80 Pro
 tablet

The Teclast X80 Pro tablet needs jd_mode = 3 for headset jack detection.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5645.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index df6cd5bd6a9f..daf7b73ba415 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3676,6 +3676,14 @@ static const struct dmi_system_id dmi_platform_data[] = {
 		},
 		.driver_data = (void *)&jd_mode3_platform_data,
 	},
+	{
+		.ident = "Teclast X80 Pro",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "X80 Pro"),
+		},
+		.driver_data = (void *)&jd_mode3_platform_data,
+	},
 	{ }
 };
 
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "ASoC: rt5645: cleanup DMI matching code" to the asoc tree
  2018-01-02 18:53 ` [PATCH 4/6] ASoC: rt5645: cleanup DMI matching code Hans de Goede
@ 2018-01-03 12:12   ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2018-01-03 12:12 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Oder Chiou, Bard Liao, alsa-devel, Mark Brown, Takashi Iwai

The patch

   ASoC: rt5645: cleanup DMI matching code

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 78f5605c0329f8b108a915a46032093628f6054b Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 2 Jan 2018 19:53:12 +0100
Subject: [PATCH] ASoC: rt5645: cleanup DMI matching code

Rather then doing a dmi_check_system() per possible system use an array
with all known systems, with dmi_system_id.driver_data pointing to the
platform-data for the matching system.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5645.c | 124 +++++++++++++++++++---------------------------
 1 file changed, 51 insertions(+), 73 deletions(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 6dd894c9f355..df6cd5bd6a9f 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3573,66 +3573,74 @@ static const struct acpi_device_id rt5645_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, rt5645_acpi_match);
 #endif
 
-static const struct rt5645_platform_data general_platform_data = {
+static const struct rt5645_platform_data intel_braswell_platform_data = {
 	.dmic1_data_pin = RT5645_DMIC1_DISABLE,
 	.dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
 	.jd_mode = 3,
 };
 
-static const struct dmi_system_id dmi_platform_intel_braswell[] = {
+static const struct rt5645_platform_data buddy_platform_data = {
+	.dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
+	.dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
+	.jd_mode = 3,
+	.level_trigger_irq = true,
+};
+
+static const struct rt5645_platform_data gpd_win_platform_data = {
+	.jd_mode = 3,
+	.inv_jd1_1 = true,
+	.long_name = "gpd-win-pocket-rt5645",
+	/* The GPD pocket has a diff. mic, for the win this does not matter. */
+	.in2_diff = true,
+};
+
+static const struct rt5645_platform_data asus_t100ha_platform_data = {
+	.dmic1_data_pin = RT5645_DMIC_DATA_IN2N,
+	.dmic2_data_pin = RT5645_DMIC2_DISABLE,
+	.jd_mode = 3,
+	.inv_jd1_1 = true,
+};
+
+static const struct rt5645_platform_data jd_mode3_platform_data = {
+	.jd_mode = 3,
+};
+
+static const struct dmi_system_id dmi_platform_data[] = {
+	{
+		.ident = "Chrome Buddy",
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "Buddy"),
+		},
+		.driver_data = (void *)&buddy_platform_data,
+	},
 	{
 		.ident = "Intel Strago",
 		.matches = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Strago"),
 		},
+		.driver_data = (void *)&intel_braswell_platform_data,
 	},
 	{
 		.ident = "Google Chrome",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
 		},
+		.driver_data = (void *)&intel_braswell_platform_data,
 	},
 	{
 		.ident = "Google Setzer",
 		.matches = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"),
 		},
+		.driver_data = (void *)&intel_braswell_platform_data,
 	},
 	{
 		.ident = "Microsoft Surface 3",
 		.matches = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"),
 		},
+		.driver_data = (void *)&intel_braswell_platform_data,
 	},
-	{ }
-};
-
-static const struct rt5645_platform_data buddy_platform_data = {
-	.dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
-	.dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
-	.jd_mode = 3,
-	.level_trigger_irq = true,
-};
-
-static const struct dmi_system_id dmi_platform_intel_broadwell[] = {
-	{
-		.ident = "Chrome Buddy",
-		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "Buddy"),
-		},
-	},
-	{ }
-};
-
-static const struct rt5645_platform_data gpd_win_platform_data = {
-	.jd_mode = 3,
-	.inv_jd1_1 = true,
-	.long_name = "gpd-win-pocket-rt5645",
-	/* The GPD pocket has a diff. mic, for the win this does not matter. */
-	.in2_diff = true,
-};
-
-static const struct dmi_system_id dmi_platform_gpd_win[] = {
 	{
 		/*
 		 * Match for the GPDwin which unfortunately uses somewhat
@@ -3643,61 +3651,34 @@ static const struct dmi_system_id dmi_platform_gpd_win[] = {
 		 * the same default product_name. Also the GPDwin is the
 		 * only device to have both board_ and product_name not set.
 		 */
-		.ident = "GPD Win",
+		.ident = "GPD Win / Pocket",
 		.matches = {
 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
 			DMI_MATCH(DMI_BOARD_NAME, "Default string"),
 			DMI_MATCH(DMI_BOARD_SERIAL, "Default string"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
 		},
+		.driver_data = (void *)&gpd_win_platform_data,
 	},
-	{}
-};
-
-static const struct rt5645_platform_data general_platform_data2 = {
-	.dmic1_data_pin = RT5645_DMIC_DATA_IN2N,
-	.dmic2_data_pin = RT5645_DMIC2_DISABLE,
-	.jd_mode = 3,
-	.inv_jd1_1 = true,
-};
-
-static const struct dmi_system_id dmi_platform_asus_t100ha[] = {
 	{
 		.ident = "ASUS T100HAN",
 		.matches = {
 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
 			DMI_MATCH(DMI_PRODUCT_NAME, "T100HAN"),
 		},
+		.driver_data = (void *)&asus_t100ha_platform_data,
 	},
-	{ }
-};
-
-static const struct rt5645_platform_data minix_z83_4_platform_data = {
-	.jd_mode = 3,
-};
-
-static const struct dmi_system_id dmi_platform_minix_z83_4[] = {
 	{
 		.ident = "MINIX Z83-4",
 		.matches = {
 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "MINIX"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
 		},
+		.driver_data = (void *)&jd_mode3_platform_data,
 	},
 	{ }
 };
 
-static bool rt5645_check_dp(struct device *dev)
-{
-	if (device_property_present(dev, "realtek,in2-differential") ||
-		device_property_present(dev, "realtek,dmic1-data-pin") ||
-		device_property_present(dev, "realtek,dmic2-data-pin") ||
-		device_property_present(dev, "realtek,jd-mode"))
-		return true;
-
-	return false;
-}
-
 static int rt5645_parse_dt(struct rt5645_priv *rt5645, struct device *dev)
 {
 	rt5645->pdata.in2_diff = device_property_read_bool(dev,
@@ -3716,6 +3697,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
 		    const struct i2c_device_id *id)
 {
 	struct rt5645_platform_data *pdata = dev_get_platdata(&i2c->dev);
+	const struct dmi_system_id *dmi_data;
 	struct rt5645_priv *rt5645;
 	int ret, i;
 	unsigned int val;
@@ -3729,20 +3711,16 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
 	rt5645->i2c = i2c;
 	i2c_set_clientdata(i2c, rt5645);
 
+	dmi_data = dmi_first_match(dmi_platform_data);
+	if (dmi_data) {
+		dev_info(&i2c->dev, "Detected %s platform\n", dmi_data->ident);
+		pdata = dmi_data->driver_data;
+	}
+
 	if (pdata)
 		rt5645->pdata = *pdata;
-	else if (dmi_check_system(dmi_platform_intel_broadwell))
-		rt5645->pdata = buddy_platform_data;
-	else if (rt5645_check_dp(&i2c->dev))
+	else
 		rt5645_parse_dt(rt5645, &i2c->dev);
-	else if (dmi_check_system(dmi_platform_intel_braswell))
-		rt5645->pdata = general_platform_data;
-	else if (dmi_check_system(dmi_platform_gpd_win))
-		rt5645->pdata = gpd_win_platform_data;
-	else if (dmi_check_system(dmi_platform_asus_t100ha))
-		rt5645->pdata = general_platform_data2;
-	else if (dmi_check_system(dmi_platform_minix_z83_4))
-		rt5645->pdata = minix_z83_4_platform_data;
 
 	if (quirk != -1) {
 		rt5645->pdata.in2_diff = QUIRK_IN2_DIFF(quirk);
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Applied "ASoC: rt5645: set in2_diff flag for GPD win and pocket devices" to the asoc tree
  2018-01-02 18:53 ` [PATCH 3/6] ASoC: rt5645: set in2_diff flag for GPD win and pocket devices Hans de Goede
@ 2018-01-03 12:13   ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2018-01-03 12:13 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Oder Chiou, Bard Liao, alsa-devel, Mark Brown, Takashi Iwai

The patch

   ASoC: rt5645: set in2_diff flag for GPD win and pocket devices

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 2dc6e1a4883a3eba451c76b726c23a580ed05307 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 2 Jan 2018 19:53:11 +0100
Subject: [PATCH] ASoC: rt5645: set in2_diff flag for GPD win and pocket
 devices

The GPD pocket has a differential signal microphone and needs in2_diff
to be set to avoid getting a very noisy signal.

Since the GPD pocket and win use the same DMI strings, they share their
platform data-definition, so enabling in2_diff on the pocket also sets
it on the GPD win. The GPD win has a normal microphone, but setting
in2_diff there does not negatively impact the sound from the microphone.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5645.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index a1a7bb770745..6dd894c9f355 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3628,6 +3628,8 @@ static const struct rt5645_platform_data gpd_win_platform_data = {
 	.jd_mode = 3,
 	.inv_jd1_1 = true,
 	.long_name = "gpd-win-pocket-rt5645",
+	/* The GPD pocket has a diff. mic, for the win this does not matter. */
+	.in2_diff = true,
 };
 
 static const struct dmi_system_id dmi_platform_gpd_win[] = {
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
  2018-01-03 10:50   ` Mark Brown
  2018-01-03 11:01     ` Hans de Goede
@ 2018-01-03 12:45     ` Bard Liao
       [not found]     ` <ABFD875FF5FB574BA706497D987D48D702756F3C@RTITMBSV02.realtek.com.tw>
  2 siblings, 0 replies; 22+ messages in thread
From: Bard Liao @ 2018-01-03 12:45 UTC (permalink / raw)
  To: Mark Brown, Hans de Goede; +Cc: Oder Chiou, alsa-devel, Takashi Iwai

> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: Wednesday, January 03, 2018 6:51 PM
> To: Hans de Goede
> Cc: Bard Liao; Oder Chiou; Takashi Iwai; alsa-devel@alsa-project.org
> Subject: Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
> 
> On Tue, Jan 02, 2018 at 07:53:09PM +0100, Hans de Goede wrote:
> 
> > Register "micbias1" and "micbias2" to supply widegts as modern drivers do.
> 
> > -	SND_SOC_DAPM_MICBIAS("micbias1", RT5645_PWR_ANLG2,
> > -			RT5645_PWR_MB1_BIT, 0),
> > -	SND_SOC_DAPM_MICBIAS("micbias2", RT5645_PWR_ANLG2,
> > -			RT5645_PWR_MB2_BIT, 0),
> > +	SND_SOC_DAPM_SUPPLY("micbias1", RT5645_PWR_ANLG2,
> > +			RT5645_PWR_MB1_BIT, 0, NULL, 0),
> > +	SND_SOC_DAPM_SUPPLY("micbias2", RT5645_PWR_ANLG2,
> > +			RT5645_PWR_MB2_BIT, 0, NULL, 0),
> 
> This is a good change to make but we have machines with the rt5645, are
> we sure none of them use microphones?  The two widget types work
> differently so it needs some checking and possibly machine driver
> updates to convert.

It's late today. I will check it tomorrow. I will send patches for
those machine driver and device tree which use rt5645 or rt5650
micbias.


> 
> ------Please consider the environment before printing this e-mail.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
       [not found]     ` <ABFD875FF5FB574BA706497D987D48D702756F3C@RTITMBSV02.realtek.com.tw>
@ 2018-01-04 10:53       ` Mark Brown
       [not found]         ` <ABFD875FF5FB574BA706497D987D48D7027574B8@RTITMBSV02.realtek.com.tw>
  0 siblings, 1 reply; 22+ messages in thread
From: Mark Brown @ 2018-01-04 10:53 UTC (permalink / raw)
  To: Bard Liao
  Cc: Oder Chiou, Hans de Goede, alsa-devel,
	Koro Chen (陳思翰),
	Takashi Iwai


[-- Attachment #1.1: Type: text/plain, Size: 419 bytes --]

On Thu, Jan 04, 2018 at 07:19:15AM +0000, Bard Liao wrote:

> I found mt8173 from mediatek is using rt5650 micbias.
> 	{"Headset Mic", NULL, "micbias1"},
> 	{"Headset Mic", NULL, "micbias2"},
> I think we should remove it but still need to verify.
> We are co-working with MTK folks on it and it may take some days.

That looks like normal supply usage for a micbias so most likely your
patch is a fix for them anyway.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
       [not found]         ` <ABFD875FF5FB574BA706497D987D48D7027574B8@RTITMBSV02.realtek.com.tw>
@ 2018-01-04 12:01           ` Mark Brown
       [not found]             ` <ABFD875FF5FB574BA706497D987D48D702757599@RTITMBSV02.realtek.com.tw>
  0 siblings, 1 reply; 22+ messages in thread
From: Mark Brown @ 2018-01-04 12:01 UTC (permalink / raw)
  To: Bard Liao
  Cc: Oder Chiou, Hans de Goede, alsa-devel,
	Koro Chen (陳思翰),
	Takashi Iwai


[-- Attachment #1.1: Type: text/plain, Size: 733 bytes --]

On Thu, Jan 04, 2018 at 11:14:40AM +0000, Bard Liao wrote:

> > > I found mt8173 from mediatek is using rt5650 micbias.
> > > 	{"Headset Mic", NULL, "micbias1"},
> > > 	{"Headset Mic", NULL, "micbias2"},
> > > I think we should remove it but still need to verify.
> > > We are co-working with MTK folks on it and it may take some days.

> > That looks like normal supply usage for a micbias so most likely your
> > patch is a fix for them anyway.

> Yes, it's supply usage for a micbias. So it didn't take effect with
> MICBIAS widget type. Actually, we don't need to set the micbias
> power bit for headset mic and we have verified it today. So, I will
> send a patch to remove them soon.

Are you sure that's likely to be helpful?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Applied "ASoC: rt5645: add micbias power control select." to the asoc tree
  2018-01-02 18:53 ` [PATCH 2/6] ASoC: rt5645: add micbias power control select Hans de Goede
@ 2018-01-04 12:37   ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2018-01-04 12:37 UTC (permalink / raw)
  To: Bard Liao; +Cc: Oder Chiou, Hans de Goede, alsa-devel, Mark Brown, Takashi Iwai

The patch

   ASoC: rt5645: add micbias power control select.

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From e61f3f31e5830f027d8eedb742bc48a9b3173699 Mon Sep 17 00:00:00 2001
From: Bard Liao <bardliao@realtek.com>
Date: Wed, 3 Jan 2018 13:39:02 +0100
Subject: [PATCH] ASoC: rt5645: add micbias power control select.

We need to set a corresponding control bit before powering micbias up.

Signed-off-by: Bard Liao <bardliao@realtek.com>
[hdegoede@redhat.com: Remove 2 unused variable declarations]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5645.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--
 sound/soc/codecs/rt5645.h |  6 +++++
 2 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 6f6da0abe220..fbaf36aeb587 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -1943,6 +1943,56 @@ static int rt5650_hp_event(struct snd_soc_dapm_widget *w,
 	return 0;
 }
 
+static int rt5645_set_micbias1_event(struct snd_soc_dapm_widget *w,
+		struct snd_kcontrol *k, int  event)
+{
+	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+			RT5645_MICBIAS1_POW_CTRL_SEL_MASK,
+			RT5645_MICBIAS1_POW_CTRL_SEL_M);
+		break;
+
+	case SND_SOC_DAPM_POST_PMD:
+		snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+			RT5645_MICBIAS1_POW_CTRL_SEL_MASK,
+			RT5645_MICBIAS1_POW_CTRL_SEL_A);
+		break;
+
+	default:
+		return 0;
+	}
+
+	return 0;
+}
+
+static int rt5645_set_micbias2_event(struct snd_soc_dapm_widget *w,
+		struct snd_kcontrol *k, int  event)
+{
+	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+			RT5645_MICBIAS2_POW_CTRL_SEL_MASK,
+			RT5645_MICBIAS2_POW_CTRL_SEL_M);
+		break;
+
+	case SND_SOC_DAPM_POST_PMD:
+		snd_soc_update_bits(codec, RT5645_GEN_CTRL2,
+			RT5645_MICBIAS2_POW_CTRL_SEL_MASK,
+			RT5645_MICBIAS2_POW_CTRL_SEL_A);
+		break;
+
+	default:
+		return 0;
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_dapm_widget rt5645_dapm_widgets[] = {
 	SND_SOC_DAPM_SUPPLY("LDO2", RT5645_PWR_MIXER,
 		RT5645_PWR_LDO2_BIT, 0, NULL, 0),
@@ -1981,9 +2031,11 @@ static const struct snd_soc_dapm_widget rt5645_dapm_widgets[] = {
 	/* Input Side */
 	/* micbias */
 	SND_SOC_DAPM_SUPPLY("micbias1", RT5645_PWR_ANLG2,
-			RT5645_PWR_MB1_BIT, 0, NULL, 0),
+			RT5645_PWR_MB1_BIT, 0, rt5645_set_micbias1_event,
+			SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
 	SND_SOC_DAPM_SUPPLY("micbias2", RT5645_PWR_ANLG2,
-			RT5645_PWR_MB2_BIT, 0, NULL, 0),
+			RT5645_PWR_MB2_BIT, 0, rt5645_set_micbias2_event,
+			SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
 	/* Input Lines */
 	SND_SOC_DAPM_INPUT("DMIC L1"),
 	SND_SOC_DAPM_INPUT("DMIC R1"),
diff --git a/sound/soc/codecs/rt5645.h b/sound/soc/codecs/rt5645.h
index cfc5f97549eb..940325b28c29 100644
--- a/sound/soc/codecs/rt5645.h
+++ b/sound/soc/codecs/rt5645.h
@@ -2117,6 +2117,12 @@ enum {
 #define RT5645_RXDC_SRC_STO			(0x0 << 7)
 #define RT5645_RXDC_SRC_MONO			(0x1 << 7)
 #define RT5645_RXDC_SRC_SFT			(7)
+#define RT5645_MICBIAS1_POW_CTRL_SEL_MASK	(0x1 << 5)
+#define RT5645_MICBIAS1_POW_CTRL_SEL_A		(0x0 << 5)
+#define RT5645_MICBIAS1_POW_CTRL_SEL_M		(0x1 << 5)
+#define RT5645_MICBIAS2_POW_CTRL_SEL_MASK	(0x1 << 4)
+#define RT5645_MICBIAS2_POW_CTRL_SEL_A		(0x0 << 4)
+#define RT5645_MICBIAS2_POW_CTRL_SEL_M		(0x1 << 4)
 #define RT5645_RXDP2_SEL_MASK			(0x1 << 3)
 #define RT5645_RXDP2_SEL_IF2			(0x0 << 3)
 #define RT5645_RXDP2_SEL_ADC			(0x1 << 3)
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply.
       [not found]             ` <ABFD875FF5FB574BA706497D987D48D702757599@RTITMBSV02.realtek.com.tw>
@ 2018-01-04 12:41               ` Mark Brown
  0 siblings, 0 replies; 22+ messages in thread
From: Mark Brown @ 2018-01-04 12:41 UTC (permalink / raw)
  To: Bard Liao
  Cc: Oder Chiou, Hans de Goede, alsa-devel,
	Koro Chen (陳思翰),
	Takashi Iwai


[-- Attachment #1.1: Type: text/plain, Size: 922 bytes --]

On Thu, Jan 04, 2018 at 12:20:06PM +0000, Bard Liao wrote:

> > > Yes, it's supply usage for a micbias. So it didn't take effect with
> > > MICBIAS widget type. Actually, we don't need to set the micbias
> > > power bit for headset mic and we have verified it today. So, I will
> > > send a patch to remove them soon.

> > Are you sure that's likely to be helpful?

> Yes, I checked the register dump and the micbias power bits are
> not set. The register settings will be the same if we remove it,
> and it is verified. On the other hand, the micbias power bits will
> be set and the micbias_event will be invoked after we convert the
> micbias widget type to SUPPLY if we don't remove it.

But are you sure that this was working properly for the Mediatek systems
previously and your and Hans' patches don't actually fix a bug for them
too?  If that's the case then removing the supply hookup would cause a
bug for them.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2018-01-04 12:41 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-02 18:53 [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede
2018-01-02 18:53 ` [PATCH 1/6] ASoC: rt5645: change micbias widget type to supply Hans de Goede
2018-01-03 10:50   ` Mark Brown
2018-01-03 11:01     ` Hans de Goede
2018-01-03 11:28       ` Mark Brown
2018-01-03 11:32         ` Hans de Goede
2018-01-03 11:36           ` Mark Brown
2018-01-03 12:45     ` Bard Liao
     [not found]     ` <ABFD875FF5FB574BA706497D987D48D702756F3C@RTITMBSV02.realtek.com.tw>
2018-01-04 10:53       ` Mark Brown
     [not found]         ` <ABFD875FF5FB574BA706497D987D48D7027574B8@RTITMBSV02.realtek.com.tw>
2018-01-04 12:01           ` Mark Brown
     [not found]             ` <ABFD875FF5FB574BA706497D987D48D702757599@RTITMBSV02.realtek.com.tw>
2018-01-04 12:41               ` Mark Brown
2018-01-02 18:53 ` [PATCH 2/6] ASoC: rt5645: add micbias power control select Hans de Goede
2018-01-04 12:37   ` Applied "ASoC: rt5645: add micbias power control select." to the asoc tree Mark Brown
2018-01-02 18:53 ` [PATCH 3/6] ASoC: rt5645: set in2_diff flag for GPD win and pocket devices Hans de Goede
2018-01-03 12:13   ` Applied "ASoC: rt5645: set in2_diff flag for GPD win and pocket devices" to the asoc tree Mark Brown
2018-01-02 18:53 ` [PATCH 4/6] ASoC: rt5645: cleanup DMI matching code Hans de Goede
2018-01-03 12:12   ` Applied "ASoC: rt5645: cleanup DMI matching code" to the asoc tree Mark Brown
2018-01-02 18:53 ` [PATCH 5/6] ASoC: rt5645: add platform data for the Teclast X80 Pro tablet Hans de Goede
2018-01-03 12:12   ` Applied "ASoC: rt5645: add platform data for the Teclast X80 Pro tablet" to the asoc tree Mark Brown
2018-01-02 18:53 ` [PATCH 6/6] ASoC: Intel: cht_bsw_rt5645: Analog Mic support Hans de Goede
2018-01-03 12:12   ` Applied "ASoC: Intel: cht_bsw_rt5645: Analog Mic support" to the asoc tree Mark Brown
2018-01-02 18:56 ` [PATCH 0/6] ASoC: rt5645: Analog microphone fixes Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.