Skip to contentSkip to conversation

ASoC: rt5651: Various fixes and quirks

PATCH In review Hans de Goede 4 participants 24 messages Jul 18, 2018 – Dec 24, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ASoC: rt5651: Various fixes and quirks

Hi All,

Here is my last (big) round of (Intel) rt5651 support updates, with these patches combined with the updated, matching UCM profiles from here:
https://github.com/jwrdegoede/alsa-lib/commits/master

All 7 different devices I have work 100% OOTB, without requiring any manual config or mixer setup. After this there should be no more big changes.

I will submit the matching alsa-lib UCM profile changes upstream once this set is in -next (and thus I can be sure the long-names will not change due to review).

Note that unfortunately my previous round of cleanup patches removed 1 input mapping (of the 3 mappings in total it removed) which is actually necessary. So this series re-introduces that 1 mapping. I did not notice this before because UCM input profile switching does not work reliably for some reason, something which I still need to investigate. This time I manually veryfied that the correct / expected mixer settings where used while testing.

Regards,

Hans

#1 lore raw

PATCH 1/6 ASoC: rt5651: Add IN3 Boost volume control

Add a mixer control for the IN3 Boost volume, IN3 is used for the headset mic on most devices, so this is necessary to control the headset mic volume.

---
 sound/soc/codecs/rt5651.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/codecs/rt5651.c +3 -1
