All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes
@ 2021-03-07 15:05 Hans de Goede
  2021-03-07 15:05 ` [PATCH resend 1/2] ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume' Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hans de Goede @ 2021-03-07 15:05 UTC (permalink / raw)
  To: Cezary Rojewski, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
	Mark Brown
  Cc: Oder Chiou, Hans de Goede, alsa-devel, Bard Liao

Hi All,

Here is a resent of the remaining patches from my
"[PATCH 0/5] AsoC: rt5640/rt5651: Volume control fixes" series,
with the controversial "[PATCH 3/5] ASoC: rt5640: Add emulated
'DAC1 Playback Switch' control" patch dropped, and these
remaining 2 patches rebased to still apply with that patch dropped.

Regards,

Hans


Hans de Goede (2):
  ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback
    Volume'
  ASoC: Intel: bytcr_rt5640: Add used AIF to the components string

 sound/soc/codecs/rt5640.c             |  6 +++---
 sound/soc/intel/boards/bytcr_rt5640.c | 11 ++++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

-- 
2.30.1


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

* [PATCH resend 1/2] ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume'
  2021-03-07 15:05 [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes Hans de Goede
@ 2021-03-07 15:05 ` Hans de Goede
  2021-03-07 15:05 ` [PATCH resend 2/2] ASoC: Intel: bytcr_rt5640: Add used AIF to the components string Hans de Goede
  2021-03-12 23:00 ` [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2021-03-07 15:05 UTC (permalink / raw)
  To: Cezary Rojewski, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
	Mark Brown
  Cc: Oder Chiou, Hans de Goede, alsa-devel, Bard Liao

Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume' and move it
from rt5640_specific_snd_controls[] to rt5640_snd_controls[].

The RT5640_DAC2_DIG_VOL register controlled by this mixer-element has
nothing to do with the Mono (Amplified) output which is only available
on the ALC5640 chip and not on the ALC5642 chip.

The RT5640_DAC2_DIG_VOL volume-control is the main volume control for
audio coming from the I2S2 / AIF2 input of the chip and as such is also
available on the ALC5642.

This commit results in the following userspace visible changes:

1. On devices with an ACL5640 codec, the 'Mono DAC Playback Volume'
control is renamed to 'DAC2 Playback Volume' allowing the alsa-lib
mixer code to properly group it with the 'DAC2 Playback Switch' which
is controlling the mute bits in the RT5640_DAC2_DIG_VOL register.

Note the removal of the 'Mono DAC Playback Volume' is not an issue for
userspace because the UCM profiles do not use it (the UCM profiles are
shared betweent the 5640 and 5642 and only the 5640 had this control).

2. On devices with an ACL5642 codec, there now will be a new
'DAC2 Playback Volume', grouped with the 'DAC2 Playback Switch'

Having a complete 'DAC2 Playback Volume' / 'DAC2 Playback Switch' pair
on both variants will allow enabling hardware-volume control by
setting the UCM PlaybackMasterElem to "DAC2" on devices where the
I2S2/AIF2 interface of the codec is used.

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

diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index a5674c227b3a..82508c152bee 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -400,6 +400,9 @@ static const struct snd_kcontrol_new rt5640_snd_controls[] = {
 	/* DAC Digital Volume */
 	SOC_DOUBLE("DAC2 Playback Switch", RT5640_DAC2_CTRL,
 		RT5640_M_DAC_L2_VOL_SFT, RT5640_M_DAC_R2_VOL_SFT, 1, 1),
+	SOC_DOUBLE_TLV("DAC2 Playback Volume", RT5640_DAC2_DIG_VOL,
+			RT5640_L_VOL_SFT, RT5640_R_VOL_SFT,
+			175, 0, dac_vol_tlv),
 	SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5640_DAC1_DIG_VOL,
 			RT5640_L_VOL_SFT, RT5640_R_VOL_SFT,
 			175, 0, dac_vol_tlv),
@@ -443,9 +446,6 @@ static const struct snd_kcontrol_new rt5640_specific_snd_controls[] = {
 	/* MONO Output Control */
 	SOC_SINGLE("Mono Playback Switch", RT5640_MONO_OUT, RT5640_L_MUTE_SFT,
 		1, 1),
-
-	SOC_DOUBLE_TLV("Mono DAC Playback Volume", RT5640_DAC2_DIG_VOL,
-		RT5640_L_VOL_SFT, RT5640_R_VOL_SFT, 175, 0, dac_vol_tlv),
 };
 
 /**
-- 
2.30.1


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

* [PATCH resend 2/2] ASoC: Intel: bytcr_rt5640: Add used AIF to the components string
  2021-03-07 15:05 [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes Hans de Goede
  2021-03-07 15:05 ` [PATCH resend 1/2] ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume' Hans de Goede
@ 2021-03-07 15:05 ` Hans de Goede
  2021-03-12 23:00 ` [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2021-03-07 15:05 UTC (permalink / raw)
  To: Cezary Rojewski, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
	Mark Brown
  Cc: Oder Chiou, Hans de Goede, alsa-devel, Bard Liao

Depending on which AIF is used the UCM profile needs to setup
a different path through the rt5640's "Digital Mixer Path" graph.

ATM the UCM profiles solve this by just enabling paths to the outputs /
from the input from both AIF1 and AIF2 and then relying on the DAPM
framework to power-down the parts of the graph connected to the
unused AIF.

But in order to be able to use hardware-volumecontrol and to use
the hardware mute controls, which are necessary for mute LED control,
the UCM profiles need to know which AIF is actually being used.

Add a new "aif:1" or "aif:2" part to the component string to provide
info about the used AIF to userspace / to the UCM profiles.

Note the size of byt_rt5640_components is not increased because the
size of 32 chars already is big enough.

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

diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
index 5d48cc359c3d..1f6a636571c2 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -1252,6 +1252,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
 	int ret_val = 0;
 	int dai_index = 0;
 	int i, cfg_spk;
+	int aif;
 
 	is_bytcr = false;
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
@@ -1363,8 +1364,12 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
 	log_quirks(&pdev->dev);
 
 	if ((byt_rt5640_quirk & BYT_RT5640_SSP2_AIF2) ||
-	    (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2))
+	    (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2)) {
 		byt_rt5640_dais[dai_index].codecs->dai_name = "rt5640-aif2";
+		aif = 2;
+	} else {
+		aif = 1;
+	}
 
 	if ((byt_rt5640_quirk & BYT_RT5640_SSP0_AIF1) ||
 	    (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2))
@@ -1402,8 +1407,8 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
 	}
 
 	snprintf(byt_rt5640_components, sizeof(byt_rt5640_components),
-		 "cfg-spk:%d cfg-mic:%s", cfg_spk,
-		 map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]);
+		 "cfg-spk:%d cfg-mic:%s aif:%d", cfg_spk,
+		 map_name[BYT_RT5640_MAP(byt_rt5640_quirk)], aif);
 	byt_rt5640_card.components = byt_rt5640_components;
 #if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
 	snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name),
-- 
2.30.1


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

* Re: [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes
  2021-03-07 15:05 [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes Hans de Goede
  2021-03-07 15:05 ` [PATCH resend 1/2] ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume' Hans de Goede
  2021-03-07 15:05 ` [PATCH resend 2/2] ASoC: Intel: bytcr_rt5640: Add used AIF to the components string Hans de Goede
@ 2021-03-12 23:00 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2021-03-12 23:00 UTC (permalink / raw)
  To: Liam Girdwood, Cezary Rojewski, Pierre-Louis Bossart, Jie Yang,
	Hans de Goede
  Cc: Oder Chiou, alsa-devel, Mark Brown, Bard Liao

On Sun, 7 Mar 2021 16:05:01 +0100, Hans de Goede wrote:
> Here is a resent of the remaining patches from my
> "[PATCH 0/5] AsoC: rt5640/rt5651: Volume control fixes" series,
> with the controversial "[PATCH 3/5] ASoC: rt5640: Add emulated
> 'DAC1 Playback Switch' control" patch dropped, and these
> remaining 2 patches rebased to still apply with that patch dropped.
> 
> Regards,
> 
> [...]

Applied to

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

Thanks!

[1/2] ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume'
      commit: 40e4046913a34dd187c94f66c0f43facbff0f430
[2/2] ASoC: Intel: bytcr_rt5640: Add used AIF to the components string
      commit: 9f47c9c8bddc79e770ed19366840b9c2ab280ac1

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

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

end of thread, other threads:[~2021-03-12 23:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07 15:05 [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes Hans de Goede
2021-03-07 15:05 ` [PATCH resend 1/2] ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume' Hans de Goede
2021-03-07 15:05 ` [PATCH resend 2/2] ASoC: Intel: bytcr_rt5640: Add used AIF to the components string Hans de Goede
2021-03-12 23:00 ` [PATCH resend 0/2] AsoC: rt5640/rt5651: Volume control fixes Mark Brown

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.