Blame SOURCES/alsa-ucm-git.patch

c4a1f5
diff --git a/ucm2/HDA-Intel/HDAudio-DualCodecs.conf b/ucm2/HDA-Intel/HDAudio-DualCodecs.conf
c4a1f5
index 8aaabd0..6fd7bd1 100644
c4a1f5
--- a/ucm2/HDA-Intel/HDAudio-DualCodecs.conf
c4a1f5
+++ b/ucm2/HDA-Intel/HDAudio-DualCodecs.conf
c4a1f5
@@ -4,3 +4,15 @@ SectionUseCase."HiFi" {
c4a1f5
 	File "HiFi-dual.conf"
c4a1f5
 	Comment "Default"
c4a1f5
 }
c4a1f5
+
c4a1f5
+BootSequence [
c4a1f5
+	cset "name='Headphone Playback Volume' 60%"
c4a1f5
+	cset "name='Headphone Playback Switch' off"
c4a1f5
+	cset "name='Speaker Playback Volume' 60%"
c4a1f5
+	cset "name='Speaker Playback Switch' on"
c4a1f5
+	cset "name='Front Playback Volume' 100%"
c4a1f5
+	cset "name='Front Playback Switch' on"
c4a1f5
+	cset "name='Rear-Panel Capture Volume' 100%"
c4a1f5
+	cset "name='Rear-Panel Capture Switch' on"
c4a1f5
+	cset "name='Input Source' Rear Mic"
c4a1f5
+]
c4a1f5
diff --git a/ucm2/HDA-Intel/Hdmi.conf b/ucm2/HDA-Intel/Hdmi.conf
c4a1f5
index c8b6e77..c533e49 100644
c4a1f5
--- a/ucm2/HDA-Intel/Hdmi.conf
c4a1f5
+++ b/ucm2/HDA-Intel/Hdmi.conf
c4a1f5
@@ -6,6 +6,7 @@ If.hdmi1 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 1
c4a1f5
 			HdmiPCM 3
c4a1f5
+			HdmiCtlIndex 0
c4a1f5
 			HdmiPrio 1100
c4a1f5
 		}
c4a1f5
 		Include.hdmi1.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -18,6 +19,7 @@ If.hdmi2 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 2
c4a1f5
 			HdmiPCM 7
c4a1f5
+			HdmiCtlIndex 1
c4a1f5
 			HdmiPrio 1200
c4a1f5
 		}
c4a1f5
 		Include.hdmi2.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -30,6 +32,7 @@ If.hdmi3 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 3
c4a1f5
 			HdmiPCM 8
c4a1f5
+			HdmiCtlIndex 2
c4a1f5
 			HdmiPrio 1300
c4a1f5
 		}
c4a1f5
 		Include.hdmi3.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -42,6 +45,7 @@ If.hdmi4 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 4
c4a1f5
 			HdmiPCM 9
c4a1f5
+			HdmiCtlIndex 3
c4a1f5
 			HdmiPrio 1400
c4a1f5
 		}
c4a1f5
 		Include.hdmi4.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -54,6 +58,7 @@ If.hdmi5 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 5
c4a1f5
 			HdmiPCM 10
c4a1f5
+			HdmiCtlIndex 4
c4a1f5
 			HdmiPrio 1500
c4a1f5
 		}
c4a1f5
 		Include.hdmi5.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -66,8 +71,9 @@ If.hdmi6 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 6
c4a1f5
 			HdmiPCM 11
c4a1f5
+			HdmiCtlIndex 5
c4a1f5
 			HdmiPrio 1600
c4a1f5
 		}
c4a1f5
-		Include.hdmi5.File "/codecs/hda/hdmi.conf"
c4a1f5
+		Include.hdmi6.File "/codecs/hda/hdmi.conf"
c4a1f5
 	}
c4a1f5
 }
c4a1f5
diff --git a/ucm2/HDA-Intel/HiFi-acp.conf b/ucm2/HDA-Intel/HiFi-acp.conf
c4a1f5
index 15eeca5..123ae15 100644
c4a1f5
--- a/ucm2/HDA-Intel/HiFi-acp.conf
c4a1f5
+++ b/ucm2/HDA-Intel/HiFi-acp.conf
c4a1f5
@@ -4,6 +4,5 @@ SectionDevice."Mic1" {
c4a1f5
 	Value {
c4a1f5
 		CapturePriority 100
c4a1f5
 		CapturePCM "hw:${var:AcpCardId}"
c4a1f5
-		CaptureMixerElem "Capture"
c4a1f5
 	}
c4a1f5
 }