index 0462049e739c..985852fd9723 100644
@@ -331,11 +331,13 @@ static const struct snd_kcontrol_new rt5651_snd_controls[] = {
 	SOC_DOUBLE_TLV("Mono DAC Playback Volume", RT5651_DAC2_DIG_VOL,
 			RT5651_L_VOL_SFT, RT5651_R_VOL_SFT,
 			175, 0, dac_vol_tlv),
-	/* IN1/IN2 Control */
+	/* IN1/IN2/IN3 Control */
 	SOC_SINGLE_TLV("IN1 Boost", RT5651_IN1_IN2,
 		RT5651_BST_SFT1, 8, 0, bst_tlv),
 	SOC_SINGLE_TLV("IN2 Boost", RT5651_IN1_IN2,
 		RT5651_BST_SFT2, 8, 0, bst_tlv),
+	SOC_SINGLE_TLV("IN3 Boost", RT5651_IN3,
+		RT5651_BST_SFT1, 8, 0, bst_tlv),
 	/* INL/INR Volume Control */
 	SOC_DOUBLE_TLV("IN Capture Volume", RT5651_INL1_INR1_VOL,
 			RT5651_INL_VOL_SFT, RT5651_INR_VOL_SFT,
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

sound/soc/codecs/rt5651.c static const struct snd_kcontrol_new rt5651_snd_controls[] = { · line 340

Quoted 7 lines · Hans de Goede
sound/soc/codecs/rt5651.c +3 -0
+	/* IN1/IN2/IN3 Control */
 	SOC_SINGLE_TLV("IN1 Boost", RT5651_IN1_IN2,
 		RT5651_BST_SFT1, 8, 0, bst_tlv),
 	SOC_SINGLE_TLV("IN2 Boost", RT5651_IN1_IN2,
 		RT5651_BST_SFT2, 8, 0, bst_tlv),
+	SOC_SINGLE_TLV("IN3 Boost", RT5651_IN3,
+		RT5651_BST_SFT1, 8, 0, bst_tlv),

These should all have Volume added to the name however that's a preexisting bug so not a blocker on this.

#3 lore raw

Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

Quoted 10 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Thursday, July 19, 2018 11:03 PM
To: Hans de Goede
Cc: Liam Girdwood; Bard Liao; Oder Chiou; Pierre-Louis Bossart; Carlo Caione; [email protected]
Subject: Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

On Wed, Jul 18, 2018 at 10:55:37PM +0200, Hans de Goede wrote:

Quoted 10 lines

sound/soc/codecs/rt5651.c static const struct snd_kcontrol_new rt5651_snd_controls[] = { · line 340

Quoted 7 lines
sound/soc/codecs/rt5651.c +3 -0
+	/* IN1/IN2/IN3 Control */
 	SOC_SINGLE_TLV("IN1 Boost", RT5651_IN1_IN2,
 		RT5651_BST_SFT1, 8, 0, bst_tlv),
 	SOC_SINGLE_TLV("IN2 Boost", RT5651_IN1_IN2,
 		RT5651_BST_SFT2, 8, 0, bst_tlv),
+	SOC_SINGLE_TLV("IN3 Boost", RT5651_IN3,
+		RT5651_BST_SFT1, 8, 0, bst_tlv),

These should all have Volume added to the name however that's a preexisting bug so not a blocker on this.

I will add "Volume" to the name for all of them.

Quoted 2 lines

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

#4 lore raw

Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

Quoted 19 lines · Bard Liao
Quoted 10 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Thursday, July 19, 2018 11:03 PM
To: Hans de Goede
Cc: Liam Girdwood; Bard Liao; Oder Chiou; Pierre-Louis Bossart; Carlo Caione; [email protected]
Subject: Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

On Wed, Jul 18, 2018 at 10:55:37PM +0200, Hans de Goede wrote:

Quoted 9 lines

sound/soc/codecs/rt5651.c static const struct snd_kcontrol_new rt5651_snd_controls[] = { · line 340

Quoted 7 lines
sound/soc/codecs/rt5651.c +3 -0
+	/* IN1/IN2/IN3 Control */
  	SOC_SINGLE_TLV("IN1 Boost", RT5651_IN1_IN2,
  		RT5651_BST_SFT1, 8, 0, bst_tlv),
  	SOC_SINGLE_TLV("IN2 Boost", RT5651_IN1_IN2,
  		RT5651_BST_SFT2, 8, 0, bst_tlv),
+	SOC_SINGLE_TLV("IN3 Boost", RT5651_IN3,
+		RT5651_BST_SFT1, 8, 0, bst_tlv),

These should all have Volume added to the name however that's a preexisting bug so not a blocker on this.

Quoted 1 line

I will add "Volume" to the name for all of them.

isn't this going to break userspace configs if we change the name of controls?

#5 lore raw

Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

Quoted 29 lines

-----Original Message-----
From: Pierre-Louis Bossart [mailto:[email protected]]
Sent: Friday, July 20, 2018 9:40 AM
To: Bard Liao; Mark Brown; Hans de Goede
Cc: Liam Girdwood; Oder Chiou; [email protected]; Carlo Caione
Subject: Re: [alsa-devel] [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

Quoted 5 lines · Bard Liao
Quoted 5 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Thursday, July 19, 2018 11:03 PM
To: Hans de Goede
Cc: Liam Girdwood; Bard Liao; Oder Chiou; Pierre-Louis Bossart; Carlo

Caione;

Quoted 14 lines
Quoted 14 lines

[email protected]
Subject: Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

sound/soc/codecs/rt5651.c static const struct snd_kcontrol_new rt5651_snd_controls[] = { · line 340

Quoted 7 lines · Hans de Goede
sound/soc/codecs/rt5651.c +3 -0
+	/* IN1/IN2/IN3 Control */
  	SOC_SINGLE_TLV("IN1 Boost", RT5651_IN1_IN2,
  		RT5651_BST_SFT1, 8, 0, bst_tlv),
  	SOC_SINGLE_TLV("IN2 Boost", RT5651_IN1_IN2,
  		RT5651_BST_SFT2, 8, 0, bst_tlv),
+	SOC_SINGLE_TLV("IN3 Boost", RT5651_IN3,
+		RT5651_BST_SFT1, 8, 0, bst_tlv),

These should all have Volume added to the name however that's a preexisting bug so not a blocker on this.

Quoted 3 lines
Quoted 1 line

I will add "Volume" to the name for all of them.

isn't this going to break userspace configs if we change the name of controls?

Yes, it should be modified, too.

Quoted 2 lines

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

#6 lore raw

Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

Hi,

Quoted 29 lines · Bard Liao
Quoted 29 lines

-----Original Message-----
From: Pierre-Louis Bossart [mailto:[email protected]]
Sent: Friday, July 20, 2018 9:40 AM
To: Bard Liao; Mark Brown; Hans de Goede
Cc: Liam Girdwood; Oder Chiou; [email protected]; Carlo Caione
Subject: Re: [alsa-devel] [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

Quoted 5 lines · Bard Liao
Quoted 5 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Thursday, July 19, 2018 11:03 PM
To: Hans de Goede
Cc: Liam Girdwood; Bard Liao; Oder Chiou; Pierre-Louis Bossart; Carlo

Caione;

Quoted 14 lines
Quoted 14 lines

[email protected]
Subject: Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

sound/soc/codecs/rt5651.c static const struct snd_kcontrol_new rt5651_snd_controls[] = { · line 340

Quoted 7 lines · Hans de Goede
sound/soc/codecs/rt5651.c +3 -0
+	/* IN1/IN2/IN3 Control */
   	SOC_SINGLE_TLV("IN1 Boost", RT5651_IN1_IN2,
   		RT5651_BST_SFT1, 8, 0, bst_tlv),
   	SOC_SINGLE_TLV("IN2 Boost", RT5651_IN1_IN2,
   		RT5651_BST_SFT2, 8, 0, bst_tlv),
+	SOC_SINGLE_TLV("IN3 Boost", RT5651_IN3,
+		RT5651_BST_SFT1, 8, 0, bst_tlv),

These should all have Volume added to the name however that's a preexisting bug so not a blocker on this.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I will add "Volume" to the name for all of them.

isn't this going to break userspace configs if we change the name of controls?

Yes, it should be modified, too.

Or we just live with the "Volume" part missing for these 3 and don't break users existing setup for no good reason.

Regards,

Hans

#7 lore raw

Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

Quoted 8 lines

-----Original Message-----
From: Hans de Goede [mailto:[email protected]]
Sent: Friday, July 27, 2018 8:02 PM
To: Bard Liao; Pierre-Louis Bossart; Mark Brown
Cc: Liam Girdwood; Oder Chiou; [email protected]; Carlo Caione
Subject: Re: [alsa-devel] [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

isn't this going to break userspace configs if we change the name of controls?

Yes, it should be modified, too.

Or we just live with the "Volume" part missing for these 3 and don't break users existing setup for no good reason.

Agree.

Quoted 6 lines

Regards,

Hans

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

maintainer
#8 lore raw

Re: [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control

In reply to Hans de Goede
Quoted 4 lines · Hans de Goede
Quoted 1 line

Yes, it should be modified, too.

Or we just live with the "Volume" part missing for these 3 and don't break users existing setup for no good reason.

You're a few days behind the discussion on the patch series doing this...

maintainer
#9 lore raw

Applied "ASoC: rt5651: Add IN3 Boost volume control" to the asoc tree

In reply to Hans de Goede

The patch

ASoC: rt5651: Add IN3 Boost volume control

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

Quoted 1 line

From eea1662525bd4a158a67ac836b2a1fd9cf77cc81 Mon Sep 17 00:00:00 2001

From: Hans de Goede <[email protected]>
Date: Wed, 18 Jul 2018 22:55:37 +0200
Subject: [PATCH] ASoC: rt5651: Add IN3 Boost volume control

Add a mixer control for the IN3 Boost volume, IN3 is used for the headset mic on most devices, so this is necessary to control the headset mic volume.

---
 sound/soc/codecs/rt5651.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/codecs/rt5651.c +3 -1
index 0462049e739c..985852fd9723 100644
@@ -331,11 +331,13 @@ static const struct snd_kcontrol_new rt5651_snd_controls[] = {
 	SOC_DOUBLE_TLV("Mono DAC Playback Volume", RT5651_DAC2_DIG_VOL,
 			RT5651_L_VOL_SFT, RT5651_R_VOL_SFT,
 			175, 0, dac_vol_tlv),
-	/* IN1/IN2 Control */
+	/* IN1/IN2/IN3 Control */
 	SOC_SINGLE_TLV("IN1 Boost", RT5651_IN1_IN2,
 		RT5651_BST_SFT1, 8, 0, bst_tlv),
 	SOC_SINGLE_TLV("IN2 Boost", RT5651_IN1_IN2,
 		RT5651_BST_SFT2, 8, 0, bst_tlv),
+	SOC_SINGLE_TLV("IN3 Boost", RT5651_IN3,
+		RT5651_BST_SFT1, 8, 0, bst_tlv),
 	/* INL/INR Volume Control */
 	SOC_DOUBLE_TLV("IN Capture Volume", RT5651_INL1_INR1_VOL,
 			RT5651_INL_VOL_SFT, RT5651_INR_VOL_SFT,
Signature · 1 line
2.18.0
#10 lore raw

PATCH 2/6 ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the ext-amp on some boards

In reply to Hans de Goede

Some boards have I2cSerialBusV2, GpioIo, GpioInt as ACPI resources, other boards may have I2cSerialBusV2, GpioInt, GpioIo instead. We want the GpioIo one for the ext-amp-enable-gpio.

So far we've been assuming that the GpioIo one always comes first, this commit adds code to detect which one comes first and to add the right gpio-mapping.

This fixes sound not working on the Vios LTH17 laptop.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 69 +++++++++++++++++++++++++--
 1 file changed, 65 insertions(+), 4 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +65 -4
index b687043c8425..601e47c33ba8 100644
@@ -747,13 +747,74 @@ static const struct x86_cpu_id cherrytrail_cpu_ids[] = {
 	{}
 };
 
-static const struct acpi_gpio_params ext_amp_enable_gpios = { 0, 0, false };
+static const struct acpi_gpio_params first_gpio = { 0, 0, false };
+static const struct acpi_gpio_params second_gpio = { 1, 0, false };
 
-static const struct acpi_gpio_mapping byt_rt5651_gpios[] = {
-	{ "ext-amp-enable-gpios", &ext_amp_enable_gpios, 1 },
+static const struct acpi_gpio_mapping byt_rt5651_amp_en_first[] = {
+	{ "ext-amp-enable-gpios", &first_gpio, 1 },
 	{ },
 };
 
+static const struct acpi_gpio_mapping byt_rt5651_amp_en_second[] = {
+	{ "ext-amp-enable-gpios", &second_gpio, 1 },
+	{ },
+};
+
+/*
+ * Some boards have I2cSerialBusV2, GpioIo, GpioInt as ACPI resources, other
+ * boards may  have I2cSerialBusV2, GpioInt, GpioIo instead. We want the
+ * GpioIo one for the ext-amp-enable-gpio and both count for the index in
+ * acpi_gpio_params index.  So we have 2 different mappings and the code
+ * below figures out which one to use.
+ */
+struct byt_rt5651_acpi_resource_data {
+	int gpio_count;
+	int gpio_int_idx;
+};
+
+static int snd_byt_rt5651_acpi_resource(struct acpi_resource *ares, void *arg)
+{
+	struct byt_rt5651_acpi_resource_data *data = arg;
+
+	if (ares->type != ACPI_RESOURCE_TYPE_GPIO)
+		return 0;
+
+	if (ares->data.gpio.connection_type == ACPI_RESOURCE_GPIO_TYPE_INT)
+		data->gpio_int_idx = data->gpio_count;
+
+	data->gpio_count++;
+	return 0;
+}
+
+static void snd_byt_rt5651_mc_add_amp_en_gpio_mapping(struct device *codec)
+{
+	struct byt_rt5651_acpi_resource_data data = { 0, -1 };
+	LIST_HEAD(resources);
+	int ret;
+
+	ret = acpi_dev_get_resources(ACPI_COMPANION(codec), &resources,
+				     snd_byt_rt5651_acpi_resource, &data);
+	if (ret < 0) {
+		dev_warn(codec, "Failed to get ACPI resources, not adding external amplifier GPIO mapping\n");
+		return;
+	}
+
+	/* All info we need is gathered during the walk */
+	acpi_dev_free_resource_list(&resources);
+
+	switch (data.gpio_int_idx) {
+	case 0:
+		devm_acpi_dev_add_driver_gpios(codec, byt_rt5651_amp_en_second);
+		break;
+	case 1:
+		devm_acpi_dev_add_driver_gpios(codec, byt_rt5651_amp_en_first);
+		break;
+	default:
+		dev_warn(codec, "Unknown GpioInt index %d, not adding external amplifier GPIO mapping\n",
+			 data.gpio_int_idx);
+	}
+}
+
 struct acpi_chan_package {   /* ACPICA seems to require 64 bit integers */
 	u64 aif_value;       /* 1: AIF1, 2: AIF2 */
 	u64 mclock_value;    /* usually 25MHz (0x17d7940), ignored */
@@ -876,7 +937,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
 
 	/* Cherry Trail devices use an external amplifier enable gpio */
 	if (x86_match_cpu(cherrytrail_cpu_ids)) {
-		devm_acpi_dev_add_driver_gpios(codec_dev, byt_rt5651_gpios);
+		snd_byt_rt5651_mc_add_amp_en_gpio_mapping(codec_dev);
 		priv->ext_amp_gpio = devm_fwnode_get_index_gpiod_from_child(
 						&pdev->dev, "ext-amp-enable", 0,
 						codec_dev->fwnode,
Signature · 1 line
2.17.1
maintainer
#11 lore raw

Applied "ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the ext-amp on some boards" to the asoc tree

The patch

ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the ext-amp on some boards

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

Quoted 1 line

From 0a3badd141f78535315cca9ff5062a7ebf414281 Mon Sep 17 00:00:00 2001

From: Hans de Goede <[email protected]>
Date: Wed, 18 Jul 2018 22:55:38 +0200
Subject: [PATCH] ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the
ext-amp on some boards

Some boards have I2cSerialBusV2, GpioIo, GpioInt as ACPI resources, other boards may have I2cSerialBusV2, GpioInt, GpioIo instead. We want the GpioIo one for the ext-amp-enable-gpio.

So far we've been assuming that the GpioIo one always comes first, this commit adds code to detect which one comes first and to add the right gpio-mapping.

This fixes sound not working on the Vios LTH17 laptop.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 69 +++++++++++++++++++++++++--
 1 file changed, 65 insertions(+), 4 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +65 -4
index b687043c8425..601e47c33ba8 100644
@@ -747,13 +747,74 @@ static const struct x86_cpu_id cherrytrail_cpu_ids[] = {
 	{}
 };
 
-static const struct acpi_gpio_params ext_amp_enable_gpios = { 0, 0, false };
+static const struct acpi_gpio_params first_gpio = { 0, 0, false };
+static const struct acpi_gpio_params second_gpio = { 1, 0, false };
 
-static const struct acpi_gpio_mapping byt_rt5651_gpios[] = {
-	{ "ext-amp-enable-gpios", &ext_amp_enable_gpios, 1 },
+static const struct acpi_gpio_mapping byt_rt5651_amp_en_first[] = {
+	{ "ext-amp-enable-gpios", &first_gpio, 1 },
 	{ },
 };
 
+static const struct acpi_gpio_mapping byt_rt5651_amp_en_second[] = {
+	{ "ext-amp-enable-gpios", &second_gpio, 1 },
+	{ },
+};
+
+/*
+ * Some boards have I2cSerialBusV2, GpioIo, GpioInt as ACPI resources, other
+ * boards may  have I2cSerialBusV2, GpioInt, GpioIo instead. We want the
+ * GpioIo one for the ext-amp-enable-gpio and both count for the index in
+ * acpi_gpio_params index.  So we have 2 different mappings and the code
+ * below figures out which one to use.
+ */
+struct byt_rt5651_acpi_resource_data {
+	int gpio_count;
+	int gpio_int_idx;
+};
+
+static int snd_byt_rt5651_acpi_resource(struct acpi_resource *ares, void *arg)
+{
+	struct byt_rt5651_acpi_resource_data *data = arg;
+
+	if (ares->type != ACPI_RESOURCE_TYPE_GPIO)
+		return 0;
+
+	if (ares->data.gpio.connection_type == ACPI_RESOURCE_GPIO_TYPE_INT)
+		data->gpio_int_idx = data->gpio_count;
+
+	data->gpio_count++;
+	return 0;
+}
+
+static void snd_byt_rt5651_mc_add_amp_en_gpio_mapping(struct device *codec)
+{
+	struct byt_rt5651_acpi_resource_data data = { 0, -1 };
+	LIST_HEAD(resources);
+	int ret;
+
+	ret = acpi_dev_get_resources(ACPI_COMPANION(codec), &resources,
+				     snd_byt_rt5651_acpi_resource, &data);
+	if (ret < 0) {
+		dev_warn(codec, "Failed to get ACPI resources, not adding external amplifier GPIO mapping\n");
+		return;
+	}
+
+	/* All info we need is gathered during the walk */
+	acpi_dev_free_resource_list(&resources);
+
+	switch (data.gpio_int_idx) {
+	case 0:
+		devm_acpi_dev_add_driver_gpios(codec, byt_rt5651_amp_en_second);
+		break;
+	case 1:
+		devm_acpi_dev_add_driver_gpios(codec, byt_rt5651_amp_en_first);
+		break;
+	default:
+		dev_warn(codec, "Unknown GpioInt index %d, not adding external amplifier GPIO mapping\n",
+			 data.gpio_int_idx);
+	}
+}
+
 struct acpi_chan_package {   /* ACPICA seems to require 64 bit integers */
 	u64 aif_value;       /* 1: AIF1, 2: AIF2 */
 	u64 mclock_value;    /* usually 25MHz (0x17d7940), ignored */
@@ -876,7 +937,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
 
 	/* Cherry Trail devices use an external amplifier enable gpio */
 	if (x86_match_cpu(cherrytrail_cpu_ids)) {
-		devm_acpi_dev_add_driver_gpios(codec_dev, byt_rt5651_gpios);
+		snd_byt_rt5651_mc_add_amp_en_gpio_mapping(codec_dev);
 		priv->ext_amp_gpio = devm_fwnode_get_index_gpiod_from_child(
 						&pdev->dev, "ext-amp-enable", 0,
 						codec_dev->fwnode,
Signature · 1 line
2.18.0
#12 lore raw

PATCH 3/6 ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to 2000uA

In reply to Hans de Goede

With the default over current detect limit of 1500uA headsets on often get detected as headphones on the VIOS LTH17 and even when detected as headset the OVCD current triggers often while plugged in, resulting in false-positive button press detection.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +5 -2
index 601e47c33ba8..53ac97c15fc6 100644
@@ -414,8 +414,11 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "VIOS"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "LTH17"),
 		},
-		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
-					BYT_RT5651_IN1_IN2_MAP),
+		.driver_data = (void *)(BYT_RT5651_IN1_IN2_MAP |
+					BYT_RT5651_JD1_1 |
+					BYT_RT5651_OVCD_TH_2000UA |
+					BYT_RT5651_OVCD_SF_1P0 |
+					BYT_RT5651_MCLK_EN),
 	},
 	{}
 };
Signature · 1 line
2.17.1
maintainer
#13 lore raw

Applied "ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to 2000uA" to the asoc tree

The patch

ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to 2000uA

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

Quoted 1 line

From 8627fb257e1673d2c2277494545642921097da86 Mon Sep 17 00:00:00 2001

From: Hans de Goede <[email protected]>
Date: Wed, 18 Jul 2018 22:55:39 +0200
Subject: [PATCH] ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to
2000uA

With the default over current detect limit of 1500uA headsets on often get detected as headphones on the VIOS LTH17 and even when detected as headset the OVCD current triggers often while plugged in, resulting in false-positive button press detection.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +5 -2
index 601e47c33ba8..53ac97c15fc6 100644
@@ -414,8 +414,11 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "VIOS"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "LTH17"),
 		},
-		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
-					BYT_RT5651_IN1_IN2_MAP),
+		.driver_data = (void *)(BYT_RT5651_IN1_IN2_MAP |
+					BYT_RT5651_JD1_1 |
+					BYT_RT5651_OVCD_TH_2000UA |
+					BYT_RT5651_OVCD_SF_1P0 |
+					BYT_RT5651_MCLK_EN),
 	},
 	{}
 };
Signature · 1 line
2.18.0
#14 lore raw

PATCH 4/6 ASoC: Intel: bytcr_rt5651: Add IN2 input mapping

In reply to Hans de Goede

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.

---
Note I have put getting to the bottom of the UCM input device switching code and fixing it on my TODO list

---
 sound/soc/intel/boards/bytcr_rt5651.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +18 -5
index 53ac97c15fc6..d85530b1cc8e 100644
@@ -44,6 +44,7 @@
 enum {
 	BYT_RT5651_DMIC_MAP,
 	BYT_RT5651_IN1_MAP,
+	BYT_RT5651_IN2_MAP,
 	BYT_RT5651_IN1_IN2_MAP,
 };
 
@@ -93,9 +94,9 @@ struct byt_rt5651_private {
 	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 |
-					BYT_RT5651_IN1_MAP;
+					BYT_RT5651_IN2_MAP;
 
 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");
 	if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_MAP)
 		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)
 		dev_info(dev, "quirk IN1_IN2_MAP enabled");
 	if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) {
@@ -270,6 +273,12 @@ static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = {
 	{"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[] = {
 	{"Internal Mic", NULL, "micbias1"},
 	{"IN1P", NULL, "Internal Mic"},
@@ -364,7 +373,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
 		},
 		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
-					BYT_RT5651_IN1_MAP |
+					BYT_RT5651_IN2_MAP |
 					BYT_RT5651_HP_LR_SWAPPED),
 	},
 	{
@@ -375,7 +384,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "D2D3_Vi8A1"),
 		},
 		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
-					BYT_RT5651_IN1_MAP |
+					BYT_RT5651_IN2_MAP |
 					BYT_RT5651_HP_LR_SWAPPED),
 	},
 	{
@@ -468,6 +477,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
 		custom_map = byt_rt5651_intmic_in1_map;
 		num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_map);
 		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:
 		custom_map = 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 */
 
 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 snd_soc_acpi_mach *mach;
 	struct device *codec_dev;
Signature · 1 line
2.17.1
#15 lore raw

Re: [PATCH 4/6] ASoC: Intel: bytcr_rt5651: Add IN2 input mapping

Quoted 11 lines · Hans de Goede

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.

I am getting dizzy :-)
is the conclusion that hs==IN3 (no change) and int-mic==(DMIC, IN1, IN2, IN12) and the UCM names only use the latter for differentiation of profiles?

Quoted 96 lines

This commit also changes the default internal mic input to IN2, because all my 7 test devices have their mic there.

---
Note I have put getting to the bottom of the UCM input device switching code and fixing it on my TODO list

---
  sound/soc/intel/boards/bytcr_rt5651.c | 23 ++++++++++++++++++-----
  1 file changed, 18 insertions(+), 5 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +18 -5
index 53ac97c15fc6..d85530b1cc8e 100644
@@ -44,6 +44,7 @@
  enum {
  	BYT_RT5651_DMIC_MAP,
  	BYT_RT5651_IN1_MAP,
+	BYT_RT5651_IN2_MAP,
  	BYT_RT5651_IN1_IN2_MAP,
  };
 
@@ -93,9 +94,9 @@ struct byt_rt5651_private {
  	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 |
-					BYT_RT5651_IN1_MAP;
+					BYT_RT5651_IN2_MAP;
 
  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");
  	if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_MAP)
  		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)
  		dev_info(dev, "quirk IN1_IN2_MAP enabled");
  	if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) {
@@ -270,6 +273,12 @@ static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = {
  	{"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[] = {
  	{"Internal Mic", NULL, "micbias1"},
  	{"IN1P", NULL, "Internal Mic"},
@@ -364,7 +373,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
  			DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
  		},
  		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
-					BYT_RT5651_IN1_MAP |
+					BYT_RT5651_IN2_MAP |
  					BYT_RT5651_HP_LR_SWAPPED),
  	},
  	{
@@ -375,7 +384,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
  			DMI_MATCH(DMI_PRODUCT_NAME, "D2D3_Vi8A1"),
  		},
  		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
-					BYT_RT5651_IN1_MAP |
+					BYT_RT5651_IN2_MAP |
  					BYT_RT5651_HP_LR_SWAPPED),
  	},
  	{
@@ -468,6 +477,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
  		custom_map = byt_rt5651_intmic_in1_map;
  		num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_map);
  		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:
  		custom_map = 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 */
 
  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 snd_soc_acpi_mach *mach;
  	struct device *codec_dev;
#16 lore raw

Re: [PATCH 4/6] ASoC: Intel: bytcr_rt5651: Add IN2 input mapping

Hi,

Quoted 11 lines · Pierre-Louis Bossart
Quoted 8 lines · Hans de Goede

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.

Quoted 5 lines
Quoted 3 lines

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.

I am getting dizzy :-)
is the conclusion that hs==IN3 (no change) and int-mic==(DMIC, IN1, IN2, IN12)

