diff mbox series

[alsa-ucm-conf,2/2] codecs/rt5672: Add hardware volume-control support

Message ID 20210217143436.74209-2-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series [alsa-ucm-conf,1/2] codecs/rt5672: Move +12dB input boost from 'STO1 ADC Boost Gain' to 'ADC Capture Volume' | expand

Commit Message

Hans de Goede Feb. 17, 2021, 2:34 p.m. UTC
For the speaker and DMICs configs this uses "DAC1 Playback Volume"
resp. "ADC Capture Volume" as main mixer elements, since there are
no other volume-controls in their paths.

For the (analog) headset-mic and headphones this used the analog
"IN1 Boost" resp. "HP Playback Volume" controls as main mixer elements
while using the  "ADC Capture Volume" resp. "DAC1 Playback Volume"
(which have the mute switches) as master mixer elements.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 ucm2/codecs/rt5672/DMIC1.conf       | 5 +++++
 ucm2/codecs/rt5672/DMIC2.conf       | 5 +++++
 ucm2/codecs/rt5672/HeadPhones.conf  | 3 +++
 ucm2/codecs/rt5672/HeadsetMic.conf  | 3 +++
 ucm2/codecs/rt5672/MonoSpeaker.conf | 5 +++++
 ucm2/codecs/rt5672/Speaker.conf     | 5 +++++
 6 files changed, 26 insertions(+)
diff mbox series

Patch

diff --git a/ucm2/codecs/rt5672/DMIC1.conf b/ucm2/codecs/rt5672/DMIC1.conf
index 2018283..ca65d28 100644
--- a/ucm2/codecs/rt5672/DMIC1.conf
+++ b/ucm2/codecs/rt5672/DMIC1.conf
@@ -23,5 +23,10 @@  SectionDevice."Mic1" {
 	Value {
 		CapturePriority 100
 		CapturePCM "hw:${CardId}"
+		# The DMIC ofcourse has no analog volume controls
+		# Use the digital ADC master control as MixerElem
+		CaptureMixerElem "ADC"
+		CaptureVolume "ADC Capture Volume"
+		CaptureSwitch "ADC Capture Switch"
 	}
 }
diff --git a/ucm2/codecs/rt5672/DMIC2.conf b/ucm2/codecs/rt5672/DMIC2.conf
index 48e6170..2a2f9fe 100644
--- a/ucm2/codecs/rt5672/DMIC2.conf
+++ b/ucm2/codecs/rt5672/DMIC2.conf
@@ -23,5 +23,10 @@  SectionDevice."Mic2" {
 	Value {
 		CapturePriority 200
 		CapturePCM "hw:${CardId}"
+		# The DMIC ofcourse has no analog volume controls
+		# Use the digital ADC master control as MixerElem
+		CaptureMixerElem "ADC"
+		CaptureVolume "ADC Capture Volume"
+		CaptureSwitch "ADC Capture Switch"
 	}
 }
diff --git a/ucm2/codecs/rt5672/HeadPhones.conf b/ucm2/codecs/rt5672/HeadPhones.conf
index 2c8d6e8..e22d499 100644
--- a/ucm2/codecs/rt5672/HeadPhones.conf
+++ b/ucm2/codecs/rt5672/HeadPhones.conf
@@ -18,5 +18,8 @@  SectionDevice."Headphones" {
 		PlaybackPriority 300
 		PlaybackPCM "hw:${CardId}"
 		JackControl "Headphone Jack"
+		PlaybackMixerElem "HP"
+		PlaybackMasterElem "DAC1"
+		PlaybackVolume "HP Playback Volume"
 	}
 }
diff --git a/ucm2/codecs/rt5672/HeadsetMic.conf b/ucm2/codecs/rt5672/HeadsetMic.conf
index fc061b0..103e93d 100644
--- a/ucm2/codecs/rt5672/HeadsetMic.conf
+++ b/ucm2/codecs/rt5672/HeadsetMic.conf
@@ -26,5 +26,8 @@  SectionDevice."Headset" {
 		CapturePriority 300
 		CapturePCM "hw:${CardId}"
 		JackControl "Headset Mic Jack"
+		CaptureMixerElem "IN1 Boost"
+		CaptureMasterElem "ADC"
+		CaptureVolume "IN1 Boost Volume"
 	}
 }
diff --git a/ucm2/codecs/rt5672/MonoSpeaker.conf b/ucm2/codecs/rt5672/MonoSpeaker.conf
index f08c9c6..e4addf4 100644
--- a/ucm2/codecs/rt5672/MonoSpeaker.conf
+++ b/ucm2/codecs/rt5672/MonoSpeaker.conf
@@ -21,5 +21,10 @@  SectionDevice."Speaker2" {
 	Value {
 		PlaybackPriority 100
 		PlaybackPCM "hw:${CardId}"
+		# The speaker ampl. path on the 5672 has no speaker vol control
+		# Use the digital DAC1 master control as MixerElem
+		PlaybackMixerElem "DAC1"
+		PlaybackVolume "DAC1 Playback Volume"
+		PlaybackSwitch "DAC1 Playback Switch"
 	}
 }
diff --git a/ucm2/codecs/rt5672/Speaker.conf b/ucm2/codecs/rt5672/Speaker.conf
index 8b7bcf8..9674c6b 100644
--- a/ucm2/codecs/rt5672/Speaker.conf
+++ b/ucm2/codecs/rt5672/Speaker.conf
@@ -17,5 +17,10 @@  SectionDevice."Speaker1" {
 	Value {
 		PlaybackPriority 200
 		PlaybackPCM "hw:${CardId}"
+		# The speaker ampl. path on the 5672 has no speaker vol control
+		# Use the digital DAC1 master control as MixerElem
+		PlaybackMixerElem "DAC1"
+		PlaybackVolume "DAC1 Playback Volume"
+		PlaybackSwitch "DAC1 Playback Switch"
 	}
 }