c4a1f5
diff --git a/ucm2/HDA-Intel/HiFi-dual.conf b/ucm2/HDA-Intel/HiFi-dual.conf
c4a1f5
index cff948e..f2c6915 100644
c4a1f5
--- a/ucm2/HDA-Intel/HiFi-dual.conf
c4a1f5
+++ b/ucm2/HDA-Intel/HiFi-dual.conf
c4a1f5
@@ -8,6 +8,8 @@ SectionVerb {
c4a1f5
 		cset "name='Front Playback Switch' on"
c4a1f5
 		cset "name='Rear-Panel Capture Volume' 100%"
c4a1f5
 		cset "name='Rear-Panel Capture Switch' on"
c4a1f5
+		cset "name='Headphone Playback Switch' off"
c4a1f5
+		cset "name='Speaker Playback Switch' off"
c4a1f5
 	]
c4a1f5
 
c4a1f5
 	DisableSequence [
c4a1f5
@@ -27,6 +29,14 @@ SectionDevice."Speaker" {
c4a1f5
 		PlaybackMixerElem "Speaker"
c4a1f5
 	}
c4a1f5
 
c4a1f5
+	EnableSequence [
c4a1f5
+		cset "name='Speaker Playback Switch' on"
c4a1f5
+	]
c4a1f5
+
c4a1f5
+	DisableSequence [
c4a1f5
+		cset "name='Speaker Playback Switch' off"
c4a1f5
+	]
c4a1f5
+
c4a1f5
 	ConflictingDevice [
c4a1f5
 		"Headphones"
c4a1f5
 	]
c4a1f5
@@ -54,6 +64,14 @@ SectionDevice."Headphones" {
c4a1f5
 		JackHWMute "Speaker"
c4a1f5
 	}
c4a1f5
 
c4a1f5
+	EnableSequence [
c4a1f5
+		cset "name='Headphone Playback Switch' on"
c4a1f5
+	]
c4a1f5
+
c4a1f5
+	DisableSequence [
c4a1f5
+		cset "name='Headphone Playback Switch' off"
c4a1f5
+	]
c4a1f5
+
c4a1f5
 	ConflictingDevice [
c4a1f5
 		"Speaker"
c4a1f5
 	]
c4a1f5
diff --git a/ucm2/HDA-Intel/init.conf b/ucm2/HDA-Intel/init.conf
c4a1f5
index 1a351a9..6310eb3 100644
c4a1f5
--- a/ucm2/HDA-Intel/init.conf
c4a1f5
+++ b/ucm2/HDA-Intel/init.conf
c4a1f5
@@ -15,6 +15,7 @@ If.master {
c4a1f5
 	}
c4a1f5
 	True.BootSequence [
c4a1f5
 		cset "name='Master Playback Volume' 60%"
c4a1f5
+		cset "name='Master Playback Switch' on"
c4a1f5
 	]
c4a1f5
 }
c4a1f5
 
c4a1f5
diff --git a/ucm2/chtnau8824/HiFi.conf b/ucm2/chtnau8824/HiFi.conf
c4a1f5
index 3ccd6b1..105f360 100644
c4a1f5
--- a/ucm2/chtnau8824/HiFi.conf
c4a1f5
+++ b/ucm2/chtnau8824/HiFi.conf
c4a1f5
@@ -1,4 +1,5 @@
c4a1f5
 Define.Speaker "Speaker"
c4a1f5
+Define.Mic "InternalMic"
c4a1f5
 