Yes that is the conclusion. Sorry about this, as said my previous testing was wrong because of an userspace bug (which I still need to track down).

Quoted 1 line

and the UCM names only use the latter for differentiation of profiles?

Correct. This pretty much fully aligns the rt5651 code with the rt5640 code wrt long-names.

Regards,

Hans

Quoted 84 lines
Quoted 84 lines

This commit also changes the default internal mic input to IN2, because all my 7 test devices have their mic there.

---
Note I have put getting to the bottom of the UCM input device switching code and fixing it on my TODO list
---
  sound/soc/intel/boards/bytcr_rt5651.c | 23 ++++++++++++++++++-----

  1 file changed, 18 insertions(+), 5 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +2 -1
index 53ac97c15fc6..d85530b1cc8e 100644
@@ -44,6 +44,7 @@
   enum {
       BYT_RT5651_DMIC_MAP,
       BYT_RT5651_IN1_MAP,
+    BYT_RT5651_IN2_MAP,
       BYT_RT5651_IN1_IN2_MAP,
   };
@@ -93,9 +94,9 @@ struct byt_rt5651_private {
       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 | -                    BYT_RT5651_IN1_MAP;
+                    BYT_RT5651_IN2_MAP;
  static void log_quirks(struct device *dev)
  {

sound/soc/intel/boards/bytcr_rt5651.c +8 -0
@@ -103,6 +104,8 @@ static void log_quirks(struct device *dev)
           dev_info(dev, "quirk DMIC_MAP enabled");
       if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_MAP)
           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)
           dev_info(dev, "quirk IN1_IN2_MAP enabled");
       if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) {
@@ -270,6 +273,12 @@ static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = {
       {"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[] = {
       {"Internal Mic", NULL, "micbias1"},
       {"IN1P", NULL, "Internal Mic"},
@@ -364,7 +373,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
               DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
           },

          .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | -                    BYT_RT5651_IN1_MAP |
+                    BYT_RT5651_IN2_MAP | BYT_RT5651_HP_LR_SWAPPED),
      },
      {

sound/soc/intel/boards/bytcr_rt5651.c +0 -0
@@ -375,7 +384,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
               DMI_MATCH(DMI_PRODUCT_NAME, "D2D3_Vi8A1"),
           },

          .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | -                    BYT_RT5651_IN1_MAP |
