All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Mark Brown <broonie@kernel.org>, Bard Liao <bardliao@realtek.com>,
	Oder Chiou <oder_chiou@realtek.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	alsa-devel@alsa-project.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Carlo Caione <carlo@endlessm.com>
Subject: [PATCH 5/6] ASoC: Intel: bytcr_rt5651: Add mono speaker quirk
Date: Wed, 18 Jul 2018 22:55:41 +0200	[thread overview]
Message-ID: <20180718205542.12364-6-hdegoede@redhat.com> (raw)
In-Reply-To: <20180718205542.12364-1-hdegoede@redhat.com>

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.

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

diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
index d85530b1cc8e..8374e633796d 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -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;
 
-- 
2.17.1

  parent reply	other threads:[~2018-07-18 20:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18 20:55 [PATCH 0/6] ASoC: rt5651: Various fixes and quirks Hans de Goede
2018-07-18 20:55 ` [PATCH 1/6] ASoC: rt5651: Add IN3 Boost volume control Hans de Goede
2018-07-19 15:02   ` Mark Brown
2018-07-20  1:31     ` Bard Liao
2018-07-20  1:40       ` Pierre-Louis Bossart
2018-07-20  2:53         ` Bard Liao
2018-07-27 12:01           ` Hans de Goede
2018-07-30  1:58             ` Bard Liao
2018-07-30  8:28             ` Mark Brown
2018-07-19 16:57   ` Applied "ASoC: rt5651: Add IN3 Boost volume control" to the asoc tree Mark Brown
2018-07-18 20:55 ` [PATCH 2/6] ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the ext-amp on some boards Hans de Goede
2018-07-19 16:57   ` Applied "ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the ext-amp on some boards" to the asoc tree Mark Brown
2018-07-18 20:55 ` [PATCH 3/6] ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to 2000uA Hans de Goede
2018-07-19 16:57   ` Applied "ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to 2000uA" to the asoc tree Mark Brown
2018-07-18 20:55 ` [PATCH 4/6] ASoC: Intel: bytcr_rt5651: Add IN2 input mapping Hans de Goede
2018-07-18 21:20   ` Pierre-Louis Bossart
2018-07-19 11:37     ` Hans de Goede
2018-07-19 13:08       ` Pierre-Louis Bossart
2018-07-19 16:57   ` Applied "ASoC: Intel: bytcr_rt5651: Add IN2 input mapping" to the asoc tree Mark Brown
2018-07-18 20:55 ` Hans de Goede [this message]
2018-07-19 16:56   ` Applied "ASoC: Intel: bytcr_rt5651: Add mono speaker quirk" " Mark Brown
2018-07-18 20:55 ` [PATCH 6/6] ASoC: Intel: bytcr_rt5651: Add quirk table entries for various devices Hans de Goede
2018-07-19 16:56   ` Applied "ASoC: Intel: bytcr_rt5651: Add quirk table entries for various devices" to the asoc tree Mark Brown
2018-12-24 14:15 ` [PATCH 0/6] ASoC: rt5651: Various fixes and quirks Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180718205542.12364-6-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=carlo@endlessm.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=oder_chiou@realtek.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.