c4a1f5
 If.cfg-mspk {
c4a1f5
 	Condition {
c4a1f5
@@ -11,6 +12,19 @@ If.cfg-mspk {
c4a1f5
 	}
c4a1f5
 }
c4a1f5
 
c4a1f5
+If.cfg-mic {
c4a1f5
+	Condition {
c4a1f5
+		Type RegexMatch
c4a1f5
+		String "${CardLongName}"
c4a1f5
+		# Medion E22??T models put DMIC in their product version
c4a1f5
+		# when using DMICs
c4a1f5
+		Regex "(MEDION-E22..T.*-DMIC-)"
c4a1f5
+	}
c4a1f5
+	True {
c4a1f5
+		Define.Mic "DMIC1_2"
c4a1f5
+	}
c4a1f5
+}
c4a1f5
+
c4a1f5
 SectionVerb {
c4a1f5
 
c4a1f5
 	Value {
c4a1f5
@@ -34,8 +48,15 @@ SectionVerb {
c4a1f5
 	}
c4a1f5
 }
c4a1f5
 
c4a1f5
-Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
c4a1f5
-Include.hp.File "/codecs/nau8824/HeadPhones.conf"
c4a1f5
+# The includes using $vars in there path must be conditional otherwise the
c4a1f5
+# $var gets expanded before the other If-s above can change the vars.
c4a1f5
+If.cfg-includes {
c4a1f5
+	Condition { Type String Empty "" }
c4a1f5
+	True {
c4a1f5
+		Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
c4a1f5
+		Include.hp.File "/codecs/nau8824/HeadPhones.conf"
c4a1f5
 
c4a1f5
-Include.mic.File "/codecs/nau8824/InternalMic.conf"
c4a1f5
-Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
c4a1f5
+		Include.mic.File "/codecs/nau8824/${var:Mic}.conf"
c4a1f5
+		Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
c4a1f5
+	}
c4a1f5
+}
c4a1f5
diff --git a/ucm2/chtrt5645/HiFi.conf b/ucm2/chtrt5645/HiFi.conf
c4a1f5
index 10b0a1c..30fad50 100644
c4a1f5
--- a/ucm2/chtrt5645/HiFi.conf
c4a1f5
+++ b/ucm2/chtrt5645/HiFi.conf
c4a1f5
@@ -18,7 +18,7 @@ If.cfg-dmic2 {
c4a1f5
 	Condition {
c4a1f5
 		Type RegexMatch
c4a1f5
 		String "${CardLongName}"
c4a1f5
-		Regex "(LENOVO.*LenovoMIIX320|MEDION.*Wingman)"
c4a1f5
+		Regex "(LENOVO.*LenovoMIIX320|MEDION.*Wingman|Standard-EF20EA-1.0)"
c4a1f5
 	}
c4a1f5
 	True {
c4a1f5
 		Define.AnalogMic ""
c4a1f5
diff --git a/ucm2/codecs/hda/hdmi.conf b/ucm2/codecs/hda/hdmi.conf
c4a1f5
index ba80fef..c7b7ba4 100644
c4a1f5
--- a/ucm2/codecs/hda/hdmi.conf
c4a1f5
+++ b/ucm2/codecs/hda/hdmi.conf
c4a1f5
@@ -5,14 +5,14 @@ If.hdmi {
c4a1f5
 	}
c4a1f5
 	True {
c4a1f5
 		SectionDevice."HDMI${var:HdmiNum}" {
c4a1f5
-			Comment "HDMI${var:HdmiNum} Output"
c4a1f5
+			Comment "HDMI / DisplayPort ${var:HdmiNum} Output"
c4a1f5
 
c4a1f5
 			EnableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch' on"
c4a1f5
+				cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} on"
c4a1f5
 			]
c4a1f5
 
c4a1f5
 			DisableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch' off"
c4a1f5
+				cset "name='IEC958 Playback Switch',index=${var:HdmiCtlIndex} off"
c4a1f5
 			]
c4a1f5
 
c4a1f5
 			Value {
c4a1f5
diff --git a/ucm2/codecs/nau8824/DMIC1_2.conf b/ucm2/codecs/nau8824/DMIC1_2.conf
c4a1f5
new file mode 100644
c4a1f5
index 0000000..f54f671
c4a1f5
--- /dev/null
c4a1f5
+++ b/ucm2/codecs/nau8824/DMIC1_2.conf
c4a1f5
@@ -0,0 +1,30 @@
c4a1f5
+# Stereo DMICs on the DMIC1 and DMIC2 inputs
c4a1f5
+
c4a1f5
+SectionDevice."Mic" {
c4a1f5
+	Comment "Internal Digital Microphones"
c4a1f5
+
c4a1f5
+	Value {
c4a1f5
+		CapturePriority 200
c4a1f5
+		CapturePCM "hw:${CardId}"
c4a1f5
+	}
c4a1f5
+
c4a1f5
+	ConflictingDevice [
c4a1f5
+		"Headset"
c4a1f5
+	]
c4a1f5
+
c4a1f5
+	EnableSequence [
c4a1f5
+		# Note needs to be swapped / swap is deliberate!
c4a1f5
+		cset "name='ADC CH0 Select' 1"
c4a1f5
+		cset "name='ADC CH1 Select' 0"
c4a1f5
+
c4a1f5
+		cset "name='Int Mic Switch' on"
c4a1f5
+		cset "name='DMIC1 Enable Switch' on"
c4a1f5
+		cset "name='DMIC2 Enable Switch' on"
c4a1f5
+	]
c4a1f5
+
c4a1f5
+	DisableSequence [
c4a1f5
+		cset "name='Int Mic Switch' off"
c4a1f5
+		cset "name='DMIC1 Enable Switch' off"
c4a1f5
+		cset "name='DMIC2 Enable Switch' off"
c4a1f5
+	]
c4a1f5
+}
c4a1f5
diff --git a/ucm2/codecs/nau8824/EnableSeq.conf b/ucm2/codecs/nau8824/EnableSeq.conf
c4a1f5
index 433e8e2..3650d06 100644
c4a1f5
--- a/ucm2/codecs/nau8824/EnableSeq.conf
c4a1f5
+++ b/ucm2/codecs/nau8824/EnableSeq.conf
c4a1f5
@@ -7,8 +7,8 @@ EnableSequence [
c4a1f5
 	cset "name='DMIC2 Enable Switch' off"
c4a1f5
 	cset "name='DMIC3 Enable Switch' off"
c4a1f5
 	cset "name='DMIC4 Enable Switch' off"
c4a1f5
-	cset "name='MIC1 Volume' 10"
c4a1f5
-	cset "name='MIC2 Volume' 10"
c4a1f5
+	cset "name='MIC1 Volume' 14"
c4a1f5
+	cset "name='MIC2 Volume' 14"
c4a1f5
 	# Button Configuration
c4a1f5
 	cset "name='THD for key media' 10"
c4a1f5
 	cset "name='THD for key voice command' 16"
c4a1f5
diff --git a/ucm2/codecs/rt715/init.conf b/ucm2/codecs/rt715/init.conf
c4a1f5
index 6e07b2d..15a0571 100644
c4a1f5
--- a/ucm2/codecs/rt715/init.conf
c4a1f5
+++ b/ucm2/codecs/rt715/init.conf
c4a1f5
@@ -7,4 +7,5 @@ BootSequence [
c4a1f5
 	cset "name='rt715 ADC 25 Mux' 4"
c4a1f5
 	cset "name='rt715 ADC 27 Capture Switch' 1"
c4a1f5
 	cset "name='rt715 ADC 07 Capture Switch' 1"
c4a1f5
+	cset "name='rt715 ADC 07 Capture Volume' 58"
c4a1f5
 ]
c4a1f5
diff --git a/ucm2/sof-hda-dsp/Hdmi.conf b/ucm2/sof-hda-dsp/Hdmi.conf
c4a1f5
index 7b777d1..1726567 100644
c4a1f5
--- a/ucm2/sof-hda-dsp/Hdmi.conf
c4a1f5
+++ b/ucm2/sof-hda-dsp/Hdmi.conf
c4a1f5
@@ -6,6 +6,7 @@ If.hdmi1 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 1
c4a1f5
 			HdmiPCM 3
c4a1f5
+			HdmiCtlIndex 0
c4a1f5
 			HdmiPrio 500
c4a1f5
 		}
c4a1f5
 		Include.hdmi1.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -18,6 +19,7 @@ If.hdmi2 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 2
c4a1f5
 			HdmiPCM 4
c4a1f5
+			HdmiCtlIndex 1
c4a1f5
 			HdmiPrio 600
c4a1f5
 		}
c4a1f5
 		Include.hdmi2.File "/codecs/hda/hdmi.conf"
c4a1f5
@@ -30,6 +32,7 @@ If.hdmi3 {
c4a1f5
 		Define {
c4a1f5
 			HdmiNum 3
c4a1f5
 			HdmiPCM 5
c4a1f5
+			HdmiCtlIndex 2
c4a1f5
 			HdmiPrio 700
c4a1f5
 		}
c4a1f5
 		Include.hdmi3.File "/codecs/hda/hdmi.conf"
c4a1f5
diff --git a/ucm2/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/sof-hda-dsp/sof-hda-dsp.conf
c4a1f5
index c8069a6..79b54a9 100644
c4a1f5
--- a/ucm2/sof-hda-dsp/sof-hda-dsp.conf
c4a1f5
+++ b/ucm2/sof-hda-dsp/sof-hda-dsp.conf
c4a1f5
@@ -24,6 +24,7 @@ If.master {
c4a1f5
 	}
c4a1f5
 	True.BootSequence [
c4a1f5
 		cset "name='Master Playback Volume' 60%"
c4a1f5
+		cset "name='Master Playback Switch' on"
c4a1f5
 	]
c4a1f5
 }
c4a1f5
 
c4a1f5
diff --git a/ucm2/sof-soundwire/Hdmi.conf b/ucm2/sof-soundwire/Hdmi.conf
c4a1f5
index d0ba790..d5ee9c6 100644
c4a1f5
--- a/ucm2/sof-soundwire/Hdmi.conf
c4a1f5
+++ b/ucm2/sof-soundwire/Hdmi.conf
c4a1f5
@@ -1,79 +1,40 @@
c4a1f5
-# Use case Configuration for sof-soundwire card
c4a1f5
+# Use case Configuration for sof-soundwire
c4a1f5
 
c4a1f5
 If.hdmi1 {
c4a1f5
-	Condition {
c4a1f5
-		Type ControlExists
c4a1f5
-		Control "iface=CARD,name='HDMI/DP,pcm=5 Jack'"
c4a1f5
-	}
c4a1f5
+	Condition { Type String Empty "" }
c4a1f5
 	True {
c4a1f5
-		SectionDevice."HDMI1" {
c4a1f5
-			Comment "HDMI1/DP1 Output"
c4a1f5
-
c4a1f5
-			EnableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch' on"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			DisableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch' off"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			Value {
c4a1f5
-				PlaybackPriority 500
c4a1f5
-				PlaybackPCM "hw:${CardId},5"
c4a1f5
-				JackControl "HDMI/DP,pcm=5 Jack"
c4a1f5
-			}
c4a1f5
+		Define {
c4a1f5
+			HdmiNum 1
c4a1f5
+			HdmiPCM 5
c4a1f5
+			HdmiCtlIndex 0
c4a1f5
+			HdmiPrio 500
c4a1f5
 		}
c4a1f5
+		Include.hdmi1.File "/codecs/hda/hdmi.conf"
c4a1f5
 	}
c4a1f5
 }
c4a1f5
 
c4a1f5
 If.hdmi2 {
c4a1f5
-	Condition {
c4a1f5
-		Type ControlExists
c4a1f5
-		Control "iface=CARD,name='HDMI/DP,pcm=6 Jack'"
c4a1f5
-	}
c4a1f5
+	Condition { Type String Empty "" }
c4a1f5
 	True {
c4a1f5
-		SectionDevice."HDMI2" {
c4a1f5
-			Comment "HDMI2/DP2 Output"
c4a1f5
-
c4a1f5
-			EnableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch',index=1 on"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			DisableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch',index=1 off"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			Value {
c4a1f5
-				PlaybackPriority 600
c4a1f5
-				PlaybackPCM "hw:${CardId},6"
c4a1f5
-				JackControl "HDMI/DP,pcm=6 Jack"
c4a1f5
-			}
c4a1f5
+		Define {
c4a1f5
+			HdmiNum 2
c4a1f5
+			HdmiPCM 6
c4a1f5
+			HdmiCtlIndex 1
c4a1f5
+			HdmiPrio 600
c4a1f5
 		}
c4a1f5
+		Include.hdmi2.File "/codecs/hda/hdmi.conf"
c4a1f5
 	}
c4a1f5
 }
c4a1f5
 
c4a1f5
 If.hdmi3 {
c4a1f5
-	Condition {
c4a1f5
-		Type ControlExists
c4a1f5
-		Control "iface=CARD,name='HDMI/DP,pcm=7 Jack'"
c4a1f5
-	}
c4a1f5
+	Condition { Type String Empty "" }
c4a1f5
 	True {
c4a1f5
-		SectionDevice."HDMI3" {
c4a1f5
-			Comment "HDMI3/DP3 Output"
c4a1f5
-
c4a1f5
-			EnableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch',index=2 on"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			DisableSequence [
c4a1f5
-				cset "name='IEC958 Playback Switch',index=2 off"
c4a1f5
-			]
c4a1f5
-
c4a1f5
-			Value {
c4a1f5
-				PlaybackPriority 700
c4a1f5
-				PlaybackPCM "hw:${CardId},7"
c4a1f5
-				JackControl "HDMI/DP,pcm=7 Jack"
c4a1f5
-			}
c4a1f5
+		Define {
c4a1f5
+			HdmiNum 3
c4a1f5
+			HdmiPCM 7
c4a1f5
+			HdmiCtlIndex 2
c4a1f5
+			HdmiPrio 700
c4a1f5
 		}
c4a1f5
+		Include.hdmi3.File "/codecs/hda/hdmi.conf"
c4a1f5
 	}
c4a1f5
 }