+                    BYT_RT5651_IN2_MAP | BYT_RT5651_HP_LR_SWAPPED),
      },
      {

sound/soc/intel/boards/bytcr_rt5651.c +4 -0
@@ -468,6 +477,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
           custom_map = byt_rt5651_intmic_in1_map;
           num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_map);
           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:
          custom_map = byt_rt5651_intmic_in1_in2_map; num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_in2_map);

Quoted 9 lines

sound/soc/intel/boards/bytcr_rt5651.c struct acpi_chan_package {   /* ACPICA seems to require 64 bit integers */ · line 843

Quoted 8 lines
sound/soc/intel/boards/bytcr_rt5651.c +1 -1
@@ -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)
   {
-    const char * const mic_name[] = { "dmic", "in1", "in12" };
+    const char * const mic_name[] = { "dmic", "in1", "in2", "in12" };
       struct byt_rt5651_private *priv;
       struct snd_soc_acpi_mach *mach;
       struct device *codec_dev;

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#17 lore raw

Re: [PATCH 4/6] ASoC: Intel: bytcr_rt5651: Add IN2 input mapping

Quoted 20 lines · Hans de Goede

Hi,

Quoted 11 lines · Pierre-Louis Bossart
Quoted 8 lines · Hans de Goede

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.

Quoted 5 lines
Quoted 3 lines

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.

I am getting dizzy :-)
is the conclusion that hs==IN3 (no change) and int-mic==(DMIC, IN1, IN2, IN12)

Quoted 8 lines

Yes that is the conclusion. Sorry about this, as said my previous testing was wrong because of an userspace bug (which I still need to track down).

Quoted 1 line

and the UCM names only use the latter for differentiation of profiles?

Correct. This pretty much fully aligns the rt5651 code with the rt5640 code wrt long-names.

Sounds good, the patches look ok to me. Thanks for all the work you've been doing on this platform. All the bytcr_rt5651 changes

Quoted 106 lines

Regards,

Hans

Quoted 91 lines
Quoted 91 lines

This commit also changes the default internal mic input to IN2, because all my 7 test devices have their mic there.

---
Note I have put getting to the bottom of the UCM input device switching code and fixing it on my TODO list
---
  sound/soc/intel/boards/bytcr_rt5651.c | 23 ++++++++++++++++++-----

  1 file changed, 18 insertions(+), 5 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +1 -1
index 53ac97c15fc6..d85530b1cc8e 100644
@@ -44,6 +44,7 @@
   enum {
       BYT_RT5651_DMIC_MAP,
       BYT_RT5651_IN1_MAP,
+    BYT_RT5651_IN2_MAP,
       BYT_RT5651_IN1_IN2_MAP,
   };
@@ -93,9 +94,9 @@ struct byt_rt5651_private {
       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 | -                    BYT_RT5651_IN1_MAP;
+                    BYT_RT5651_IN2_MAP;
  static void log_quirks(struct device *dev)
  {

sound/soc/intel/boards/bytcr_rt5651.c +8 -0
@@ -103,6 +104,8 @@ static void log_quirks(struct device *dev)
           dev_info(dev, "quirk DMIC_MAP enabled");
       if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_MAP)
           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)
           dev_info(dev, "quirk IN1_IN2_MAP enabled");
       if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) {
@@ -270,6 +273,12 @@ static const struct snd_soc_dapm_route 
 byt_rt5651_intmic_in1_map[] = {
       {"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[] = {
       {"Internal Mic", NULL, "micbias1"},
       {"IN1P", NULL, "Internal Mic"},
@@ -364,7 +373,7 @@ static const struct dmi_system_id 
 byt_rt5651_quirk_table[] = {
               DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
           },

          .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | -                    BYT_RT5651_IN1_MAP |
+                    BYT_RT5651_IN2_MAP | BYT_RT5651_HP_LR_SWAPPED),
      },
      {

sound/soc/intel/boards/bytcr_rt5651.c +0 -0
@@ -375,7 +384,7 @@ static const struct dmi_system_id 
 byt_rt5651_quirk_table[] = {
               DMI_MATCH(DMI_PRODUCT_NAME, "D2D3_Vi8A1"),
           },

          .driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS | -                    BYT_RT5651_IN1_MAP |
+                    BYT_RT5651_IN2_MAP | BYT_RT5651_HP_LR_SWAPPED),
      },
      {

sound/soc/intel/boards/bytcr_rt5651.c +4 -0
@@ -468,6 +477,10 @@ static int byt_rt5651_init(struct 
 snd_soc_pcm_runtime *runtime)
           custom_map = byt_rt5651_intmic_in1_map;
           num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_map);
           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:
          custom_map = byt_rt5651_intmic_in1_in2_map; num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_in2_map);

sound/soc/intel/boards/bytcr_rt5651.c +0 -0
@@ -825,7 +838,7 @@ struct acpi_chan_package {   /* ACPICA seems to 
Quoted 9 lines
Quoted 8 lines

require 64 bit integers */
  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 snd_soc_acpi_mach *mach;
      struct device *codec_dev;

Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

maintainer
#18 lore raw

Applied "ASoC: Intel: bytcr_rt5651: Add IN2 input mapping" to the asoc tree

In reply to Hans de Goede

The patch

ASoC: Intel: bytcr_rt5651: Add IN2 input mapping

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

Quoted 1 line

From ac275ee5aa67abe9b65d66071ee333c6b0905b93 Mon Sep 17 00:00:00 2001

From: Hans de Goede <[email protected]>
Date: Wed, 18 Jul 2018 22:55:40 +0200
Subject: [PATCH] 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.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +18 -5
index 53ac97c15fc6..d85530b1cc8e 100644
@@ -44,6 +44,7 @@
 enum {
 	BYT_RT5651_DMIC_MAP,
 	BYT_RT5651_IN1_MAP,
+	BYT_RT5651_IN2_MAP,
 	BYT_RT5651_IN1_IN2_MAP,
 };
 
@@ -93,9 +94,9 @@ struct byt_rt5651_private {
 	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 |
-					BYT_RT5651_IN1_MAP;
+					BYT_RT5651_IN2_MAP;
 
 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");
 	if (BYT_RT5651_MAP(byt_rt5651_quirk) == BYT_RT5651_IN1_MAP)
 		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)
 		dev_info(dev, "quirk IN1_IN2_MAP enabled");
 	if (BYT_RT5651_JDSRC(byt_rt5651_quirk)) {
@@ -270,6 +273,12 @@ static const struct snd_soc_dapm_route byt_rt5651_intmic_in1_map[] = {
 	{"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[] = {
 	{"Internal Mic", NULL, "micbias1"},
 	{"IN1P", NULL, "Internal Mic"},
@@ -364,7 +373,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
 		},
 		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
-					BYT_RT5651_IN1_MAP |
+					BYT_RT5651_IN2_MAP |
 					BYT_RT5651_HP_LR_SWAPPED),
 	},
 	{
@@ -375,7 +384,7 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "D2D3_Vi8A1"),
 		},
 		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
-					BYT_RT5651_IN1_MAP |
+					BYT_RT5651_IN2_MAP |
 					BYT_RT5651_HP_LR_SWAPPED),
 	},
 	{
@@ -468,6 +477,10 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
 		custom_map = byt_rt5651_intmic_in1_map;
 		num_routes = ARRAY_SIZE(byt_rt5651_intmic_in1_map);
 		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:
 		custom_map = 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 */
 
 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 snd_soc_acpi_mach *mach;
 	struct device *codec_dev;
Signature · 1 line
2.18.0
#19 lore raw

PATCH 5/6 ASoC: Intel: bytcr_rt5651: Add mono speaker quirk

In reply to Hans de Goede

During my initial round of bytcr_rt5651 long-name patches I did not include a difference for mono vs stereo speaker setups in the longname because it seems that all 5651 devices with only a single speaker do some mixing of left + right on the PCB.

However further testing has shown that while this works great when only playing audio on the left or right channel, the output becomes garbled when using both channels at once. Something which does not happen when using the Stereo DAC MIXL / MIXR switches to mix the channels together inside the codec and then only outputting on a single channel.

So we need to have separate UCM profiles and thus separate long-names for devices with a mono speaker vs stereo speakers. Just as we already have for the bytcr_rt5640 case.

This commit adds a new BYT_RT5651_MONO_SPEAKER quirk and adds "stereo-spk" or "mono-spk" to the long-name based on this and enables this mapping on devices with a mono speaker.

Changing the long-name like this is ok for now, since I'm still working on the UCM profiles, so they are not in upstream alsa-lib yet.

This brings the long-name naming scheme fully in sync with the bytcr_rt5640 case, which is good from a consistency pov.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +11 -4
index d85530b1cc8e..8374e633796d 100644
@@ -79,6 +79,7 @@ enum {
 #define BYT_RT5651_SSP0_AIF1		BIT(20)
 #define BYT_RT5651_SSP0_AIF2		BIT(21)
 #define BYT_RT5651_HP_LR_SWAPPED	BIT(22)
+#define BYT_RT5651_MONO_SPEAKER		BIT(23)
 
 #define BYT_RT5651_DEFAULT_QUIRKS	(BYT_RT5651_MCLK_EN | \
 					 BYT_RT5651_JD1_1   | \
@@ -128,6 +129,8 @@ static void log_quirks(struct device *dev)
 		dev_info(dev, "quirk SSP0_AIF1 enabled\n");
 	if (byt_rt5651_quirk & BYT_RT5651_SSP0_AIF2)
 		dev_info(dev, "quirk SSP0_AIF2 enabled\n");
+	if (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER)
+		dev_info(dev, "quirk MONO_SPEAKER enabled\n");
 }
 
 #define BYT_CODEC_DAI1	"rt5651-aif1"
@@ -374,7 +377,8 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 		},
 		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
 					BYT_RT5651_IN2_MAP |
-					BYT_RT5651_HP_LR_SWAPPED),
+					BYT_RT5651_HP_LR_SWAPPED |
+					BYT_RT5651_MONO_SPEAKER),
 	},
 	{
 		/* Chuwi Vi8 Plus (CWI519) */
@@ -385,7 +389,8 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 		},
 		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
 					BYT_RT5651_IN2_MAP |
-					BYT_RT5651_HP_LR_SWAPPED),
+					BYT_RT5651_HP_LR_SWAPPED |
+					BYT_RT5651_MONO_SPEAKER),
 	},
 	{
 		/* KIANO SlimNote 14.2 */
@@ -700,7 +705,7 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
 static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];
 static char byt_rt5651_codec_aif_name[12]; /*  = "rt5651-aif[1|2]" */
 static char byt_rt5651_cpu_dai_name[10]; /*  = "ssp[0|2]-port" */
-static char byt_rt5651_long_name[40]; /* = "bytcr-rt5651-*-mic[-swapped-hp]" */
+static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */
 
 static int byt_rt5651_suspend(struct snd_soc_card *card)
 {
@@ -1025,7 +1030,9 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
 		hp_swapped = "";
 
 	snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name),
-		 "bytcr-rt5651-%s-mic%s",
+		 "bytcr-rt5651-%s-spk-%s-mic%s",
+		 (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ?
+			"mono" : "stereo",
 		 mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], hp_swapped);
 	byt_rt5651_card.long_name = byt_rt5651_long_name;
 
Signature · 1 line
2.17.1
maintainer
#20 lore raw

Applied "ASoC: Intel: bytcr_rt5651: Add mono speaker quirk" to the asoc tree

The patch

ASoC: Intel: bytcr_rt5651: Add mono speaker quirk

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

Quoted 1 line

From a0d1d867c262f4ad5d8e4925e2212711ebdbf2b7 Mon Sep 17 00:00:00 2001

From: Hans de Goede <[email protected]>
Date: Wed, 18 Jul 2018 22:55:41 +0200
Subject: [PATCH] ASoC: Intel: bytcr_rt5651: Add mono speaker quirk

During my initial round of bytcr_rt5651 long-name patches I did not include a difference for mono vs stereo speaker setups in the longname because it seems that all 5651 devices with only a single speaker do some mixing of left + right on the PCB.

However further testing has shown that while this works great when only playing audio on the left or right channel, the output becomes garbled when using both channels at once. Something which does not happen when using the Stereo DAC MIXL / MIXR switches to mix the channels together inside the codec and then only outputting on a single channel.

So we need to have separate UCM profiles and thus separate long-names for devices with a mono speaker vs stereo speakers. Just as we already have for the bytcr_rt5640 case.

This commit adds a new BYT_RT5651_MONO_SPEAKER quirk and adds "stereo-spk" or "mono-spk" to the long-name based on this and enables this mapping on devices with a mono speaker.

Changing the long-name like this is ok for now, since I'm still working on the UCM profiles, so they are not in upstream alsa-lib yet.

This brings the long-name naming scheme fully in sync with the bytcr_rt5640 case, which is good from a consistency pov.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
sound/soc/intel/boards/bytcr_rt5651.c +11 -4
index d85530b1cc8e..8374e633796d 100644
@@ -79,6 +79,7 @@ enum {
 #define BYT_RT5651_SSP0_AIF1		BIT(20)
 #define BYT_RT5651_SSP0_AIF2		BIT(21)
 #define BYT_RT5651_HP_LR_SWAPPED	BIT(22)
+#define BYT_RT5651_MONO_SPEAKER		BIT(23)
 
 #define BYT_RT5651_DEFAULT_QUIRKS	(BYT_RT5651_MCLK_EN | \
 					 BYT_RT5651_JD1_1   | \
@@ -128,6 +129,8 @@ static void log_quirks(struct device *dev)
 		dev_info(dev, "quirk SSP0_AIF1 enabled\n");
 	if (byt_rt5651_quirk & BYT_RT5651_SSP0_AIF2)
 		dev_info(dev, "quirk SSP0_AIF2 enabled\n");
+	if (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER)
+		dev_info(dev, "quirk MONO_SPEAKER enabled\n");
 }
 
 #define BYT_CODEC_DAI1	"rt5651-aif1"
@@ -374,7 +377,8 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 		},
 		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
 					BYT_RT5651_IN2_MAP |
-					BYT_RT5651_HP_LR_SWAPPED),
+					BYT_RT5651_HP_LR_SWAPPED |
+					BYT_RT5651_MONO_SPEAKER),
 	},
 	{
 		/* Chuwi Vi8 Plus (CWI519) */
@@ -385,7 +389,8 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 		},
 		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
 					BYT_RT5651_IN2_MAP |
-					BYT_RT5651_HP_LR_SWAPPED),
+					BYT_RT5651_HP_LR_SWAPPED |
+					BYT_RT5651_MONO_SPEAKER),
 	},
 	{
 		/* KIANO SlimNote 14.2 */
@@ -700,7 +705,7 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
 static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];
 static char byt_rt5651_codec_aif_name[12]; /*  = "rt5651-aif[1|2]" */
 static char byt_rt5651_cpu_dai_name[10]; /*  = "ssp[0|2]-port" */
-static char byt_rt5651_long_name[40]; /* = "bytcr-rt5651-*-mic[-swapped-hp]" */
+static char byt_rt5651_long_name[50]; /* = "bytcr-rt5651-*-spk-*-mic[-swapped-hp]" */
 
 static int byt_rt5651_suspend(struct snd_soc_card *card)
 {
@@ -1025,7 +1030,9 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
 		hp_swapped = "";
 
 	snprintf(byt_rt5651_long_name, sizeof(byt_rt5651_long_name),
-		 "bytcr-rt5651-%s-mic%s",
+		 "bytcr-rt5651-%s-spk-%s-mic%s",
+		 (byt_rt5651_quirk & BYT_RT5651_MONO_SPEAKER) ?
+			"mono" : "stereo",
 		 mic_name[BYT_RT5651_MAP(byt_rt5651_quirk)], hp_swapped);
 	byt_rt5651_card.long_name = byt_rt5651_long_name;
 
Signature · 1 line
2.18.0
#21 lore raw

PATCH 6/6 ASoC: Intel: bytcr_rt5651: Add quirk table entries for various devices

In reply to Hans de Goede

Add quirk table entries for the following tablets:

ITWorks TW701
Ployer Momo7w
Trekstor win7
Yours 8"

These all use the default settings, except that they only have a single speaker and thus need the mono-speaker quirk.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 28 +++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
sound/soc/intel/boards/bytcr_rt5651.c +28 -0
index 8374e633796d..f8a68bdb3885 100644
@@ -392,6 +392,21 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 					BYT_RT5651_HP_LR_SWAPPED |
 					BYT_RT5651_MONO_SPEAKER),
 	},
+	{
+		/* I.T.Works TW701, Ployer Momo7w and Trekstor ST70416-6
+		 * (these all use the same mainboard) */
+		.callback = byt_rt5651_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_BIOS_VENDOR, "INSYDE Corp."),
+			/* Partial match for all of itWORKS.G.WI71C.JGBMRBA,
+			 * TREK.G.WI71C.JGBMRBA0x and MOMO.G.WI71C.MABMRBA02 */
+			DMI_MATCH(DMI_BIOS_VERSION, ".G.WI71C."),
+		},
+		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
+					BYT_RT5651_IN2_MAP |
+					BYT_RT5651_SSP0_AIF1 |
+					BYT_RT5651_MONO_SPEAKER),
+	},
 	{
 		/* KIANO SlimNote 14.2 */
 		.callback = byt_rt5651_quirk_cb,
@@ -434,6 +449,19 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 					BYT_RT5651_OVCD_SF_1P0 |
 					BYT_RT5651_MCLK_EN),
 	},
+	{
+		/* Yours Y8W81 (and others using the same mainboard) */
+		.callback = byt_rt5651_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_BIOS_VENDOR, "INSYDE Corp."),
+			/* Partial match for all devs with a W86C mainboard */
+			DMI_MATCH(DMI_BIOS_VERSION, ".F.W86C."),
+		},
+		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
+					BYT_RT5651_IN2_MAP |
+					BYT_RT5651_SSP0_AIF1 |
+					BYT_RT5651_MONO_SPEAKER),
+	},
 	{}
 };
 
Signature · 1 line
2.17.1
maintainer
#22 lore raw

Applied "ASoC: Intel: bytcr_rt5651: Add quirk table entries for various devices" to the asoc tree

The patch

ASoC: Intel: bytcr_rt5651: Add quirk table entries for various 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

Quoted 1 line

From 06aa6e51273c9ac458af0bb9be95603cfbad14ec Mon Sep 17 00:00:00 2001

From: Hans de Goede <[email protected]>
Date: Wed, 18 Jul 2018 22:55:42 +0200
Subject: [PATCH] ASoC: Intel: bytcr_rt5651: Add quirk table entries for
various devices

Add quirk table entries for the following tablets:

ITWorks TW701
Ployer Momo7w
Trekstor win7
Yours 8"

These all use the default settings, except that they only have a single speaker and thus need the mono-speaker quirk.

---
 sound/soc/intel/boards/bytcr_rt5651.c | 28 +++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
sound/soc/intel/boards/bytcr_rt5651.c +28 -0
index 8374e633796d..f8a68bdb3885 100644
@@ -392,6 +392,21 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 					BYT_RT5651_HP_LR_SWAPPED |
 					BYT_RT5651_MONO_SPEAKER),
 	},
+	{
+		/* I.T.Works TW701, Ployer Momo7w and Trekstor ST70416-6
+		 * (these all use the same mainboard) */
+		.callback = byt_rt5651_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_BIOS_VENDOR, "INSYDE Corp."),
+			/* Partial match for all of itWORKS.G.WI71C.JGBMRBA,
+			 * TREK.G.WI71C.JGBMRBA0x and MOMO.G.WI71C.MABMRBA02 */
+			DMI_MATCH(DMI_BIOS_VERSION, ".G.WI71C."),
+		},
+		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
+					BYT_RT5651_IN2_MAP |
+					BYT_RT5651_SSP0_AIF1 |
+					BYT_RT5651_MONO_SPEAKER),
+	},
 	{
 		/* KIANO SlimNote 14.2 */
 		.callback = byt_rt5651_quirk_cb,
@@ -434,6 +449,19 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
 					BYT_RT5651_OVCD_SF_1P0 |
 					BYT_RT5651_MCLK_EN),
 	},
+	{
+		/* Yours Y8W81 (and others using the same mainboard) */
+		.callback = byt_rt5651_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_BIOS_VENDOR, "INSYDE Corp."),
+			/* Partial match for all devs with a W86C mainboard */
+			DMI_MATCH(DMI_BIOS_VERSION, ".F.W86C."),
+		},
+		.driver_data = (void *)(BYT_RT5651_DEFAULT_QUIRKS |
+					BYT_RT5651_IN2_MAP |
+					BYT_RT5651_SSP0_AIF1 |
+					BYT_RT5651_MONO_SPEAKER),
+	},
 	{}
 };
 
Signature · 1 line
2.18.0
#23 lore raw
In reply to Hans de Goede

Hi all,

On 18-07-18 22:55, Hans de Goede wrote:
<snip>

Quoted 5 lines

Note that unfortunately my previous round of cleanup patches removed 1 input mapping (of the 3 mappings in total it removed) which is actually necessary. So this series re-introduces that 1 mapping. I did not notice this before because UCM input profile switching does not work reliably for some reason, something which I still need to investigate.

While doing some bytcr_rt5651 work this weekend (the x86 ASoC work I do is a spare time project for me) I hit this again, so this time I've spend some time getting to the bottom of this. The cause is a pulseaudio bug, where pulseaudio uses a strncmp without first checking the lengths of the 2 strings match, causing it to see selecting the "InternalMic-IN1" UCM device as selecting both the "InternalMic-IN1" and the "InternalMic-IN12" device.

A pull-req fixing this is here:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/40

Regards,

Hans